liboptcfg
diff src/optcfg.h @ 2:9c73004c7af3
works
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 20 Nov 2015 17:05:39 +0200 |
parents | 10b89befcaa9 |
children | f971dfa66076 |
line diff
1.1 --- a/src/optcfg.h Sat Nov 14 14:12:30 2015 +0200 1.2 +++ b/src/optcfg.h Fri Nov 20 17:05:39 2015 +0200 1.3 @@ -50,6 +50,15 @@ 1.4 int optcfg_parse_config_line(struct optcfg *oc, const char *line); 1.5 /* TODO custom I/O callback version of config file parsing */ 1.6 1.7 +/* special value function which returns if the option is enabled or disabled 1.8 + * For config files it works similar to calling optcfg_next_value, and 1.9 + * optcfg_bool_value in sequence. 1.10 + * For argument parsing however, it doesn't consume further arguments. Merely 1.11 + * the presence of the option makes it enabled, and its presence with a -no- 1.12 + * prefix disables it. (TODO the second part of this) 1.13 + */ 1.14 +int optcfg_enabled_value(struct optcfg *oc, int *enabledp); 1.15 + 1.16 /* call optcfg_next_value in the option callback to retrieve the next value 1.17 * of the current option. returns 0 if there is no next value. 1.18 */