README.md

Wed, 16 Dec 2020 16:17:34 +0100

author
David Demelier <markand@malikania.fr>
date
Wed, 16 Dec 2020 16:17:34 +0100
changeset 18
7f5b3f035bef
parent 7
4a166914a61f
child 23
b7690784cd17
permissions
-rw-r--r--

misc: update before 0.2.0

0
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 libbuf
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 ======
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
3
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 Minimalist dynamic string library for C99.
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
5
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 Documentation
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 -------------
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
8
18
7f5b3f035bef misc: update before 0.2.0
David Demelier <markand@malikania.fr>
parents: 7
diff changeset
9 See the `libbuf.3` manual page for an overview.
0
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
10
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 Portability
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 -----------
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
13
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 The code itself is compatible with any compiler that provides C99 support at
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 least but should also support the POSIX `ENOMEM` constant. If not present on
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 your system you should never check global `errno` value while using this
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
17 function.
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
18
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
19 It was tested on:
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
20
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 - MinGW-w64,
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 - Visual Studio 2019,
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 - macOS Catalina (10.15.7),
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 - Linux (musl, glibc),
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
25 - FreeBSD,
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 - OpenBSD,
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 - NetBSD.
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
28
7
4a166914a61f misc: update README.md
David Demelier <markand@malikania.fr>
parents: 5
diff changeset
29 API compatibility
4a166914a61f misc: update README.md
David Demelier <markand@malikania.fr>
parents: 5
diff changeset
30 -----------------
4a166914a61f misc: update README.md
David Demelier <markand@malikania.fr>
parents: 5
diff changeset
31
4a166914a61f misc: update README.md
David Demelier <markand@malikania.fr>
parents: 5
diff changeset
32 The library follows strictly [semantic versioning][semver].
4a166914a61f misc: update README.md
David Demelier <markand@malikania.fr>
parents: 5
diff changeset
33
0
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
34 FAQ
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 ---
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
36
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
37 ### Why another library?
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
38
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
39 Sure there are a lot of string management libraries out there but I wanted a
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
40 very minimal one that does not include fancy things like trim, split, tokenizer
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
41 and such. This library only exposes 13 functions to the user which should be
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
42 enough.
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
43
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
44 At the time of writing it's also less than 350 lines of code.
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
45
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
46 Also, I wanted a library easy to embed everywhere without a complicated build
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
47 process. This library can be bundled in your project by just copying all .c
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
48 files and .h files without any modification.
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
49
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
50 ### Why every function is defined in its own file?
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
51
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
52 Because it improves static linking as only symbols you need are bundled into
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
53 your final executable.
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
54
5
956a8f2f5950 misc: update README.md
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
55 ### Why not using `open_memstream`?
956a8f2f5950 misc: update README.md
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
56
956a8f2f5950 misc: update README.md
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
57 It's a POSIX function that is not available on every operating system, but if
956a8f2f5950 misc: update README.md
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
58 you don't care about portability you can obviously stick with it.
956a8f2f5950 misc: update README.md
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
59
0
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
60 Author
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
61 ------
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
62
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
63 David Demelier <markand@malikania.fr>
7
4a166914a61f misc: update README.md
David Demelier <markand@malikania.fr>
parents: 5
diff changeset
64
4a166914a61f misc: update README.md
David Demelier <markand@malikania.fr>
parents: 5
diff changeset
65 [semver]: https://semver.org

mercurial