diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-02 18:47:39 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-02 18:47:39 -0400 |
| commit | 61e482f6f36aee6f72392a6188f2ec5c858b88fd (patch) | |
| tree | bea4123fcc62dd834405ae89ce9fe260e90a0023 /builtins/datatypes.h | |
| parent | f0f8f218703ebb4512b3cd3f9e06b86a7d9861b0 (diff) | |
Initial WIP first past
Diffstat (limited to 'builtins/datatypes.h')
| -rw-r--r-- | builtins/datatypes.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/builtins/datatypes.h b/builtins/datatypes.h index 699c40e0..433e1dd9 100644 --- a/builtins/datatypes.h +++ b/builtins/datatypes.h @@ -71,4 +71,19 @@ typedef struct { int64_t max_size; } channel_t; +enum text_type { TEXT_SHORT_ASCII, TEXT_ASCII, TEXT_SHORT_GRAPHEMES, TEXT_GRAPHEMES, TEXT_SUBTEXT }; + +typedef struct Text_s { + int64_t length; // Number of grapheme clusters + uint64_t hash:61; + uint8_t tag:3; + union { + char short_ascii[8]; + const char *ascii; + int32_t short_graphemes[2]; + int32_t *graphemes; + struct Text_s *subtexts; + }; +} Text_t; + // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 |
