[Mplayer-cvslog] CVS: main m_option.c,1.1,1.2 m_option.h,1.1,1.2 m_config.h,1.1,1.2

Alban Bedel CVS albeu at mplayerhq.hu
Tue Nov 12 13:39:08 CET 2002


Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv28593

Modified Files:
	m_option.c m_option.h m_config.h 
Log Message:
Fix the Gui with NEW_CONFIG


Index: m_option.c
===================================================================
RCS file: /cvsroot/mplayer/main/m_option.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- m_option.c	12 Nov 2002 01:56:21 -0000	1.1
+++ m_option.c	12 Nov 2002 12:39:05 -0000	1.2
@@ -315,7 +315,7 @@
 }
 
 static char* print_str(m_option_t* opt,  void* val) {
-  return (val && VAL(val) && strlen(VAL(val)) > 0) ? strdup(VAL(val)) : strdup("(empty)");
+  return (val && VAL(val) && strlen(VAL(val)) > 0) ? strdup(VAL(val)) : NULL;
 }
 
 static void copy_str(m_option_t* opt,void* dst, void* src) {
@@ -559,7 +559,23 @@
 }
 
 static char* print_str_list(m_option_t* opt, void* src) {
-  return strdup("TODO ;)");
+  char **lst = NULL;
+  char *ret = NULL,*last = NULL;
+  int i;
+  
+  if(!(src && VAL(src))) return NULL;
+  lst = VAL(src);
+
+  for(i = 0 ; lst[i] ; i++) {
+    if(last) {
+      ret = dup_printf("%s,%s",last,lst[i]);
+      free(last);
+    } else
+      ret = strdup(lst[i]);
+    last = ret;
+  }
+  if(last && last != ret) free(last);
+  return ret;
 }
 
 m_option_type_t m_option_type_string_list = {

Index: m_option.h
===================================================================
RCS file: /cvsroot/mplayer/main/m_option.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- m_option.h	12 Nov 2002 01:56:21 -0000	1.1
+++ m_option.h	12 Nov 2002 12:39:05 -0000	1.2
@@ -190,7 +190,7 @@
   if(opt->type->print)
     return opt->type->print(opt,val_ptr);
   else
-    return NULL;
+    return (char*)-1;
 }
 
 inline static  void

Index: m_config.h
===================================================================
RCS file: /cvsroot/mplayer/main/m_config.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- m_config.h	12 Nov 2002 01:56:21 -0000	1.1
+++ m_config.h	12 Nov 2002 12:39:05 -0000	1.2
@@ -55,6 +55,9 @@
 struct m_option*
 m_config_get_option(m_config_t *config, char* arg);
 
+void
+m_config_print_option_list(m_config_t *config);
+
 /////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////// Backward compat. stuff ////////////////////////////////
 ////////////////////////////////////////////////////////////////////////////////////




More information about the MPlayer-cvslog mailing list