aboutsummaryrefslogtreecommitdiff
path: root/builtins/string.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-02-04 21:13:50 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-02-04 21:13:50 -0500
commitadde91636f04ae7544dba1ca5c6c1a40c074edb9 (patch)
treedfeb8c0c16fda6a87ef30b048b070ee4cb175a78 /builtins/string.h
parentb08a0d3e2bf45bae11c982dd24d0292d6436b993 (diff)
Builtins
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