scratch/misc/nstr
2025-04-05 19:35:15 -03:00
..
nstr.h add nstr 2025-04-05 19:31:25 -03:00
nstr_test.c add nstr 2025-04-05 19:31:25 -03:00
README.md add nstr 2025-04-05 19:31:25 -03:00

nstr

Of course yet another single-header string library for C.

This library provides a simple Str type, supporting dynamic extending or fixed static buffers.

Usage

In a single C file in your project do:

#define NSTR_IMPLEMENTATION /* this is to enable the implementations */
#include "nstr.h"

Then nstr.h can be freely included in any other file, which will only include the signatures, macros and types.

Functions and macros of this library are prefixed with nstr_ (because str* is reserved in C).

Documentation

See the header file, the documentation are the comments.

TODO some examples, for now the nstr_test.c serves as an example.

License

This library is under the Unlicense.