summaryrefslogtreecommitdiffstats
path: root/m_option.h
diff options
context:
space:
mode:
Diffstat (limited to 'm_option.h')
-rw-r--r--m_option.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/m_option.h b/m_option.h
index 26c457e24d..ed2b30de75 100644
--- a/m_option.h
+++ b/m_option.h
@@ -53,6 +53,7 @@ extern const m_option_type_t m_option_type_string_list;
extern const m_option_type_t m_option_type_position;
extern const m_option_type_t m_option_type_time;
extern const m_option_type_t m_option_type_time_size;
+extern const m_option_type_t m_option_type_choice;
extern const m_option_type_t m_option_type_print;
extern const m_option_type_t m_option_type_print_indirect;
@@ -169,6 +170,11 @@ typedef struct {
/// Ready made settings to parse a \ref m_span_t with a start-end syntax.
extern const m_obj_params_t m_span_params_def;
+struct m_opt_choice_alternatives {
+ char *name;
+ int value;
+};
+
// FIXME: backward compatibility
#define CONF_TYPE_FLAG (&m_option_type_flag)
@@ -543,5 +549,7 @@ int parse_timestring(const char *str, double *time, char endchar);
#define OPT_STRING(optname, varname, flags) {optname, NULL, &m_option_type_string, flags, 0, 0, NULL, 1, offsetof(struct MPOpts, varname)}
#define OPT_SETTINGSLIST(optname, varname, flags, objlist) {optname, NULL, &m_option_type_obj_settings_list, flags, 0, 0, objlist, 1, offsetof(struct MPOpts, varname)}
#define OPT_AUDIOFORMAT(optname, varname, flags) {optname, NULL, &m_option_type_afmt, flags, 0, 0, NULL, 1, offsetof(struct MPOpts, varname)}
+#define OPT_HELPER_REMOVEPAREN(...) __VA_ARGS__
+#define OPT_CHOICE(optname, varname, flags, choices) {optname, NULL, &m_option_type_choice, flags, 0, 0, &(const struct m_opt_choice_alternatives[]){OPT_HELPER_REMOVEPAREN choices, {NULL}}, 1, offsetof(struct MPOpts, varname)}
#endif /* MPLAYER_M_OPTION_H */