An open API service indexing awesome lists of open source software.

https://github.com/mackron/c89str

C89-compatible, single file, public domain string library.
https://github.com/mackron/c89str

Last synced: about 1 year ago
JSON representation

C89-compatible, single file, public domain string library.

Awesome Lists containing this project

README

          

C89 compatible string library.


discord
mastodon
twitter

This is a single file library for making working with strings in C a bit easier.

Main features:
- A suite of UTF-8, UTF-16 and UTF-32 conversion routines.
- An API for dynamic strings (`c89str`).
- Alternatives to some standard library functions.
- A suite of miscellaneous APIs that might be useful.
- An implementation of sprintf().

The APIs in this library are focused on flexibility and will favor verbosity over simplicity. All functions return
a result code. When a function could possibly need to do a memory allocation, a parameter will exist for a pointer
to allocation callbacks. If you're after a terser API you should consider looking elsewhere or build your own
wrapper.

I do not maintain version numbers for this library, nor do I guarantee API-compatibility. You need to look
elsewhere if this is an issue for you.

To define the implementation, do this in one source file:

#define C89STR_IMPLEMENTATION
#include "c89str.h"

See the top of c89str.h for more details about the library.