Common string utilities for C I'm sick of rewriting:
- Utilities for string "slices" (also known as "views" or "spans"), which are a pointer + length. Useful for substring references.
- Polyfill implementations for strdup(), strndup(), and memccpy()
- strzcpy(), a sane alternative to strncpy()
Building
The recommended way to use str is to compile the source files directly into your project. If your project uses git, you can add str as a git submodule.
If you prefer to link against a static library instead, make release will produce one.
# Compile static library with optimizations
make release
# Compile static library with debug information
make debug
# Generate Doxygen documentation (html & man pages)
make docs
# Run tests
make test