aboutsummaryrefslogtreecommitdiff
path: root/include/str.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/str.h')
-rw-r--r--include/str.h7
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);