[MPlayer-cvslog] CVS: main m_option.c, 1.44, 1.45 m_option.h, 1.13, 1.14

Alban Bedel CVS syncmail at mplayerhq.hu
Tue Jan 24 12:14:15 CET 2006


CVS change done by Alban Bedel CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv22111

Modified Files:
	m_option.c m_option.h 
Log Message:
New option type to print help text with a function.


Index: m_option.c
===================================================================
RCS file: /cvsroot/mplayer/main/m_option.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- m_option.c	23 Jan 2006 12:15:22 -0000	1.44
+++ m_option.c	24 Jan 2006 11:14:13 -0000	1.45
@@ -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

Index: m_option.h
===================================================================
RCS file: /cvsroot/mplayer/main/m_option.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- m_option.h	22 Jan 2006 12:43:14 -0000	1.13
+++ m_option.h	24 Jan 2006 11:14:13 -0000	1.14
@@ -18,6 +18,7 @@
 
 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 @@
 #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)




More information about the MPlayer-cvslog mailing list