README.md

Wed, 16 Dec 2020 16:20:53 +0100

author
David Demelier <markand@malikania.fr>
date
Wed, 16 Dec 2020 16:20:53 +0100
changeset 20
08a6d4e6012d
parent 18
7f5b3f035bef
permissions
-rw-r--r--

misc: added signature for changeset cf6a2b8642c1

libbuf
======

Minimalist dynamic string library for C99.

Documentation
-------------

See the `libbuf.3` manual page for an overview.

Portability
-----------

The code itself is compatible with any compiler that provides C99 support at
least but should also support the POSIX `ENOMEM` constant. If not present on
your system you should never check global `errno` value while using this
function.

It was tested on:

- MinGW-w64,
- Visual Studio 2019,
- macOS Catalina (10.15.7),
- Linux (musl, glibc),
- FreeBSD,
- OpenBSD,
- NetBSD.

API compatibility
-----------------

The library follows strictly [semantic versioning][semver].

FAQ
---

### Why another library?

Sure there are a lot of string management libraries out there but I wanted a
very minimal one that does not include fancy things like trim, split, tokenizer
and such. This library only exposes 13 functions to the user which should be
enough.

At the time of writing it's also less than 350 lines of code.

Also, I wanted a library easy to embed everywhere without a complicated build
process. This library can be bundled in your project by just copying all .c
files and .h files without any modification.

### Why every function is defined in its own file?

Because it improves static linking as only symbols you need are bundled into
your final executable.

### Why not using `open_memstream`?

It's a POSIX function that is not available on every operating system, but if
you don't care about portability you can obviously stick with it.

Author
------

David Demelier <markand@malikania.fr>

[semver]: https://semver.org

mercurial