This is a collection of useful public-domain C code by myself and others.
The best way to use it is to pick and choose the bits you need and
statically compile them in.
Take a look at
libsupportinit.c to see if there are any initialization
functions you might need to call.
A summary of the available functionality follows.
A replacement for parts of C's stdio library, supporting file-descriptor-backed and memory-backed I/O streams with a uniform interface. Also has special support for UTF-8, and slightly relaxed semantics that allow keeping data buffered longer.
This is a pretty thorough bit vector library. The most interesting thing about it is that it supports many operations on contiguous sub-vectors of bits. This is helpful when implementing strided multi-dimensional arrays of bits.
A very simple growable array.
Contains the function
get_exename, which can tell you the path to your
running executable on Linux, Windows, and Mac OS X. Allows you to locate
application files without "installing" anything.
A routine for printing hex dumps.
High-quality hash functions for strings and integers.
A fast linear-probing hash table. Hardly ever allocates memory when
inserting a key. It generally avoids collisions by using good hash functions.
Use it by defining your hash function and equality predicate, then
invoking a macro. See
ptrhash.c for an example.
Some convenient wrapper functions for using sockets and time info on multiple platforms.