diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-03-10 15:08:10 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-03-10 15:08:10 +0200 |
commit | 791d6bc10ec81d08324807211d968d7e37110f0b (patch) | |
tree | b38d150964199381d7e443975d375ba2a858f864 /include | |
parent | d78cf57211f24aeebc5e2f30927e2410bf068983 (diff) |
Remove Bob the String-Builder
Seeing as dynarr.h already exists, there is no real use for Bob the
String-Builder. It was *a bit* nice because of the generic u8strpush()
macro, but it should be very easy to implement yourself, and you only
really ever need 1 or 2 specific functions that are a few lines of code
each.
Diffstat (limited to 'include')
-rw-r--r-- | include/bob.h | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/include/bob.h b/include/bob.h deleted file mode 100644 index 699aa5e..0000000 --- a/include/bob.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef MLIB_BOB_H -#define MLIB_BOB_H - -#include <stddef.h> - -#include "__charN_t.h" -#include "__rune.h" -#include "__u8view.h" - -struct u8str { - char8_t *p; - size_t len, cap; -}; - -struct u8str *u8strinit(struct u8str *, size_t); -struct u8str *u8strgrow(struct u8str *, size_t); -struct u8str *u8strfit(struct u8str *); -void u8strfree(struct u8str); - -struct u8str *u8strpushr(struct u8str *, rune); -struct u8str *u8strpushstr(struct u8str *, const char *); -struct u8str *u8strpushu8(struct u8str *, struct u8view); - -[[gnu::always_inline]] -static inline struct u8view -u8strtou8(struct u8str s) -{ - return (struct u8view){.p = s.p, .len = s.len}; -} - -#define u8strpush(sb, x) \ - _Generic((x), \ - char: u8strpushr, \ - int: u8strpushr, \ - rune: u8strpushr, \ - char *: u8strpushstr, \ - struct u8view: u8strpushu8)((sb), (x)) - -#endif /* !MLIB_BOB_H */ |