summaryrefslogtreecommitdiffstats
path: root/m_option.h
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2010-11-04 05:41:47 +0100
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-04 06:44:12 +0200
commita3124a4f5d9d2fa6d8fd4ae33786c4706b459f41 (patch)
tree4d4b289fafe9065dc939d9624ed1f3935eb9df0a /m_option.h
parent952f9b85a7f4d3140dde530585456cd0b42d258a (diff)
downloadmpv-a3124a4f5d9d2fa6d8fd4ae33786c4706b459f41.tar.bz2
mpv-a3124a4f5d9d2fa6d8fd4ae33786c4706b459f41.tar.xz
options: add OPT_MAKE_FLAGS macro, creates "opt/noopt" flag pair
Diffstat (limited to 'm_option.h')
-rw-r--r--m_option.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/m_option.h b/m_option.h
index c2c992ec80..26c457e24d 100644
--- a/m_option.h
+++ b/m_option.h
@@ -533,6 +533,7 @@ int parse_timestring(const char *str, double *time, char endchar);
#define OPT_FLAG_ON(optname, varname, flags) {optname, NULL, &m_option_type_flag, flags, 0, 1, NULL, 1, offsetof(struct MPOpts, varname)}
#define OPT_FLAG_OFF(optname, varname, flags) {optname, NULL, &m_option_type_flag, flags, 1, 0, NULL, 1, offsetof(struct MPOpts, varname)}
+#define OPT_MAKE_FLAGS(optname, varname, flags) OPT_FLAG_ON(optname, varname, flags), OPT_FLAG_OFF("no" optname, varname, flags)
#define OPT_FLAG_CONSTANTS(optname, varname, flags, offvalue, value) {optname, NULL, &m_option_type_flag, flags, offvalue, value, NULL, 1, offsetof(struct MPOpts, varname)}
#define OPT_STRINGLIST(optname, varname, flags) {optname, NULL, &m_option_type_string_list, flags, 0, 0, NULL, 1, offsetof(struct MPOpts, varname)}
#define OPT_INT(optname, varname, flags) {optname, NULL, &m_option_type_int, flags, 0, 0, NULL, 1, offsetof(struct MPOpts, varname)}