diff m_option.c @ 17470:21123e349463

New option type to print help text with a function.
author albeu
date Tue, 24 Jan 2006 11:14:13 +0000
parents 41d8991c3632
children 8f036d112bb6
line wrap: on
line diff
--- a/m_option.c	Mon Jan 23 13:53:40 2006 +0000
+++ b/m_option.c	Tue Jan 24 11:14:13 2006 +0000
@@ -824,6 +824,8 @@
 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 @@
   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