diff options
author | wm4 <wm4@nowhere> | 2014-12-11 01:04:15 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-12-11 01:04:15 +0100 |
commit | d054289f668499d6acea307f14c62d44d35b6840 (patch) | |
tree | d01cd9f4195e0339cd6ee3aedd164d51c4742ebb /options/m_option.h | |
parent | eb36bd6945bad1ddc80663f7b8d3fe95db3ca284 (diff) | |
download | mpv-d054289f668499d6acea307f14c62d44d35b6840.tar.bz2 mpv-d054289f668499d6acea307f14c62d44d35b6840.tar.xz |
options: add slightly more sophistcated mechanism for option deprecation
Diffstat (limited to 'options/m_option.h')
-rw-r--r-- | options/m_option.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/options/m_option.h b/options/m_option.h index 41b1d9ec56..c05e2d760c 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -65,6 +65,10 @@ extern const m_option_type_t m_option_type_size_box; extern const m_option_type_t m_option_type_chmap; extern const m_option_type_t m_option_type_node; +// Used internally by m_config.c +extern const m_option_type_t m_option_type_alias; +extern const m_option_type_t m_option_type_removed; + // Callback used by m_option_type_print_fn options. typedef void (*m_opt_print_fn)(struct mp_log *log); @@ -679,4 +683,13 @@ extern const char m_option_path_separator; .type = &m_option_type_subconfig, \ .priv = (void*)&subconf) +// If "--name" was removed, but "--newname" has the same semantics. +// It will be redirected, and a warning will be printed on first use. +#define OPT_REPLACED(optname, newname) \ + {.name = optname, .type = &m_option_type_alias, .priv = newname, .offset = -1} + +// "--name" doesn't exist, but inform the user about a replacement with msg. +#define OPT_REMOVED(optname, msg) \ + {.name = optname, .type = &m_option_type_removed, .priv = msg, .offset = -1} + #endif /* MPLAYER_M_OPTION_H */ |