]> git.sesse.net Git - vlc/blobdiff - src/misc/configuration.c
* modules/codec/quicktime.c, modules/codec/cinepak.c: use pts if available, otherwise...
[vlc] / src / misc / configuration.c
index 8f153257f8b1d46dda3ebf7ae3e2fd5fe2ba4f48..249032bab89b39c570fcca67336802b98a77913b 100644 (file)
@@ -2,7 +2,7 @@
  * configuration.c management of the modules configuration
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: configuration.c,v 1.68 2003/11/05 17:57:29 gbazin Exp $
+ * $Id: configuration.c,v 1.71 2003/11/11 21:23:56 hartman Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -815,7 +815,7 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
                     case CONFIG_ITEM_INTEGER:
                         if( !*psz_option_value )
                             break;                    /* ignore empty option */
-                        p_item->i_value = atoi( psz_option_value);
+                        p_item->i_value = strtol( psz_option_value, 0, 0 );
 #if 0
                         msg_Dbg( p_this, "option \"%s\", value %i",
                                  p_item->psz_name, p_item->i_value );
@@ -1120,6 +1120,8 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name )
                 if( p_item->psz_text )
                     fprintf( file, "# %s (%s)\n", p_item->psz_text,
                              _("key") );
+                if( p_item->i_value == p_item->i_value_orig )
+                    fprintf( file, "#" );
                 psz_key = ConfigKeyToString( p_item->i_value );
                 fprintf( file, "%s=%s\n", p_item->psz_name,
                          psz_key ? psz_key : "" );
@@ -1387,7 +1389,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
                 config_PutPsz( p_this, psz_name, optarg );
                 break;
             case CONFIG_ITEM_INTEGER:
-                config_PutInt( p_this, psz_name, atoi(optarg));
+                config_PutInt( p_this, psz_name, strtol(optarg, 0, 0));
                 break;
             case CONFIG_ITEM_FLOAT:
                 config_PutFloat( p_this, psz_name, (float)atof(optarg) );
@@ -1443,7 +1445,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
                 else
                 {
                     config_PutInt( p_this, pp_shortopts[i_cmd]->psz_name,
-                                           atoi(optarg) );
+                                           strtol(optarg, 0, 0) );
                 }
                 break;
             case CONFIG_ITEM_BOOL:
@@ -1571,22 +1573,22 @@ static int ConfigStringToKey( char *psz_key )
     char *psz_parser = strchr( psz_key, '-' );
     while( psz_parser && psz_parser != psz_key )
     {
-        for( i = 0; i < sizeof(modifiers) / sizeof(key_descriptor_t); i++ )
+        for( i = 0; i < sizeof(vlc_modifiers) / sizeof(key_descriptor_t); i++ )
         {
-            if( !strncasecmp( modifiers[i].psz_key_string, psz_key,
-                              strlen( modifiers[i].psz_key_string ) ) )
+            if( !strncasecmp( vlc_modifiers[i].psz_key_string, psz_key,
+                              strlen( vlc_modifiers[i].psz_key_string ) ) )
             {
-                i_key |= modifiers[i].i_key_code;
+                i_key |= vlc_modifiers[i].i_key_code;
             }
         }
         psz_key = psz_parser + 1;
         psz_parser = strchr( psz_key, '-' );
     }
-    for( i = 0; i < sizeof(keys) / sizeof( key_descriptor_t ); i++ )
+    for( i = 0; i < sizeof(vlc_keys) / sizeof( key_descriptor_t ); i++ )
     {
-        if( !strcasecmp( keys[i].psz_key_string, psz_key ) )
+        if( !strcasecmp( vlc_keys[i].psz_key_string, psz_key ) )
         {
-            i_key |= keys[i].i_key_code;
+            i_key |= vlc_keys[i].i_key_code;
             break;
         }
     }
@@ -1605,20 +1607,20 @@ static char *ConfigKeyToString( int i_key )
     }
     *psz_key = '\0';
     p = psz_key;
-    for( index = 0; index < (sizeof(modifiers) / sizeof(key_descriptor_t));
+    for( index = 0; index < (sizeof(vlc_modifiers) / sizeof(key_descriptor_t));
          index++ )
     {
-        if( i_key & modifiers[index].i_key_code )
+        if( i_key & vlc_modifiers[index].i_key_code )
         {
-            p += sprintf( p, "%s-", modifiers[index].psz_key_string );
+            p += sprintf( p, "%s-", vlc_modifiers[index].psz_key_string );
         }
     }
-    for( index = 0; index < (sizeof(keys) / sizeof( key_descriptor_t));
+    for( index = 0; index < (sizeof(vlc_keys) / sizeof( key_descriptor_t));
          index++)
     {
-        if( (int)( i_key & ~KEY_MODIFIER ) == keys[index].i_key_code )
+        if( (int)( i_key & ~KEY_MODIFIER ) == vlc_keys[index].i_key_code )
         {
-            p += sprintf( p, "%s", keys[index].psz_key_string );
+            p += sprintf( p, "%s", vlc_keys[index].psz_key_string );
             break;
         }
     }