From adde91636f04ae7544dba1ca5c6c1a40c074edb9 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 4 Feb 2024 21:13:50 -0500 Subject: Builtins --- builtins/string.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 builtins/string.h (limited to 'builtins/string.h') 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 +#include +#include + +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 -- cgit v1.2.3