summaryrefslogtreecommitdiff
path: root/input.h
diff options
context:
space:
mode:
authorVincent Douillet <vincent@vdouillet.fr>2021-12-03 17:01:37 +0100
committerVincent Douillet <vincent@vdouillet.fr>2021-12-03 17:01:37 +0100
commit736823f313bd2e00e49a1b52aaf0ea68a79db438 (patch)
tree5cf54f57e5c2afd8ea22baacb3ffa05a76a59fcc /input.h
parent04e79fa276ae1c3620868d85941b2c7b7c11222a (diff)
improve input handling & merge part 1 and 2 for the first days
Diffstat (limited to 'input.h')
-rw-r--r--input.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/input.h b/input.h
index 9e6762e..6507053 100644
--- a/input.h
+++ b/input.h
@@ -1,7 +1,22 @@
-size_t count_lines(FILE* file);
+#ifndef DEF_INPUTH
+#define DEF_INPUTH
-int read_lines_as_int(FILE* file, int* result, int resultSize);
+struct input_int {
+ size_t line_count;
+ int* lines;
+};
-int read_lines_as_string(FILE* file, char** result, int resultSize);
+struct input_str {
+ size_t line_count;
+ char** lines;
+};
-void free_strings(char** strings, size_t stringCount);
+void input_int_read(struct input_int* result, char* filename);
+
+void input_str_read(struct input_str* result, char* filename);
+
+void input_int_free(struct input_int* input);
+
+void input_str_free(struct input_str* input);
+
+#endif