Subversion Repositories Tewi

Rev

Rev 33 | Rev 61 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33 Rev 39
Line 1... Line 1...
1
/* $Id: config.c 33 2024-09-16 12:52:47Z nishi $ */
1
/* $Id: config.c 39 2024-09-17 12:20:48Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "tw_config.h"
5
#include "tw_config.h"
6
#include "tw_module.h"
6
#include "tw_module.h"
Line 293... Line 293...
293
					} else if(cm_strcaseequ(r[0], "Readme")) {
293
					} else if(cm_strcaseequ(r[0], "Readme")) {
294
						for(i = 1; r[i] != NULL; i++) {
294
						for(i = 1; r[i] != NULL; i++) {
295
							current->readmes[current->readme_count++] = cm_strdup(r[i]);
295
							current->readmes[current->readme_count++] = cm_strdup(r[i]);
296
						}
296
						}
297
					} else {
297
					} else {
-
 
298
						stop = 1;
298
						if(r[0] != NULL) {
299
						if(r[0] != NULL) {
-
 
300
							int argc;
-
 
301
							for(argc = 0; r[argc] != NULL; argc++)
-
 
302
								;
-
 
303
							stop = 0;
-
 
304
							int i;
-
 
305
							bool called = false;
-
 
306
							struct tw_tool tools;
-
 
307
							tw_init_tools(&tools);
-
 
308
							for(i = 0; i < config.module_count; i++) {
-
 
309
								tw_mod_config_t mod_config = (tw_mod_config_t)tw_module_symbol(config.modules[i], "mod_config");
-
 
310
								int resp;
-
 
311
								if(mod_config != NULL && (resp = mod_config(&tools, r, argc)) == TW_CONFIG_PARSED) {
-
 
312
									called = true;
-
 
313
									break;
-
 
314
								}
-
 
315
								if(resp == TW_CONFIG_ERROR) {
-
 
316
									stop = 1;
-
 
317
									called = true;
-
 
318
									break;
-
 
319
								}
-
 
320
							}
-
 
321
							if(!called) {
299
							cm_log("Config", "Unknown directive `%s' at line %d", r[0], ln);
322
								cm_log("Config", "Unknown directive `%s' at line %d", r[0], ln);
-
 
323
								stop = 1;
-
 
324
							}
300
						}
325
						}
301
						stop = 1;
-
 
302
					}
326
					}
303
					for(i = 0; r[i] != NULL; i++) free(r[i]);
327
					for(i = 0; r[i] != NULL; i++) free(r[i]);
304
					free(r);
328
					free(r);
305
				}
329
				}
306
				free(l);
330
				free(l);