https://github.com/bullno1/libs
Misc libraries
https://github.com/bullno1/libs
arena coroutine filewatcher hashtable incbin
Last synced: 4 months ago
JSON representation
Misc libraries
- Host: GitHub
- URL: https://github.com/bullno1/libs
- Owner: bullno1
- License: unlicense
- Created: 2024-04-09T13:18:02.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2026-02-13T00:12:58.000Z (4 months ago)
- Last Synced: 2026-02-13T00:56:11.053Z (4 months ago)
- Topics: arena, coroutine, filewatcher, hashtable, incbin
- Language: C
- Homepage:
- Size: 521 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# blibs
[](https://github.com/bullno1/libs/actions/workflows/build.yml)
Collection of miscellaneous single-header libraries.
|Library|Description|
|-------|-----------|
|[autolist.h](tests/autolist)|A list of items collected from all compilation units|
|[xincbin.h](tests/xincbin)|A cross-platform way to include binary data in your executable|
|[bresmon.h](tests/bresmon)|File watcher|
|[mem_layout.h](tests/mem_layout)|Combine multiple mallocs of a nested struct into one|
|[barena.h](tests/barena)|Arena allocator|
|[tlsf.h](tests/tlsf)|Adaptation of [jserv/tlsf-bsd](https://github.com/jserv/tlsf-bsd)|
|[bhash.h](tests/bhash)|Hashtable|
|[barray.h](barray.h)|Dynamic array|
|[bcoro.h](tests/bcoro)|Coroutine|
|[bserial.h](tests/bserial)|Binary serialization|
|[bspsc.h](tests/bspscq)|Single producer single consumer queue|
|[barg.h](barg.h)|CLI argument parsing|
|[bmacro.h](bmacro.h)|Commonly used macros|
|[bminmax.h](bminmax.h)|Min/Max/Clamp macros using `_Generic`|
|[btest.h](btest.h)|Unit test framework (based on autolist)|
|[blog.h](blog.h)|Logging, with short filenames|
|[qoi.h](qoi.h)|Quite OK image encoding/decoding|
|[bent.h](bent.h)|Entity component system|
|[bsv.h](bsv.h)|Binary seriallization with explicit versioning|
|[bstacktrace.h](bstacktrace.h)|Portable stacktrace with source mapping|
|[bcrash_handler.h](bcrash_handler.h)|Crash handler|
Each one has example and documentation in the corresponding tests directory.
Tested on:
* Linux (GCC+Clang)
* Windows (MSVC)
## On allocator
Whenever a library needs to allocate memory a `memctx` argument can be passed to it.
By default it uses libc for memory and `memctx` is ignored.
The macro `_REALLOC` can be used to override the allocator.
`BLIB_REALLOC` is also recognized as a catch-all allocator.