From f447179c598fcd13cd239a56044b483c660f6093 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 4 Mar 2015 17:20:47 +0100 Subject: options: add flag option type --- options/m_option.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'options/m_option.h') diff --git a/options/m_option.h b/options/m_option.h index c26d1b3529..401d98473d 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -52,6 +52,7 @@ extern const m_option_type_t m_option_type_keyvalue_list; extern const m_option_type_t m_option_type_time; extern const m_option_type_t m_option_type_rel_time; extern const m_option_type_t m_option_type_choice; +extern const m_option_type_t m_option_type_flags; extern const m_option_type_t m_option_type_msglevels; extern const m_option_type_t m_option_type_print_fn; extern const m_option_type_t m_option_type_subconfig; @@ -626,6 +627,9 @@ extern const char m_option_path_separator; #define OPT_CHOICE_(optname, varname, flags, choices, ...) \ OPT_GENERAL(int, optname, varname, flags, M_CHOICES(choices), __VA_ARGS__) +#define OPT_FLAGS(...) \ + OPT_CHOICE_(__VA_ARGS__, .type = &m_option_type_flags) + // Union of choices and an int range. The choice values can be included in the // int range, or be completely separate - both works. #define OPT_CHOICE_OR_INT_(optname, varname, flags, minval, maxval, choices, ...) \ -- cgit v1.2.3