Dynamically Allocatable String in C.
- Depends on rphii/rlc
git clone https://github.com/rphii/so && cd so
setup build && meson install -C buildInstallation features:
librlso.sotheSolibrary- man pages (WIP)
There are various tests.
- lcov (coverage)
- gcovr (coverage)
- valgrind (recommended)
emerge -a gcovr lcov valgrindpacman -S gcovr lcov valgrindSee the provided run-tests.sh script.
See output of where the last command put the .html file.
*Byte counts are assuming a 64 bit machine/architecture.
- Any substring has a footprint of 16 bytes
- Any program-lifetime / data-segment string has a footprint of 16 bytes
- Operations on the stack, if length is <=15 bytes (operations without dynamically allocating!)
- Dynamically resizable to a heap string, with a maximum length of 2^56-1
Notes:
- Endian doesn't matter (we need to know it to compile / set up TWO structs, and after that it doesn't matter)
- Doesn't matter if machine/architecture is 64 bits or not, it still works (it should! XD)
- Strings are not 0-terminated. Appropriate functions/macros for printing and other opterations shall be provided
- Automatically converts any (sub-) string into a dynamic one, if manipulated
Things that are not linked are planned but not yet implemented.
| part | description | .h | .c |
|---|---|---|---|
so-core.md |
core string | so.h | so.c |
so-cmp.md |
comparison | so-cmp.h | so-cmp.c |
so-find.md |
find within | so-find.h | so-find.c |
so-count.md |
count things | so-count.h | so-count.c |
so-split.md |
split into parts | so-split.h | so-split.c |
so-splice.md |
splice repeatedly | so-splice.h | so-splice.c |
so-as.md |
string to type conversions | so-as.h | so-as.c |
so-uc.md |
utf8 + unicode conversions | so-uc.h | so-uc.c |
so-fx.md |
formatting (bold, it, ul, rgb) | ||
so-file.md |
read + write files | so-file.h | so-file.c |
so-env.md |
environment variables | so-env.h | so-env.c |
so-trim.md |
trimming | so-trim.h | so-trim.c |
so-path.md |
handling as path | so-path.h | so-path.c |
so-print.md |
printing | so-print.h | so-print.c |
so-input.md |
user input | so-input.h | so-input.c |