diff options
author | Vincent Douillet <vincent@vdouillet.fr> | 2021-12-03 17:01:37 +0100 |
---|---|---|
committer | Vincent Douillet <vincent@vdouillet.fr> | 2021-12-03 17:01:37 +0100 |
commit | 736823f313bd2e00e49a1b52aaf0ea68a79db438 (patch) | |
tree | 5cf54f57e5c2afd8ea22baacb3ffa05a76a59fcc /input.h | |
parent | 04e79fa276ae1c3620868d85941b2c7b7c11222a (diff) |
improve input handling & merge part 1 and 2 for the first days
Diffstat (limited to 'input.h')
-rw-r--r-- | input.h | 23 |
1 files changed, 19 insertions, 4 deletions
@@ -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 |