Skip to content

A collection of small easy-to-use libraries written in C

License

Notifications You must be signed in to change notification settings

henrikglass/hgl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hgl

A collection of small easy-to-use header only libraries written in C.

library Category Description
hgl_arena_alloc.h Allocator Arena allocator.
hgl_stack_alloc.h Allocator Stack allocator (requires hgl_arena_alloc.h).
hgl_pool_alloc.h Allocator Pool allocator.
hgl_fs_alloc.h Allocator A "free stack" allocator. Similar to other free list allocators.
hgl_memdbg.h Allocator/Utility Quick and easy leak checking replacement for malloc, realloc, and free.
hgl_vector.h Data Structure Typed* dynamic (resizable) array.
hgl_da.h Data Structure Macro-only generic dynamic array implementation.
hgl_q.h Data Structure Macro-only generic queue (circular buffer) implementation.
hgl_hash_table.h Data Structure Typed* Robin Hood style hash table/map.
hgl_htable.h Data Structure Basically hgl_hash_table.h, but without the type stuff.
hgl_hset.h Data Structure Basically hgl_htable.h, but without the value.
hgl_ring_buffer.h Data Structure Typed* circular buffer.
hgl_rbtree.h Data Structure Your CS professor's ye olde red-black tree.
hgl_chan.h Data Structure/Thread Utility Typed* synchronized message passing utility. Similar to Go's channels.
hgl_buffered_chan.h Data Structure/Thread Utility Typed* and buffered synchronized message passing utility. Similar to Go's buffered channels.
hgl_string.h Data Strucutre/Utility Dynamic string builder, sized strings, and easy-to-use string operations.
hgl_sockets.h Networking/Utility A simple to use wrapper around Linux sockets (TCP/UDP)
hgl_worker_pool.h Multithreading/Utility Thread/Worker pool.
hgl_barrier.h Multithreading/Utility Barrier synchronization primitive.
hgl_hotload.h Utility Quick and easy hotloading.
hgl_profile.h Utility Quick and dirty profiling.
hgl_process.h Utility Utility for spawning, running, and chaining together subprocesses. Basically execvp minus the headache.
hgl_serialize.h Utility Powerful binary parsing and serializing/unserializing with a simple regex-like language.
hgl_cmd.h Utility Simple command prompt user interface with tab completion.
hgl_flags.h Utility Simple utility for parsing command-line arguments.
hgl_ini.h Utility Simple utility for parsing (and generating) *.ini files
hgl_io.h Utility Simple file I/O.
hgl_fft.h Algorithm An implementation of the Fast Fourier Transform (FFT) using SIMD.
hgl_rle.h Algorithm Run-length encoding and decoding. Supports multiple data and run-length block sizes.
hgl_hamming.h Algorithm Hamming(16,11) encoding and decoding system.
hglm.h Math Vector math library with some SIMD support.
hglm_aliases.h Math Aliases for hglm.h without hglm_ and Hglm prefixes, to make things less wordy.
hgl_test.h Unit Testing Framework. Simple but powerful unit testing framework.
hgl.h Utility/Misc. Misc. typedefs and macros that I use from time to time.

* In this context "typed" means that the type of data that is held by the data structure can be set at compile time by defining one or two macros before including.

Building

To build all examples and to build and run all tests, run:

$ make

To build all examples, run:

$ make examples

To build a specific example, run make followed by the name of the example program:

$ make fft

To build and run all tests, run:

$ make test

About

A collection of small easy-to-use libraries written in C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published