summaryrefslogtreecommitdiffhomepage
path: root/include/stc/forward.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-08-14 16:46:24 +0200
committerTyge Løvset <[email protected]>2023-08-14 16:46:24 +0200
commit78d8668e6d527070568a405408ed906e51055bf4 (patch)
tree60f963a36826acce264c7ecd0af3eb80502a4335 /include/stc/forward.h
parent2b6b4785c5c26bc47d800c1a7c7a48784df2d57b (diff)
downloadSTC-modified-78d8668e6d527070568a405408ed906e51055bf4.tar.gz
STC-modified-78d8668e6d527070568a405408ed906e51055bf4.zip
Reverted csubstr => csview. Sorry about that!
Added crawstr to become the null-terminated string view.
Diffstat (limited to 'include/stc/forward.h')
-rw-r--r--include/stc/forward.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/include/stc/forward.h b/include/stc/forward.h
index 5c9c4f4d..839be012 100644
--- a/include/stc/forward.h
+++ b/include/stc/forward.h
@@ -39,21 +39,8 @@
#define forward_cqueue(CX, VAL) _c_cdeq_types(CX, VAL)
#define forward_cvec(CX, VAL) _c_cvec_types(CX, VAL)
-// csubstr : non-null terminated string view
-typedef const char csubstr_value;
-typedef struct csubstr {
- csubstr_value* str;
- intptr_t size;
-} csubstr;
-
-typedef union {
- csubstr_value* ref;
- struct { csubstr chr; csubstr_value* end; } u8;
-} csubstr_iter;
-
-
-// csview : null-terminated string view
-typedef csubstr_value csview_value;
+// csview : non-null terminated string view
+typedef const char csview_value;
typedef struct csview {
csview_value* str;
intptr_t size;
@@ -61,10 +48,23 @@ typedef struct csview {
typedef union {
csview_value* ref;
- struct { csubstr chr; } u8;
+ struct { csview chr; csview_value* end; } u8;
} csview_iter;
+// crawstr : null-terminated string view
+typedef csview_value crawstr_value;
+typedef struct crawstr {
+ crawstr_value* str;
+ intptr_t size;
+} crawstr;
+
+typedef union {
+ crawstr_value* ref;
+ struct { csview chr; } u8;
+} crawstr_iter;
+
+
// cstr : null-terminated string (short string optimized - sso)
typedef char cstr_value;
typedef struct { cstr_value* data; intptr_t size, cap; } cstr_buf;
@@ -75,7 +75,7 @@ typedef union cstr {
typedef union {
cstr_value* ref;
- struct { csubstr chr; } u8;
+ struct { csview chr; } u8;
} cstr_iter;