diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2025-08-22 21:15:31 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2025-08-27 11:43:09 +0200 |
| commit | 07dbb6538ca55e69a33ada6761e749f4ee06affe (patch) | |
| tree | be8eaf0a1b3a20aba89a85fe6b614227655e6a39 /include/str.h | |
| parent | 911f1fe752173fdfee3f135acd2509c908c7fce2 (diff) | |
json: Improved parsing performance
Diffstat (limited to 'include/str.h')
| -rw-r--r-- | include/str.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/str.h b/include/str.h index 300d5ea..3ccd072 100644 --- a/include/str.h +++ b/include/str.h @@ -12,7 +12,14 @@ typedef struct { byte *data; size len; } Str; +typedef struct { + byte *data; + size len; +} StrView; i32 Str_equals(Str a, Str b); u64 Str_hash64(Str s); Str Str_copy(Arena *a, byte *data, size len); i32 Str_fprint(FILE *w, Str s); + +StrView Str_view(byte *data, size len); +i32 StrView_fprint(FILE *w, StrView s); |
