process a line of the INI file, storing valid values into config struct */
| 18 | |
| 19 | /* process a line of the INI file, storing valid values into config struct */ |
| 20 | int handler(void *user, const char *section, const char *name, const char *value) { |
| 21 | config *cfg = (config *) user; |
| 22 | |
| 23 | if (0) |
| 24 | ; |
| 25 | #define CFG(s, n, default) else if (strcmp(section, #s)==0 && \ |
| 26 | strcmp(name, #n)==0) cfg->s##_##n = strdup(value); |
| 27 | #include "config.def" |
| 28 | |
| 29 | return 1; |
| 30 | } |
| 31 | |
| 32 | /* print all the variables in the config, one per line */ |
| 33 | void dump_config(config *cfg) { |
nothing calls this directly
no outgoing calls
no test coverage detected