From 110b99563e127abe1439fffb0084400b47eea5b3 Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Sat, 13 May 2023 16:16:45 +0200 Subject: Prelim push --- src/strvec.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/strvec.c (limited to 'src') diff --git a/src/strvec.c b/src/strvec.c new file mode 100644 index 0000000..343d8ba --- /dev/null +++ b/src/strvec.c @@ -0,0 +1,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); +} + + -- cgit v1.2.3-71-gd317