diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-08-11 23:41:36 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2012-08-11 23:41:36 +0200 |
commit | 3d2165a4ba8fa1c7d25668acfa3261acd316b86a (patch) | |
tree | 7b0d2dc054187a62fdf1d75db4f831b00fc5970c /src/conf.h | |
parent | e20283217b32b6d9ea485857f900322334e973d7 (diff) |
conf: add string-list type
The string-list type parses an argument as a list of strings separated
with commas. Empty arguments are accepted and correctly parsed.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/conf.h')
-rw-r--r-- | src/conf.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -84,15 +84,26 @@ struct conf_option { _aftercheck, \ _mem, \ _def) +#define CONF_OPTION_STRING_LIST(_short, _long, _aftercheck, _mem, _def) \ + CONF_OPTION(0, \ + _short, \ + _long, \ + &conf_string_list, \ + _aftercheck, \ + _mem, \ + _def) void conf_free_value(struct conf_option *opt); int conf_parse_bool(struct conf_option *opt, bool on, const char *arg); void conf_default_bool(struct conf_option *opt); int conf_parse_string(struct conf_option *opt, bool on, const char *arg); void conf_default_string(struct conf_option *opt); +int conf_parse_string_list(struct conf_option *opt, bool on, const char *arg); +void conf_default_string_list(struct conf_option *opt); extern const struct conf_type conf_bool; extern const struct conf_type conf_string; +extern const struct conf_type conf_string_list; void conf_free(struct conf_option *opts, size_t len); int conf_parse_argv(struct conf_option *opts, size_t len, |