[Insert logo here]
A general purpose library written in pedantic c99. It's incompatable with MSVC because it doesn't implement __typeof__
which is used quite a bit in macros.
Copy es.h into your project. Include it and define ES_IMPL in ONE source file.
#define ES_IMPL
#include <es.h>
- Dynamic array
- Hash table
- Windowing
- Graphics
- File operations
- Math
- Logging
- Memory debugging
- Assertions
- Threading
- Strings
- Library loading
- Error handler
- Unit tests
- Profiler
Everything is written in lowercase with underscores (some exceptions apply).
Types will be suffixed with a _t
.
Other than basic types, such as ints and floats, the types will be prefixed with es as a namespace.
Example:
i32_t everything = 42;
f32_t pi = 3.1415926f;
es_type_t foo = {0};
Functions are prefixed with es as a namespace.
Functions are also prefixed with it's operational type such as es_type_operation
.
An internal function will be prefixed with an underscore. If the function is a lower level macro then it's suffixed with a _impl
.
Example:
// External function.
es_type_t es_type_init(i32_t foo, b8_t bar);
// Internal function.
void _es_type_private(es_type_t *type);
Macro functions only difference from regular functions are their argument names which are uppercase and usually shortened.
Macro values are all uppercase to signify a constant value.
Example:
#define es_macro_function(F, B) do { es_type_init((F), (B)); } while(0)
#define ES_MACRO_VALUE 42
Variables are just named according to their use. If a variable is global it is suffixed with a _g
.
A constant variable will be all uppercase.
Example:
b8_t global_bool_g;
f32_t three_halves = 1.5f;
const f32_t CONSTANT_VARIABLE = 23;