#ifdef TOP_BUILDDIR
setenv ("VLC_PLUGIN_PATH", TOP_BUILDDIR"/modules", 1);
+ setenv ("VLC_DATA_PATH", TOP_SRCDIR"/share", 1);
#endif
/* Clear the X.Org startup notification ID. Otherwise the UI might try to
/* Block all these signals */
pthread_sigmask (SIG_SETMASK, &set, NULL);
- const char *argv[i_argc + 3];
+ const char *argv[i_argc + 2];
int argc = 0;
argv[argc++] = "--no-ignore-config";
argv[argc++] = "--media-library";
-#ifdef TOP_SRCDIR
- argv[argc++] = "--data-path="TOP_SRCDIR"/share";
-#endif
ppsz_argv++; i_argc--; /* skip executable path */
#ifdef __APPLE__
/* When VLC.app is run by double clicking in Mac OS X, the 2nd arg
#ifndef UNDER_CE
#ifdef TOP_BUILDDIR
putenv("VLC_PLUGIN_PATH=Z:"TOP_BUILDDIR"/modules");
+ putenv("VLC_DATA_PATH=Z:"TOP_SRCDIR"/share");
#endif
HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
#define config_ResetAll(a) config_ResetAll(VLC_OBJECT(a))
VLC_API module_config_t * config_FindConfig( vlc_object_t *, const char * ) VLC_USED;
-VLC_API char * config_GetDataDir( vlc_object_t * ) VLC_USED VLC_MALLOC;
-#define config_GetDataDir(a) config_GetDataDir(VLC_OBJECT(a))
+VLC_API char * config_GetDataDir(void) VLC_USED VLC_MALLOC;
VLC_API char *config_GetLibDir(void) VLC_USED;
VLC_API const char * config_GetConfDir( void ) VLC_USED;
DIR *p_dir;
char *psz_dir = NULL;
- char *data_dir = config_GetDataDir( p_scan->p_obj );
+ char *data_dir = config_GetDataDir();
if( asprintf( &psz_dir, "%s" DIR_SEP "dvb" DIR_SEP "dvb-s", data_dir ) == -1 )
psz_dir = NULL;
// A little theming
char *psz_rc_file = NULL;
- char *psz_data = config_GetDataDir( p_intf );
+ char *psz_data = config_GetDataDir();
if( asprintf( &psz_rc_file, "%s/maemo/vlc_intf.rc", psz_data ) != -1 )
{
gtk_rc_parse( psz_rc_file );
char *datadir = config_GetUserDir( VLC_DATA_DIR );
m_resourcePath.push_back( (string)datadir + "\\skins" );
free( datadir );
- datadir = config_GetDataDir( getIntf() );
+ datadir = config_GetDataDir();
m_resourcePath.push_back( (string)datadir + "\\skins" );
m_resourcePath.push_back( (string)datadir + "\\skins2" );
m_resourcePath.push_back( (string)datadir + "\\share\\skins" );
m_resourcePath.push_back( (string)datadir + "/skins2" );
free( datadir );
m_resourcePath.push_back( (string)"share/skins2" );
- datadir = config_GetDataDir( getIntf() );
+ datadir = config_GetDataDir();
m_resourcePath.push_back( (string)datadir + "/skins2" );
free( datadir );
*****************************************************************************/
static int vlclua_datadir( lua_State *L )
{
- char *psz_data = config_GetDataDir( vlclua_get_this( L ) );
+ char *psz_data = config_GetDataDir();
lua_pushstring( L, psz_data );
free( psz_data );
return 1;
}
#endif
- char *psz_datapath = config_GetDataDir( p_this );
+ char *psz_datapath = config_GetDataDir();
if( likely(psz_datapath != NULL) )
{
if( likely(asprintf( &ppsz_dir_list[i], "%s"DIR_SEP"lua"DIR_SEP"%s",
p_sys->app_name = CFSTR( "VLC media player" );
p_sys->notification_type = CFSTR( "New input playing" );
- char *data_path = config_GetDataDir ( p_this );
+ char *data_path = config_GetDataDir ();
char buf[strlen (data_path) + sizeof ("/vlc512x512.png")];
snprintf (buf, sizeof (buf), "%s/vlc512x512.png", data_path);
msg_Dbg( p_this, "looking for icon at %s", buf );
/* Load icon from share/ */
GError *p_error = NULL;
char *psz_pixbuf;
- char *psz_data = config_GetDataDir( p_this );
+ char *psz_data = config_GetDataDir();
if( asprintf( &psz_pixbuf, "%s/icons/48x48/vlc.png", psz_data ) >= 0 )
{
pix = gdk_pixbuf_new_from_file( psz_pixbuf, &p_error );
#ifdef WIN32
if ( psz_preset_path == NULL )
{
- char *psz_data_path = config_GetDataDir( p_filter );
+ char *psz_data_path = config_GetDataDir();
asprintf( &psz_preset_path, "%s" DIR_SEP "visualization", psz_data_path );
free( psz_data_path );
}
#include "configuration.h"
-#undef config_GetDataDir
/**
* Determines the shared architecture-independent data directory
*
* @return a string or NULL. Use free() to release.
*/
-char *config_GetDataDir( vlc_object_t *p_obj )
+char *config_GetDataDir(void)
{
- char *psz_path = var_InheritString( p_obj, "data-path" );
- return psz_path ? psz_path : config_GetDataDirDefault();
+ const char *path = getenv ("VLC_DATA_PATH");
+ if (path)
+ return strdup (path);
+ return config_GetDataDirDefault();
}