aboutsummaryrefslogtreecommitdiff
path: root/vendor/librune/include/builder.h
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-23 16:06:31 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-23 16:06:31 +0100
commit0a9060e335d59f0ccaf5d9600abbcb938db30928 (patch)
tree874deccfe6c9b5a0d225cd892b06229378761b2f /vendor/librune/include/builder.h
parent851ca8da9d72fbc438420eab4a7de4d84fb5bc5d (diff)
Bump librune version
Diffstat (limited to 'vendor/librune/include/builder.h')
-rw-r--r--vendor/librune/include/builder.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor/librune/include/builder.h b/vendor/librune/include/builder.h
new file mode 100644
index 0000000..b711f97
--- /dev/null
+++ b/vendor/librune/include/builder.h
@@ -0,0 +1,31 @@
+#ifndef RUNE_BUILDER_H
+#define RUNE_BUILDER_H
+
+#define _RUNE_NEEDS_U8VIEW 1
+#include "internal/types.h" /* IWYU pragma: export */
+
+struct u8buf {
+ char8_t *p;
+ size_t len, cap;
+};
+
+struct u8buf *u8strinit(struct u8buf *, size_t);
+struct u8buf *u8strgrow(struct u8buf *, size_t);
+struct u8buf *u8strfit(struct u8buf *);
+void u8strfree(struct u8buf);
+
+struct u8buf *u8strpushr(struct u8buf *, rune);
+struct u8buf *u8strpushstr(struct u8buf *, const char *);
+struct u8buf *u8strpushu8(struct u8buf *, struct u8view);
+
+#if __STDC_VERSION__ >= 201112L
+# define u8strpush(b, x) \
+ _Generic((x), \
+ char: u8strpushr, \
+ int: u8strpushr, \
+ rune: u8strpushr, \
+ char *: u8strpushstr, \
+ struct u8view: u8strpushu8)((b), (x))
+#endif
+
+#endif /* !RUNE_BUILDER_H */