summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-05-13 16:16:45 +0200
committerLouis Burda <quent.burda@gmail.com>2023-05-13 16:16:45 +0200
commit110b99563e127abe1439fffb0084400b47eea5b3 (patch)
treeded22ce24e5d0545b287817661267de34e9810fd /src
downloadlibstrvec-c-110b99563e127abe1439fffb0084400b47eea5b3.tar.gz
libstrvec-c-110b99563e127abe1439fffb0084400b47eea5b3.zip
Prelim push
Diffstat (limited to 'src')
-rw-r--r--src/strvec.c36
1 files changed, 36 insertions, 0 deletions
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);
+}
+
+