summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-01-24 11:14:13 +0000
committeralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-01-24 11:14:13 +0000
commiteed2e8e82082f78b6b38af1531c91bff91d0246c (patch)
tree122cae8a9bfee5b0dd85cc8d5dc66c5c182c7d1a
parent4e638017516cad06f812ab6dcaf3a16e2081892b (diff)
downloadmpv-eed2e8e82082f78b6b38af1531c91bff91d0246c.tar.bz2
mpv-eed2e8e82082f78b6b38af1531c91bff91d0246c.tar.xz
New option type to print help text with a function.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17471 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--m_option.c15
-rw-r--r--m_option.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/m_option.c b/m_option.c
index 5222b26841..850d117594 100644
--- a/m_option.c
+++ b/m_option.c
@@ -824,6 +824,8 @@ m_option_type_t m_option_type_func = {
static int parse_print(m_option_t* opt,char *name, char *param, void* dst, int src) {
if(opt->type == CONF_TYPE_PRINT_INDIRECT)
mp_msg(MSGT_CFGPARSER, MSGL_INFO, "%s", *(char **) opt->p);
+ else if(opt->type == CONF_TYPE_PRINT_FUNC)
+ return ((m_opt_func_full_t) opt->p)(opt,name,param);
else
mp_msg(MSGT_CFGPARSER, MSGL_INFO, "%s", (char *) opt->p);
@@ -858,6 +860,19 @@ m_option_type_t m_option_type_print_indirect = {
NULL
};
+m_option_type_t m_option_type_print_func = {
+ "Print",
+ "",
+ 0,
+ M_OPT_TYPE_ALLOW_WILDCARD,
+ parse_print,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
/////////////////////// Subconfig
#undef VAL
diff --git a/m_option.h b/m_option.h
index 071e15d6f4..55a26765bd 100644
--- a/m_option.h
+++ b/m_option.h
@@ -18,6 +18,7 @@ extern m_option_type_t m_option_type_position;
extern m_option_type_t m_option_type_print;
extern m_option_type_t m_option_type_print_indirect;
+extern m_option_type_t m_option_type_print_func;
extern m_option_type_t m_option_type_subconfig;
extern m_option_type_t m_option_type_imgfmt;
extern m_option_type_t m_option_type_afmt;
@@ -86,6 +87,7 @@ extern m_obj_params_t m_span_params_def;
#define CONF_TYPE_FUNC_PARAM (&m_option_type_func_param)
#define CONF_TYPE_PRINT (&m_option_type_print)
#define CONF_TYPE_PRINT_INDIRECT (&m_option_type_print_indirect)
+#define CONF_TYPE_PRINT_FUNC (&m_option_type_print_func)
#define CONF_TYPE_FUNC_FULL (&m_option_type_func_full)
#define CONF_TYPE_SUBCONFIG (&m_option_type_subconfig)
#define CONF_TYPE_STRING_LIST (&m_option_type_string_list)