* 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>
*
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 );
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 : "" );
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) );
else
{
config_PutInt( p_this, pp_shortopts[i_cmd]->psz_name,
- atoi(optarg) );
+ strtol(optarg, 0, 0) );
}
break;
case CONFIG_ITEM_BOOL:
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;
}
}
}
*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;
}
}