diff options
| author | Filip Wandzio <contact@philw.dev> | 2026-03-01 11:29:12 +0100 |
|---|---|---|
| committer | Filip Wandzio <contact@philw.dev> | 2026-03-01 11:29:12 +0100 |
| commit | a2afca302c68b8b5d7c3bec13378180b60a3ac17 (patch) | |
| tree | 0c7424a1847ff91f61ab439b5e497e5a093639b2 /include | |
| download | ysnp-a2afca302c68b8b5d7c3bec13378180b60a3ac17.tar.gz ysnp-a2afca302c68b8b5d7c3bec13378180b60a3ac17.zip | |
Scaffold project
Signed-off-by: Filip Wandzio <contact@philw.dev>
Diffstat (limited to '')
| -rw-r--r-- | include/questions.h | 20 | ||||
| -rw-r--r-- | include/utils.h | 8 |
2 files changed, 28 insertions, 0 deletions
diff --git a/include/questions.h b/include/questions.h new file mode 100644 index 0000000..75bc751 --- /dev/null +++ b/include/questions.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | #pragma once | ||
| 2 | #include <stddef.h> | ||
| 3 | |||
| 4 | typedef struct { | ||
| 5 | char **general; | ||
| 6 | char **major; | ||
| 7 | size_t general_count; | ||
| 8 | size_t major_count; | ||
| 9 | } QuestionSet; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * Load questions from file. | ||
| 13 | * Returns EXIT_SUCCESS or EXIT_FAILURE. | ||
| 14 | */ | ||
| 15 | int load_questions(const char *filename, QuestionSet *qs); | ||
| 16 | |||
| 17 | /** | ||
| 18 | * Free all allocated memory in QuestionSet. | ||
| 19 | */ | ||
| 20 | void free_questions(QuestionSet *qs); | ||
diff --git a/include/utils.h b/include/utils.h new file mode 100644 index 0000000..74c0ca1 --- /dev/null +++ b/include/utils.h | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | #pragma once | ||
| 2 | #include <stddef.h> | ||
| 3 | |||
| 4 | void print_line(void); | ||
| 5 | void wait_enter(const char *msg); | ||
| 6 | char ask_yes_no(const char *msg); | ||
| 7 | void now_str(char *buf, size_t size); | ||
| 8 | size_t rand_index(size_t max); | ||
