[Mplayer-cvslog] CVS: main/Gui cfg.c,1.37,1.38 interface.c,1.86,1.87

Alex Beregszaszi alex at mplayerhq.hu
Wed Aug 13 18:29:58 CEST 2003


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

Modified Files:
	cfg.c interface.c 
Log Message:
Removed the historic cfgparser and switched full to the new config parser (altought some macros still remain for compatibility). As a side effect 90% of the warning messages are gone from the core. Things should be cleaner now and less confusing for newbies.

Index: cfg.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/cfg.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- cfg.c	20 Mar 2003 12:41:32 -0000	1.37
+++ cfg.c	13 Aug 2003 16:29:25 -0000	1.38
@@ -6,7 +6,8 @@
 #include "../config.h"
 #include "../mp_msg.h"
 #include "../mplayer.h"
-#include "../cfgparser.h"
+#include "../m_config.h"
+#include "../m_option.h"
 
 #ifdef USE_SETLOCALE
 #include <locale.h>
@@ -73,7 +74,7 @@
 extern int    stop_xscreensaver;
 
 static m_config_t * gui_conf;
-static config_t gui_opts[] =
+static m_option_t gui_opts[] =
 {
  { "enable_audio_equ",&gtkEnableAudioEqualizer,CONF_TYPE_FLAG,0,0,1,NULL },
  
@@ -199,11 +200,7 @@
 
 // -- read configuration
  mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[cfg] read config file: %s\n",cfg );
- gui_conf=m_config_new(
-#ifndef NEW_CONFIG
- play_tree_new()
-#endif
- ); 
+ gui_conf=m_config_new();
  m_config_register_options( gui_conf,gui_opts );
  if ( m_config_parse_config_file( gui_conf,cfg ) < 0 ) 
   {
@@ -283,33 +280,12 @@
   {
    for ( i=0;gui_opts[i].name;i++ )
     {
-#ifdef NEW_CONFIG
       char* v = m_option_print(&gui_opts[i],gui_opts[i].p);
       if(v) {
 	fprintf( f,"%s = \"%s\"\n",gui_opts[i].name, v);
 	free(v);
       } else if((int)v == -1)
 	mp_msg(MSGT_GPLAYER,MSGL_WARN,"Unable to save the %s option\n");
-#else
-     switch ( gui_opts[i].type )
-      {
-       case CONF_TYPE_INT:
-       case CONF_TYPE_FLAG:   fprintf( f,"%s = %d\n",gui_opts[i].name,*( (int *)gui_opts[i].p ) );   break;
-       case CONF_TYPE_FLOAT:  fprintf( f,"%s = %f\n",gui_opts[i].name,*( (float *)gui_opts[i].p ) ); break;
-       case CONF_TYPE_STRING: 
-            {
-	     char * tmp = *( (char **)gui_opts[i].p );
-	     if ( tmp && tmp[0] ) fprintf( f,"%s = \"%s\"\n",gui_opts[i].name,tmp );
-	     break;
-	    }
-       case CONF_TYPE_STRING_LIST:
-            {
-	     char ** tmp = *( (char ***)gui_opts[i].p );
-	     if ( tmp && tmp[0] && tmp[0][0] ) fprintf( f,"%s = \"%s\"\n",gui_opts[i].name,tmp[0] );
-	     break;
-	    }
-      }
-#endif
     }
    fclose( f );
   }

Index: interface.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/interface.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -r1.86 -r1.87
--- interface.c	9 Jun 2003 12:15:41 -0000	1.86
+++ interface.c	13 Aug 2003 16:29:25 -0000	1.87
@@ -39,14 +39,8 @@
 #include "../libmpdemux/stheader.h"
 #include "../libmpcodecs/dec_video.h"
 
-
-#ifdef NEW_CONFIG
-  #include "../m_option.h"
-  #include "../m_config.h"
-#else
-  #include "../cfgparser.h"
-#endif
-#include "../cfg-mplayer-def.h"
+#include "../m_config.h"
+#include "../m_option.h"
 
 guiInterface_t guiIntfStruct;
 int guiWinID=-1;



More information about the MPlayer-cvslog mailing list