This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOCAL_PATH := $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_MODULE := FriengerScreenRecord | |
LOCAL_SRC_FILES := Log.cpp CustomFrameBuffer.cpp CustomFrameTexture.cpp FriengerScreenRecord.cpp | |
LOCAL_CFLAGS := -Werror -std=gnu++11 | |
LOCAL_LDLIBS := -llog -lGLESv2 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MINCTEST - Minimal Duktape Test Library | |
// This is based on minctest.h (https://codeplea.com/minctest) | |
// | |
/* | |
feel to free to improve | |
you will need implement a module loading OR embed 'all-in-one' | |
checkout: https://wiki.duktape.org/howtomodules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on original | |
// https://github.com/clibs/strdup/blob/master/strdup. | |
#define strdup_check 1 | |
#define strdup_verbose 0 | |
#define strdup_align(x) (((x)+15)&~15) // 3 (4 bytes), 7 (8 bytes), 15 (16 bytes) | |
static char* strdup_aligned(const char *str) { | |
int len; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file fsm.c | |
* @brief an implementation for a FSM in C, this file contains | |
* implementation of definations. | |
* License GPLv3+ | |
* @author Ankur Shrivastava | |
*/ | |
#include "fsm.h" | |
#include<stdlib.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <openssl/evp.h> | |
#include <openssl/rand.h> | |
char* base64_encode(const void *s, int length, int *ret_length) { | |
BIO *bio = NULL, *b64 = NULL; | |
BUF_MEM *bufferPtr = NULL; | |
char *encoded = NULL; | |
const unsigned char* str = (const unsigned char*) s; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html | |
*/ | |
#include <stdio.h> | |
int main(void) { | |
printf("%d ", __COUNTER__ ); | |
printf("%d ", __COUNTER__ ); | |
printf("%d ", __COUNTER__ ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
one simple way to align memory alloc'ed | |
based on sqlite3 macro | |
+7 = 8 (64-bit) | |
+3 = 4 (32-bit) | |
HINT: you can try ptrdiff_t too =) | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void str_replace(void *s, unsigned char target, unsigned char to) { | |
unsigned char* str = (unsigned char*) s; | |
while (*str) { | |
if (*str == target) { | |
*str = to; | |
} | |
str++; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void str_remove(void *s, unsigned char target) { | |
unsigned char* str = (unsigned char*) s; | |
int len = strlen(str); | |
int i, j = 0; | |
for (i = 0; i < len; i++) { | |
if (str[i] != target) { | |
str[j++] = str[i]; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/time.h> | |
#include <sys/resource.h> | |
double get_time() | |
{ | |
struct timeval t; | |
struct timezone tzp; | |
gettimeofday(&t, &tzp); |