blob: 303eea49ecdca1dc605315f02b98ef44fd5aa8ad (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
MLib — Useful Standard Library Extensions
MLib is a collection of various headers and libraries that I find useful
in a large enough number of my personal C projects. This includes for
example: common datastructures, useful non-POSIX APIs, and 21st-century
strings.
This does not aim to be a LibC replacement, but rather a supplimentary
library. It is a C23 library with no plans to support older standards.
The headers as of now are:
• alloc.h — allocators and memory allocation functions
• bitset.h — bitset implementation
• dynarr.h — dynamic array implementation
• errors.h — err.h-inspired diagnostics functions
• macros.h — miscellaneous utility macros (MIN/MAX/lengthof/etc.)
• mbio.h — multibyte file I/O
• mbstring.h — multibyte-strings
• optparse.h — option parsing functions
• rune.h — inttypes.h but for runes
• unicode/prop.h — unicode character properties
• unicode/string.h — unicode string functions
BUILD INSTRUCTIONS:
To build Mlib you need to have a C23 conforming C compiler. Simply
bootstrap the build system and run it:
$ cc -o make make.c
$ ./make
To build with optimizations enabled, use the -r flag:
$ ./make -r
DISCLAIMER:
This library is developed for use by me (the author). You are free
to use this code for whatever you’d like, but do be warned that
breaking changes may (and will) occur at any moment with no prior
warning. Additionally, be warned that I do not care about whether or
not you think the API is well-designed or human-friendly. If you
have an issue with the code here, fix it — you are a programmer are
you not?
Planned Features:
• Missing Unicode Properties (unicode/prop.h)
• String Case Conversions (unicode/string.h)
• Unicode Normalization (unicode/string.h)
• Word- and Line Segmentation (unicode/string.h)
|