aboutsummaryrefslogtreecommitdiff
path: root/String.h
diff options
context:
space:
mode:
Diffstat (limited to 'String.h')
-rw-r--r--String.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/String.h b/String.h
new file mode 100644
index 0000000..3955339
--- /dev/null
+++ b/String.h
@@ -0,0 +1,25 @@
+#ifndef _STRING
+#define _STRING
+
+#include "BumpAlloc.h"
+
+typedef char* String;
+
+String String_new(BumpArena b, const char* str);
+String String_newlen(BumpArena b, usize length);
+String String_dup(BumpArena b, String s);
+String String_concat(BumpArena b, ...);
+String String_printf(BumpArena b, const char* fmt, ...);
+
+usize String_length(String s);
+Result String_append(String s, const char* str);
+Result String_prepend(String s, const char* str);
+usize String_find(String s, char c);
+
+String String_Gnew(const char* str);
+String String_Gnewlen(usize length);
+String String_Gdup(String s);
+String String_Gconcat(const char* str, ...);
+String String_Gprintf(const char* fmt, ...);
+
+#endif /* _STRING */