diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-05-18 14:38:41 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-05-18 14:38:41 -0400 |
| commit | a1d18fd4225f67275ea4173532969e4ddf55b39f (patch) | |
| tree | 6473f7cee0e829783bd64cc3d52af53f5089340f /builtins/c_string.h | |
| parent | ee9a40f9102f12357e7a46c3b48a486c62c2311e (diff) | |
Add C string type
Diffstat (limited to 'builtins/c_string.h')
| -rw-r--r-- | builtins/c_string.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/builtins/c_string.h b/builtins/c_string.h new file mode 100644 index 00000000..6b4b0aad --- /dev/null +++ b/builtins/c_string.h @@ -0,0 +1,18 @@ +#pragma once + +// Type info and methods for CString datatype, which represents C's `char*` + +#include <gc/cord.h> +#include <stdbool.h> +#include <stdint.h> + +#include "types.h" + +CORD CString$as_text(const void *str, bool colorize, const TypeInfo *info); +int CString$compare(const char **x, const char **y); +bool CString$equal(const char **x, const char **y); +uint32_t CString$hash(const char **str); + +extern const TypeInfo $CString; + +// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 |
