From 1a2319f3e4cc42c680e2fd3ba30022c7a9adf3fe Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 25 Nov 2016 21:00:39 +0100 Subject: options: remove deprecated sub-option handling for --vo and --ao Long planned. Leads to some sanity. There still are some rather gross things. Especially g_groups is ugly, and a hack that can hopefully be removed. (There is a plan for it, but whether it's implemented depends on how much energy is left.) --- options/m_option.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'options/m_option.h') diff --git a/options/m_option.h b/options/m_option.h index d784d8f54d..8faaad2133 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -117,6 +117,8 @@ struct m_obj_desc { const void *priv_defaults; // Options which refer to members in the private struct const struct m_option *options; + // Prefix for each of the above options (none if NULL). + const char *options_prefix; // For free use by the implementer of m_obj_list.get_desc const void *p; // If not NULL, options which should be set before applying other options. @@ -132,10 +134,6 @@ struct m_obj_desc { const char *replaced_name; // For convenience: these are added as global command-line options. const struct m_sub_options *global_opts; - // Evil hack to essentially force-move .options to global_opts. All options - // will be added as global options with the given prefix, and using - // sub-options will be treated as deprecated and redirected. - const char *legacy_prefix; }; // Extra definition needed for \ref m_option_type_obj_settings_list options. @@ -151,6 +149,8 @@ struct m_obj_list { bool allow_unknown_entries; // This helps with confusing error messages if unknown flag options are used. bool disallow_positional_parameters; + // Each sub-item is backed by global options (for AOs and VOs). + bool use_global_options; }; // Find entry by name @@ -188,6 +188,7 @@ typedef int (*m_opt_string_validate_fn)(struct mp_log *log, const m_option_t *op // m_option.priv points to this if OPT_SUBSTRUCT is used struct m_sub_options { + const char *prefix; const struct m_option *opts; size_t size; const void *defaults; @@ -714,12 +715,6 @@ extern const char m_option_path_separator; .type = &m_option_type_subconfig, \ .priv = (void*)&subconf) -// Same as above, but for legacy suboption usage, which have no associated -// field (no actual data anywhere). -#define OPT_SUBSTRUCT_LEGACY(optname, subconf) \ - {.name = optname, .offset = -1, .type = &m_option_type_subconfig, \ - .priv = (void*)&subconf} - // Provide a another name for the option. #define OPT_ALIAS(optname, newname) \ {.name = optname, .type = &m_option_type_alias, .priv = newname, \ -- cgit v1.2.3