libreis 0.1.0
A simple header-based drop-in library
Loading...
Searching...
No Matches
reis.h
Go to the documentation of this file.
1
7#ifndef REISLIB_INCLUDE_COMMON_H_
8#define REISLIB_INCLUDE_COMMON_H_
9
10#include <stdlib.h>
11#include <unistd.h>
12#include <stdint.h>
13#include <string.h>
14#include <stdio.h>
15#include <dirent.h>
16#include <sys/stat.h>
17#include <sys/time.h>
18#include <sys/resource.h>
19#include <sys/types.h>
20#include <sys/prctl.h>
21#include <signal.h>
22#include <syslog.h>
23#include <time.h>
24#include <fcntl.h>
25
26#ifdef __cplusplus
27 #include <atomic>
28extern "C" {
29#else
30 #include <stdatomic.h>
31#endif
32
33#if defined(__APPLE__)
34 #include <wchar.h>
35#elif defined(__linux__)
36 #include <wchar.h>
37 #include <wctype.h>
38 #include <ctype.h>
39#endif
40
41#include <reis/memory.h>
42
43#define VERISION "0.1.0"
44
45#if defined(BENCHMARK) || defined(LIBREIS_DEBUG)
46 #pragma message "You are currently using a debug version of reis library."
47#endif
48
49/* GENERAL SETTINGS */
50#define REISLIB_INT_MAX 2147483647
51#define CHARSET "abcdefghijklmnopqrstuvwxyz"
52#define CHARSET_LEN 26
53#define MAX_CHARSET_SIZE 256
54#define SUB 0x1A // an empty char as not to interfere with '\0'
55
56typedef uint8_t u8;
57typedef uint16_t u16;
58typedef uint32_t u32;
59typedef uint64_t u64;
60typedef int8_t s8;
61typedef int16_t s16;
62typedef int32_t s32;
63typedef int64_t s64;
64typedef float f32;
65typedef double f64;
66typedef long double f128;
67
68#if !defined(__cplusplus)
69 #if !defined(bool)
70 typedef enum __attribute__((__packed__)) { false, true } bool;
71 #endif
72#endif
73
74#define fnname(name) #name
75
76#define foreach for
77
78#ifdef __cplusplus
79}
80#endif
81
82#endif // REIS_INCLUDE_COMMON_H__