summaryrefslogtreecommitdiffstats
path: root/src/strvec.c
blob: 343d8ba11e9d2fc7d9d6ef32b0c98ba48a44e629 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "strvec.h"
#include "dvec.h"
#include "allocator.h"

struct strvec {
	struct dvec vec;
	const struct allocator *alloc;
};

void
strvec_init(struct strvec *strvec, size_t cap, struct allocator *allocator)
{
	strvec->alloc = allocator;
	dvec_init(&strvec->vec, sizeof(char *), cap, allocator);
}

void
strvec_deinit(struct strvec *strvec)
{
	dvec_deinit(&strvec->vec);
}

struct strvec *
strvec_alloc(size_t reserved, struct allocator *allocator)
{

}

int
strvec_free(struct strvec *strvec)
{
	dvec_deinit(&strvec->vec);
	strvec->alloc->free(strvec);
}