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 LIST_H_ | |
#define LIST_H_ | |
#define LIST(TYPE, SIZE) \ | |
\ | |
static TYPE list_##TYPE[SIZE]; \ | |
static int list_start_##TYPE = 0; \ | |
static int list_end_##TYPE = 0; \ | |
int list_##TYPE_size = 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
#ifndef HASHTABLE_H_ | |
#define HASHTABLE_H_ | |
#include <string.h> | |
unsigned int djb2(const char *str){ | |
unsigned long hash = 5381; | |
int c; | |
while ((c = *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
#ifndef _AUTO_BUILD_H_ | |
#define _AUTO_BUILD_H_ | |
#include <stdlib.h> | |
#ifndef AUTOBUILD_TARGET | |
#ifdef _WIN32 | |
#define AUTOBUILD_TARGET "autobuild.exe" | |
#else | |
#define AUTOBUILD_TARGET "./autobuild" |
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 <stdarg.h> | |
#include <wchar.h> | |
char *makestr(char *format, ...) { | |
va_list args; | |
int size; | |
char *result; | |
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 _GO_H_ | |
#define _GO_H_ | |
#include <curl/curl.h> | |
typedef struct { | |
char *headers; | |
char *body; | |
CURL *handle; | |
long int statuscode; |
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 _PRINTER_PAGE_H_ | |
#define _PRINTER_PAGE_H_ | |
#include <windows.h> | |
/* compile with flags -lgdi32 and -lwinspool */ | |
int PrintPage(wchar_t *printer_name, void (*callback)(HDC printer, void *userdata), void *userdata) { | |
HDC printer; | |
DOCINFOA docinfo; |
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_SQL_H_ | |
#define _EASY_SQL_H_ | |
#include <mysql.h> | |
#include <stdio.h> | |
#include <string.h> | |
typedef my_ulonglong MYSQL_COUNT; | |
MYSQL *sql_open(char *host, int port, char *user, char *pass, char *db); |
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
void utf8_encode(int codepoint, unsigned char encoded[5]) { | |
if (codepoint < 0x80) { | |
encoded[1] = 0; | |
encoded[0] = codepoint; | |
encoded[0] &= ~(1 << 7); | |
return; | |
} | |
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 ELF_H | |
#define ELF_H | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#ifndef ELF_CAPACITY | |
#define ELF_CAPACITY 1024 | |
#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
#ifndef MYSQL_API_H | |
#define MYSQL_API_H | |
#include <mysql.h> | |
#include <stdio.h> | |
typedef struct MYSQL_CTX { | |
/* public */ | |
unsigned int rows; | |
unsigned int columns; |