This is one more single-header C99 string list library. It is intended for:
- LIFO queue usage (last-in-first-out)
- Situations that don't need better performance than
realloccallsand O(n) counting - Folks who want a bring-your-own-allocator solution
- Those who like BSD's stringlist.h and wish they had a worse, (potentially) more portable version
- Those who haven't already copy/pasted stb_ds.h
- People who enjoy the risk of NULL terminated data structures
sl.h follows the single-header pattern. To use, include sl.h in your project and define SL_IMPL exactly once in a C source file of your choice. More information on using single-header libraries.
#define SL_IMPL
#include "sl.h"For specific usage details of the C API, see sl.h.
You may override the realloc, free, and strdup calls made internally by defining SL_OVERRIDE and then defining each of the following macros:
SLX_REALLOCSLX_FREESLX_STRDUP
Any replacement functions must conform to the same interface as their standard counterparts, including in their error handling.
git clone https://github.com/Cryptkeeper/slcd slcmake -Bbuildcmake --build build
A static library artifact is available as build/libsl.a, and the generated single-header file is available as build/sl.h.