aboutsummaryrefslogtreecommitdiff
path: root/src/text.h
diff options
context:
space:
mode:
authorUneven Prankster <unevenprankster@protonmail.com>2023-09-23 19:28:45 -0300
committerUneven Prankster <unevenprankster@protonmail.com>2023-09-23 19:28:45 -0300
commita89f892640cf12f75c7ce18e6e88c70a8d3965ed (patch)
treee917bda607b86cb7c5bd80df2e5abf549d972163 /src/text.h
parent83505b7be49dbf7789deb814bd159d9c37181d05 (diff)
things can always be nicer :D
Diffstat (limited to 'src/text.h')
-rw-r--r--src/text.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/text.h b/src/text.h
new file mode 100644
index 0000000..9ac01d3
--- /dev/null
+++ b/src/text.h
@@ -0,0 +1,23 @@
+#pragma once
+
+#include "config.h"
+
+#define String(s) (s8){(u8*)s, lengthof(s)}
+typedef struct {
+ u8 *buf;
+ size len;
+} s8;
+
+size txt_length(const char *text);
+
+s8 create_s8(const size sz);
+
+void free_s8(s8* str);
+
+s8 cstr_to_s8(const char* str);
+
+b32 equal_s8(const s8 one, const s8 other);
+
+void add_s8(s8 dst, const s8 src, size* pos);
+
+s8 load_file_text(const s8 path); \ No newline at end of file