summaryrefslogtreecommitdiff
path: root/src/string_vec.h
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2021-11-06 18:44:27 +0000
committerPhil Jones <philj56@gmail.com>2021-11-06 19:02:29 +0000
commitae23e86114f559ce6d01a3e2499fc5417dc90d37 (patch)
treec55d7f3c3b131efd50ec2a6f884b48f9ce250c63 /src/string_vec.h
parentc28c5249c4d3ba7076e2c6ea598e3ad93a168301 (diff)
Start conversion to tofi.
Diffstat (limited to 'src/string_vec.h')
-rw-r--r--src/string_vec.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/string_vec.h b/src/string_vec.h
new file mode 100644
index 0000000..0054c09
--- /dev/null
+++ b/src/string_vec.h
@@ -0,0 +1,28 @@
+#ifndef STRING_VEC_H
+#define STRING_VEC_H
+
+#include <stddef.h>
+
+struct string_vec {
+ size_t count;
+ size_t size;
+ char **buf;
+};
+
+[[nodiscard]]
+struct string_vec string_vec_create();
+
+void string_vec_destroy(struct string_vec *restrict vec);
+
+void string_vec_add(struct string_vec *restrict vec, const char *restrict str);
+
+void string_vec_sort(struct string_vec *restrict vec);
+
+void string_vec_uniq(struct string_vec *restrict vec);
+
+[[nodiscard]] [[gnu::nonnull]]
+struct string_vec string_vec_filter(
+ struct string_vec *restrict vec,
+ const char *restrict substr);
+
+#endif /* STRING_VEC_H */