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 <stdarg.h> | |
unsigned int counter(const char *str) { | |
unsigned int i = 1; | |
while (*str) { | |
if (*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 <string.h> | |
#define BASE64_SIZE(str) ((4 * strlen(str) / 3) + 3) & ~3 | |
static char const *to_base64_table = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | |
static char const from_base64_table[] = { | |
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
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 <string.h> | |
#define HTONS(n) (((((unsigned short)(n) & 0xFF)) << 8) | (((unsigned short)(n) & 0xFF00) >> 8)) | |
#define NTOHS(n) (((((unsigned short)(n) & 0xFF)) << 8) | (((unsigned short)(n) & 0xFF00) >> 8)) | |
#define HTONL(n) (((((unsigned long)(n) & 0xFF)) << 24) | \ | |
((((unsigned long)(n) & 0xFF00)) << 8) | \ | |
((((unsigned long)(n) & 0xFF0000)) >> 8) | \ |
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 "./easy-curl.h" //https://gist.github.com/opsJson/6200d1fe4666b6bfa6919677a05428b0 | |
char _WEBDRIVER_SESSION[33]; | |
typedef enum WEBDRIVER_CODE { | |
WEBDRIVER_SUCCESS, | |
WEBDRIVER_ERROR_JAVASCRIPT, | |
WEBDRIVER_ERROR_NO_SESSION | |
} WEBDRIVER_CODE; |
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 <string.h> | |
#include <signal.h> | |
typedef struct json_t { | |
char *key; | |
char *value; | |
} json_t; | |
void _json_parse(int 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
#include <curl/curl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdarg.h> | |
typedef struct EasyCurlString { | |
int size; | |
char **str; | |
} EasyCurlString; |
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 <stdbool.h> | |
typedef struct header { | |
unsigned char signature[2]; | |
unsigned int fileSize; | |
unsigned int reserved; | |
unsigned int dataOffset; | |
} Header; |
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 <stdbool.h> | |
typedef struct riff { | |
unsigned char chunkID[4]; | |
unsigned int chunkSize; | |
unsigned char format[4]; | |
} Riff; |
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 <windows.h> | |
void *GetFunctionFromDll(LPCSTR DLL, LPCSTR procName) { | |
HMODULE hModule; | |
void *function; | |
if ((hModule = LoadLibrary(DLL)) == NULL) | |
{ | |
fwprintf(stderr, L"ERROR: could not load DLL.\n"); |
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> | |
#define unique_ptr(destructor) __attribute__ ((cleanup(destructor))) | |
void destructor(void *ptr) { | |
void *aux = *(void**)ptr; | |
fclose(aux); | |
printf("file closed.\n"); |