an stb-style single header lib for length-prefixed strings in C, in ~50 LOC.
- C 100%
| test | ||
| LICENSE | ||
| lstr.h | ||
| README.md | ||
lstr
an stb-style single header lib for length-prefixed strings in C, in ~50 LOC.
from the primary type's definition:
lstr is a length-prefixed string that looks and
behaves like a standard null-terminated string.
It can only be created, modified and freed by
lstr_* functions, but it can be read by standard
null-terminated string readers, like printf.
usage
#define LSTR_IMPLEMENTATION before lstr.h in one source file, and include
lstr.h wherever it's used.