summaryrefslogtreecommitdiff
path: root/src/sv.h
diff options
context:
space:
mode:
author0x221E <0x221E@0xinfinity.dev>2026-04-12 16:24:06 +0200
committer0x221E <0x221E@0xinfinity.dev>2026-04-12 16:24:06 +0200
commit4946ca67cf04845737f0f7f70b5ed27bcfe9a18b (patch)
treee0ce4c11f5b81828da7680143ea444003dd355b3 /src/sv.h
Initial commitHEADmaster
Diffstat (limited to 'src/sv.h')
-rw-r--r--src/sv.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/sv.h b/src/sv.h
new file mode 100644
index 0000000..c4c8750
--- /dev/null
+++ b/src/sv.h
@@ -0,0 +1,22 @@
+#ifndef STRING_H
+#define STRING_H
+
+#include <stdint.h>
+#include <stddef.h>
+
+#define SV(sp, s) sv_create(sp, s, sizeof(s))
+
+struct string_pool {
+ uintptr_t mem;
+ size_t offset;
+};
+
+struct string_view {
+ size_t len;
+ char *buf;
+};
+
+void sp_init(struct string_pool *sp);
+struct string_view sv_create(struct string_pool *sp, const char *buf, size_t s);
+
+#endif