|
| 1 | +## What's here |
| 2 | + |
| 3 | +This is a collection of useful public-domain C code by myself and others. |
| 4 | +The best way to use it is to pick and choose the bits you need and |
| 5 | +statically compile them in. |
| 6 | +Take a look at `libsupportinit.c` to see if there are any initialization |
| 7 | +functions you might need to call. |
| 8 | +A summary of the available functionality follows. |
| 9 | + |
| 10 | +### IOS |
| 11 | + |
| 12 | +A replacement for parts of C's stdio library, supporting file-descriptor-backed |
| 13 | +and memory-backed I/O streams with a uniform interface. Also has special |
| 14 | +support for UTF-8, and slightly relaxed semantics that allow keeping data |
| 15 | +buffered longer. |
| 16 | + |
| 17 | +### Bit vectors |
| 18 | + |
| 19 | +This is a pretty thorough bit vector library. The most interesting thing about |
| 20 | +it is that it supports many operations on contiguous sub-vectors of bits. |
| 21 | +This is helpful when implementing strided multi-dimensional arrays of bits. |
| 22 | + |
| 23 | +### Arraylist |
| 24 | + |
| 25 | +A very simple growable array. |
| 26 | + |
| 27 | +### dirpath.c |
| 28 | + |
| 29 | +Contains the function `get_exename`, which can tell you the path to your |
| 30 | +running executable on Linux, Windows, and Mac OS X. Allows you to locate |
| 31 | +application files without "installing" anything. |
| 32 | + |
| 33 | +### dump.c |
| 34 | + |
| 35 | +A routine for printing hex dumps. |
| 36 | + |
| 37 | +### Hashing |
| 38 | + |
| 39 | +High-quality hash functions for strings and integers. |
| 40 | + |
| 41 | +### Hash table |
| 42 | + |
| 43 | +A fast linear-probing hash table. Hardly ever allocates memory when |
| 44 | +inserting a key. It generally avoids collisions by using good hash functions. |
| 45 | +Use it by defining your hash function and equality predicate, then |
| 46 | +invoking a macro. See `ptrhash.c` for an example. |
| 47 | + |
| 48 | +### Other |
| 49 | + |
| 50 | +Some convenient wrapper functions for using sockets and time info on |
| 51 | +multiple platforms. |
0 commit comments