aboutsummaryrefslogtreecommitdiff
path: root/advent-of-code/2023/lib/str.h
diff options
context:
space:
mode:
Diffstat (limited to 'advent-of-code/2023/lib/str.h')
-rw-r--r--advent-of-code/2023/lib/str.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/advent-of-code/2023/lib/str.h b/advent-of-code/2023/lib/str.h
new file mode 100644
index 0000000..214e297
--- /dev/null
+++ b/advent-of-code/2023/lib/str.h
@@ -0,0 +1,24 @@
+// Copyright (C) 2023 Mistivia <i@mistivia.com>
+// Licensed under GPLv3. See LICENSE for details.
+
+#ifndef DYMC_STR_H_
+#define DYMC_STR_H_
+
+#include <stdio.h>
+#include <stddef.h>
+
+char *str_strip(const char *str);
+void* str_split(const char *str, char delim);
+
+
+// string stream
+void* new_ss();
+void ss_add(void *self, char *format, ...);
+void ss_addc(void *self, char c);
+char *ss_cstr(void *self);
+size_t ss_size(void* self);
+
+char *fgetline(FILE *fp);
+int fpeek(FILE *fp);
+
+#endif