diff options
Diffstat (limited to 'src/sv.h')
| -rw-r--r-- | src/sv.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/sv.h b/src/sv.h new file mode 100644 index 0000000..c4c8750 --- /dev/null +++ b/src/sv.h @@ -0,0 +1,22 @@ +#ifndef STRING_H +#define STRING_H + +#include <stdint.h> +#include <stddef.h> + +#define SV(sp, s) sv_create(sp, s, sizeof(s)) + +struct string_pool { + uintptr_t mem; + size_t offset; +}; + +struct string_view { + size_t len; + char *buf; +}; + +void sp_init(struct string_pool *sp); +struct string_view sv_create(struct string_pool *sp, const char *buf, size_t s); + +#endif |
