*****************************************************************************/
#include <vlc/vlc.h>
+#include "../libvlc.h"
#include "vlc_keys.h"
#include "vlc_charset.h"
static const unsigned char config_types[] =
{
CONFIG_ITEM_STRING, CONFIG_ITEM_FILE, CONFIG_ITEM_MODULE,
- CONFIG_ITEM_DIRECTORY, CONFIG_ITEM_MODULE_CAT,
+ CONFIG_ITEM_DIRECTORY, CONFIG_ITEM_MODULE_CAT, CONFIG_ITEM_PASSWORD,
CONFIG_ITEM_MODULE_LIST, CONFIG_ITEM_MODULE_LIST_CAT
};
i_type = VLC_VAR_STRING;
break;
+ case CONFIG_ITEM_PASSWORD:
+ i_type = VLC_VAR_STRING;
+ break;
+
case CONFIG_ITEM_FILE:
i_type = VLC_VAR_FILE;
break;
*****************************************************************************
* This function is used to get the value of variables which are internally
* represented by a string (CONFIG_ITEM_STRING, CONFIG_ITEM_FILE,
- * CONFIG_ITEM_DIRECTORY, and CONFIG_ITEM_MODULE).
+ * CONFIG_ITEM_DIRECTORY, CONFIG_ITEM_PASSWORD, and CONFIG_ITEM_MODULE).
*
* Important note: remember to free() the returned char* because it's a
* duplicate of the actual value. It isn't safe to return a pointer to the
*****************************************************************************
* This function is used to set the value of variables which are internally
* represented by a string (CONFIG_ITEM_STRING, CONFIG_ITEM_FILE,
- * CONFIG_ITEM_DIRECTORY, and CONFIG_ITEM_MODULE).
+ * CONFIG_ITEM_DIRECTORY, CONFIG_ITEM_PASSWORD, and CONFIG_ITEM_MODULE).
*****************************************************************************/
void __config_PutPsz( vlc_object_t *p_this,
const char *psz_name, const char *psz_value )
/* Check if the option is deprecated */
if( p_conf->psz_current )
{
- if( !strcmp(p_conf->psz_current,"SUPPRESSED") )
+ if( p_conf->b_strict )
{
- if( !b_ignore_errors )
- {
- fprintf(stderr,
- "Warning: option --%s is no longer used.\n",
- p_conf->psz_name);
- }
+ fprintf(stderr,
+ "Warning: option --%s no longer exists.\n",
+ p_conf->psz_name);
continue;
}
+
+ fprintf( stderr,
+ "%s: option --%s is deprecated. Use --%s instead.\n",
+ b_ignore_errors ? "Warning" : "Error",
+ p_conf->psz_name, p_conf->psz_current);
if( !b_ignore_errors )
{
- if( p_conf->b_strict )
- {
- fprintf( stderr,
- "Error: option --%s is deprecated. "
- "Use --%s instead.\n",
- p_conf->psz_name, p_conf->psz_current);
- /*free */
- for( i_index = 0; p_longopts[i_index].name; i_index++ )
- free( (char *)p_longopts[i_index].name );
-
- free( p_longopts );
- free( psz_shortopts );
- return -1;
- }
- fprintf(stderr,
- "Warning: option --%s is deprecated. "
- "You should use --%s instead.\n",
- p_conf->psz_name, p_conf->psz_current);
+ /*free */
+ for( i_index = 0; p_longopts[i_index].name; i_index++ )
+ free( (char *)p_longopts[i_index].name );
+
+ free( p_longopts );
+ free( psz_shortopts );
+ return -1;
}
+
psz_name = (char *)p_conf->psz_current;
p_conf = config_FindConfig( p_this, psz_name );
}
switch( p_conf->i_type )
{
case CONFIG_ITEM_STRING:
+ case CONFIG_ITEM_PASSWORD:
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
case CONFIG_ITEM_MODULE:
switch( pp_shortopts[i_cmd]->i_type )
{
case CONFIG_ITEM_STRING:
+ case CONFIG_ITEM_PASSWORD:
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
case CONFIG_ITEM_MODULE:
*
* @return a string (always succeeds).
*/
-const char *config_GetDataDir( const vlc_object_t *p_this )
+const char *config_GetDataDir( void )
{
#if defined (WIN32) || defined (UNDER_CE)
- return vlc_global( p_this )->psz_vlcpath;
+ return vlc_global()->psz_vlcpath;
#elif defined(__APPLE__) || defined (SYS_BEOS)
static char path[PATH_MAX] = "";
if( *path == '\0' )
{
snprintf( path, sizeof( path ), "%s/share",
- vlc_global( p_this )->psz_vlcpath );
+ vlc_global()->psz_vlcpath );
path[sizeof( path ) - 1] = '\0';
}
return path;
#else
- (void)p_this;
return DATA_PATH;
#endif
}