From 421300c27123ca647772dc6d9bd0cabf7f5f9c99 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Wed, 23 Jul 2025 19:39:13 +0200 Subject: refactor: src & pragma once --- include/str.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 include/str.h (limited to 'include/str.h') diff --git a/include/str.h b/include/str.h new file mode 100644 index 0000000..300d5ea --- /dev/null +++ b/include/str.h @@ -0,0 +1,18 @@ +#pragma once +#include +#include +#include + +#include "../include/memory.h" +#include "../include/types.h" + +#define S(s) \ + (Str) { s, lengthof(s) } +typedef struct { + byte *data; + size len; +} Str; +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); -- cgit v1.3