diff options
author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2024-06-17 00:49:20 +0200 |
---|---|---|
committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2024-06-17 00:51:45 +0200 |
commit | 51598ba379d31998705f4f991d1606053500f942 (patch) | |
tree | e208038ebd2c56880920141a24a29f71dc6c005b /include/str.h | |
parent | a3fbea78730b1359146193e0d128668426085cd8 (diff) |
implement serialization
Signed-off-by: Lizzy Fleckenstein <lizzy@vlhl.dev>
Diffstat (limited to 'include/str.h')
-rw-r--r-- | include/str.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/str.h b/include/str.h index f4054a1..b208515 100644 --- a/include/str.h +++ b/include/str.h @@ -19,6 +19,9 @@ typedef array(char) str; #define S(X) ((str) { len(X)-1, X }) #define NILS ((str) { 0, NULL }) +typedef struct { size_t cap; str buf; } strbuf; +#define NILSBUF ((strbuf) { 0, NILS }) + // compares two strings by length and ASCII values. return value: // < 0 if s1 < s2 // = 0 if s1 = s2 |