diff options
-rw-r--r-- | main-sdl.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -207,6 +207,29 @@ worker(void *args) | |||
207 | } | 207 | } |
208 | } | 208 | } |
209 | 209 | ||
210 | static void | ||
211 | config_parse(char *config_file) | ||
212 | { | ||
213 | FILE *fh = fopen(config_file, "r"); | ||
214 | char line_in[512]; | ||
215 | |||
216 | if (!fh) { | ||
217 | fprintf(stderr, "Couldn't open config file %s, exiting.\n", config_file); | ||
218 | exit(1); | ||
219 | } | ||
220 | config_reset(); | ||
221 | while (!feof(fh)) { | ||
222 | char *line = fgets(line_in, sizeof(line_in), fh); | ||
223 | |||
224 | if (!line) | ||
225 | continue; | ||
226 | if (config_handle_line(line)) | ||
227 | exit(1); | ||
228 | } | ||
229 | |||
230 | fclose(fh); | ||
231 | } | ||
232 | |||
210 | int | 233 | int |
211 | main(int argc, char **argv) | 234 | main(int argc, char **argv) |
212 | { | 235 | { |