C scraps
Code that reflects a minimalist C library
philosophy, particularly the ideas of
providing functionality with a minimum of overhead and API complexity. Basic
ideas:
- Each scrap provides clear, limited functionality.
- As a result a scrap’s codebase potentially stabilizes very quickly.
- Each is plain old standard C.
- Drop its .c and .h files into your project and that’s it. No formal
libraries are built. The Github repos for each contain makefiles, build and
test rigs, examples, etc., but you don’t need any of it to use a scrap.
- When it makes sense, the scrap is object-oriented and thread-safe. Objects
are represented by opaque structs.
General purpose
- cbuf. Provides getc and ungetc on a
character string. Nothing auspicious, simply handy.
- cstrm. Provide something like a character
stream based on a string.
- hashtab. Provides a hash table.
- linereader. Read a file or stream
line by line.
- linewrapper. Very simple text
wrapping.
- pqueue. A priority queue ADT.
- sbuf. A simple string buffer.
- shuffle. Shuffle a general array.
- stringer. Build a list of strings with
attention to minimizing allocation of new memory.
- tokenset. Map tokens/strings to
integer ids and back again.
- varstr. A variable length string.
- fareader. Read a file or stream of
sequences in FASTA format.
- fqreader. Read a file or stream of
sequences in FASTQ format.
- nsequtils. Utilities for working with
nucleotide sequence data.