README.md

Thu, 29 Oct 2020 19:57:10 +0100

author
David Demelier <markand@malikania.fr>
date
Thu, 29 Oct 2020 19:57:10 +0100
changeset 5
956a8f2f5950
parent 0
b1991ee4451d
child 7
4a166914a61f
permissions
-rw-r--r--

misc: update README.md

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
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 You can generate the documentation using `make doxygen`, otherwise you can also
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 read the *libbuf.3* manual page.
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
11
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 Portability
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
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 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
16 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
17 your system you should never check global `errno` value while using this
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
18 function.
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
19
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
20 It was tested on:
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
21
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 - MinGW-w64,
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 - Visual Studio 2019,
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 - macOS Catalina (10.15.7),
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
25 - Linux (musl, glibc),
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 - FreeBSD,
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 - OpenBSD,
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
28 - NetBSD.
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
29
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
30 FAQ
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 ---
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
32
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
33 ### Why another library?
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
34
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 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
36 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
37 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
38 enough.
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
39
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
40 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
41
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
42 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
43 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
44 files and .h files without any modification.
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 ### Why every function is defined in its own file?
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
47
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
48 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
49 your final executable.
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
50
5
956a8f2f5950 misc: update README.md
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
51 ### Why not using `open_memstream`?
956a8f2f5950 misc: update README.md
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
52
956a8f2f5950 misc: update README.md
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
53 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
54 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
55
0
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
56 Author
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
57 ------
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
58
b1991ee4451d misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
59 David Demelier <markand@malikania.fr>

mercurial