aboutsummaryrefslogtreecommitdiff
path: root/builtins/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'builtins/string.h')
-rw-r--r--builtins/string.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/builtins/string.h b/builtins/string.h
new file mode 100644
index 00000000..1d6a91a4
--- /dev/null
+++ b/builtins/string.h
@@ -0,0 +1,23 @@
+#pragma once
+#include <gc/cord.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+typedef struct {
+ char *data;
+ int64_t length:42;
+ uint8_t free:4, cow:1, atomic:1;
+ int16_t stride:16;
+} Str_t;
+
+#define STRING(s) ((Str_t){.data=s, .length=(int32_t)(sizeof(s)), .stride=1, .free=0})
+
+typedef struct {
+ Str_t *data;
+ unsigned long int length:42;
+ unsigned short int free:4, cow:1, atomic:1;
+ short int stride:16;
+} Str_Array_t;
+
+
+// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0