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.
- Host: GitHub
- URL: https://github.com/mackron/c89str
- Owner: mackron
- Created: 2022-12-18T21:48:48.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-03-13T22:29:59.000Z (about 1 year ago)
- Last Synced: 2025-03-25T02:36:41.883Z (about 1 year ago)
- Language: C++
- Size: 811 KB
- Stars: 27
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
C89 compatible string library.
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.