summaryrefslogtreecommitdiff
path: root/src/sv.h
blob: c4c87507af153f83485a81339f75a83d6a473d48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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