VLC_EXPORT( void, __config_ResetAll, ( vlc_object_t * ) );
VLC_EXPORT( module_config_t *, config_FindConfig,( vlc_object_t *, const char * ) LIBVLC_USED );
-
VLC_EXPORT(const char *, config_GetDataDir, ( void ) LIBVLC_USED);
VLC_EXPORT(const char *, config_GetConfDir, ( void ) LIBVLC_USED);
-VLC_EXPORT(char *, config_GetUserConfDir, ( void ) LIBVLC_USED);
VLC_EXPORT(char *, config_GetUserDataDir, ( void ) LIBVLC_USED);
typedef enum vlc_userdir {
+ /* User's home */
VLC_HOME_DIR,
+ /* VLC configuration directory */
+ VLC_CONFIG_DIR,
} vlc_userdir_t;
VLC_EXPORT(char *, config_GetUserDir, ( vlc_userdir_t ) LIBVLC_USED);
static int vlclua_configdir( lua_State *L )
{
- char *dir = config_GetUserConfDir();
+ char *dir = config_GetUserDir( VLC_CONFIG_DIR );
lua_pushstring( L, dir );
free( dir );
return 1;
return psz_dir;
}
-/**
- * Get the user's VLC configuration directory
- */
-char *config_GetUserConfDir( void )
-{
- return config_GetAppDir ("CONFIG", ".config");
-}
-
/**
* Get the user's VLC data directory
* (used for stuff like the skins, custom lua modules, ...)
char *config_GetUserDir (vlc_userdir_t type)
{
- char *home = config_GetHomeDir ();
- (void)type;
- return home;
+ switch (type)
+ {
+ case VLC_HOME_DIR:
+ return config_GetHomeDir ();
+ case VLC_CONFIG_DIR:
+ return config_GetAppDir ("CONFIG", ".config");
+ }
+ assert (0);
}
char *psz_file = config_GetPsz( obj, "config" );
if( psz_file == NULL )
{
- char *psz_dir = config_GetUserConfDir();
+ char *psz_dir = config_GetUserDir( VLC_CONFIG_DIR );
if( asprintf( &psz_file, "%s" DIR_SEP CONFIG_FILE, psz_dir ) == -1 )
psz_file = NULL;
static int config_PrepareDir (vlc_object_t *obj)
{
- char *psz_configdir = config_GetUserConfDir ();
- if (psz_configdir == NULL) /* XXX: This should never happen */
+ char *psz_configdir = config_GetUserDir (VLC_CONFIG_DIR);
+ if (psz_configdir == NULL)
return -1;
int ret = config_CreateDir (obj, psz_configdir);
__config_GetInt
__config_GetPsz
__config_GetType
-config_GetUserConfDir
config_GetUserDataDir
__config_PutFloat
__config_PutInt