VLC_HOME_DIR, /* User's home */
VLC_CONFIG_DIR, /* VLC-specific configuration directory */
VLC_DATA_DIR, /* VLC-specific data directory */
+ VLC_CACHE_DIR, /* VLC-specific user cached data directory */
/* Generic directories (same as XDG) */
- VLC_DESKTOP_DIR,
+ VLC_DESKTOP_DIR=0x80,
VLC_DOWNLOAD_DIR,
VLC_TEMPLATES_DIR,
VLC_PUBLICSHARE_DIR,
} vlc_userdir_t;
VLC_EXPORT(char *, config_GetUserDir, ( vlc_userdir_t ) LIBVLC_USED);
-VLC_EXPORT(char *, config_GetCacheDir, ( void ) LIBVLC_USED);
VLC_EXPORT( void, __config_AddIntf, ( vlc_object_t *, const char * ) );
VLC_EXPORT( void, __config_RemoveIntf, ( vlc_object_t *, const char * ) );
}
#endif
if( !psz_font_dir )
- psz_font_dir = config_GetCacheDir();
+ psz_font_dir = config_GetUserDir( VLC_CACHE_DIR );
if( !psz_font_dir )
goto error;
static int vlclua_cachedir( lua_State *L )
{
- char *dir = config_GetCacheDir();
+ char *dir = config_GetUserDir( VLC_CACHE_DIR );
lua_pushstring( L, dir );
free( dir );
return 1;
return psz_dir;
}
-/**
- * Get the user's VLC cache directory
- * (used for stuff like the modules cache, the album art cache, ...)
- */
-char *config_GetCacheDir( void )
-{
- char *psz_dir;
- const char *psz_parent = GetDir (false);
-
- if( asprintf( &psz_dir, "%s/Library/Preferences/VLC", psz_parent ) == -1 )
- psz_dir = NULL;
-
- return psz_dir;
-}
-
char *config_GetUserDir (vlc_userdir_t type)
{
switch (type)
case VLC_HOME_DIR:
return config_GetHomeDir ();
case VLC_CONFIG_DIR:
- return config_GetAppDir ();
case VLC_DATA_DIR:
+ case VLC_CACHE_DIR:
return config_GetAppDir ();
+
case VLC_DESKTOP_DIR:
case VLC_DOWNLOAD_DIR:
case VLC_TEMPLATES_DIR:
return psz_dir;
}
-char *config_GetCacheDir( void )
-{
- return config_GetAppDir ();
-}
-
char *config_GetUserDir (vlc_userdir_t type)
{
switch (type)
case VLC_HOME_DIR:
return config_GetShellDir (CSIDL_PERSONAL);
case VLC_CONFIG_DIR:
- return config_GetAppDir ();
case VLC_DATA_DIR:
+ case VLC_CACHE_DIR:
return config_GetAppDir ();
+
case VLC_DESKTOP_DIR:
case VLC_DOWNLOAD_DIR:
case VLC_TEMPLATES_DIR:
}
-/**
- * Get the user's VLC cache directory
- * (used for stuff like the modules cache, the album art cache, ...)
- */
-char *config_GetCacheDir( void )
-{
- return config_GetAppDir ("CACHE", ".cache");
-}
-
char *config_GetUserDir (vlc_userdir_t type)
{
switch (type)
return config_GetAppDir ("CONFIG", ".config");
case VLC_DATA_DIR:
return config_GetAppDir ("DATA", ".local/share");
+ case VLC_CACHE_DIR:
+ return config_GetAppDir ("CACHE", ".cache");
+
case VLC_DESKTOP_DIR:
return config_GetTypeDir ("DESKTOP");
case VLC_DOWNLOAD_DIR:
__config_ChainParse
__config_ExistIntf
config_FindConfig
-config_GetCacheDir
config_GetConfDir
config_GetDataDir
__config_GetFloat
*****************************************************************************/
void CacheLoad( vlc_object_t *p_this, module_bank_t *p_bank, bool b_delete )
{
- char *psz_filename, *psz_cachedir = config_GetCacheDir();
+ char *psz_filename, *psz_cachedir = config_GetUserDir(VLC_CACHE_DIR);
FILE *file;
int i, j, i_size, i_read;
char p_cachestring[sizeof("cache " COPYRIGHT_MESSAGE)];
"# For information about cache directory tags, see:\r\n"
"# http://www.brynosaurus.com/cachedir/\r\n";
- char *psz_cachedir = config_GetCacheDir();
+ char *psz_cachedir = config_GetUserDir(VLC_CACHE_DIR);
FILE *file;
int i, j, i_cache;
module_cache_t **pp_cache;
const char *psz_album )
{
char *psz_dir;
- char *psz_cachedir = config_GetCacheDir();
+ char *psz_cachedir = config_GetUserDir(VLC_CACHE_DIR);
if( !EMPTY_STR(psz_artist) && !EMPTY_STR(psz_album) )
{