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> | |
#include <math.h> | |
char itoc(int i) { | |
if (i < 0) return 0; | |
return ((i-1) % 26) + 65; | |
} |
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
#ifndef EASY_WIN32_CONTROLS_H | |
#define EASY_WIN32_CONTROLS_H | |
// EXAMPLE: | |
// https://ibb.co/GRHmv5s | |
// case WM_CREATE: { | |
// startWindow(5, 5, hwnd); | |
// | |
// newWindow(STATIC, "Edit Example:", 0, 0, 0); |
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 <stdio.h> | |
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) | |
#include <fcntl.h> | |
#define PIPE(X) _pipe(X, 2, O_RAW) | |
#else | |
#include <unistd.h> | |
#define PIPE(X) pipe(X) | |
#endif |
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 <ctype.h> | |
enum json_value_type { | |
jv_string, | |
jv_number, | |
jv_array, | |
jv_object | |
}; |
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> | |
void *__malloc__(size_t size) { | |
size_t *memory; | |
memory = (size_t*)malloc(sizeof(size_t) + size); | |
if (memory == NULL) return NULL; | |
*memory = size; |
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"); |
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> | |
#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 <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 <curl/curl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdarg.h> | |
typedef struct EasyCurlString { | |
int size; | |
char **str; | |
} EasyCurlString; |