VLC_EXPORT( void, vlc_list_release, ( vlc_list_t * ) );
VLC_EXPORT( libvlc_int_t *, vlc_current_object, ( int ) );
-#if defined( WIN32 ) || defined( SYS_BEOS ) || defined( __APPLE__ )
-VLC_EXPORT( const char *, vlc_path, ( vlc_object_t * ) );
-#endif
-
/*}@*/
#define vlc_object_create(a,b) \
#if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32)
if ( ( psz_src = config_GetPsz( p_intf, "http-src" )) == NULL )
{
- char * psz_vlcpath = vlc_path( p_intf );
- psz_src = malloc( strlen(psz_vlcpath) + strlen("/share/http" ) + 1 );
+ char * psz_vlcpath = config_GetDataDir( p_intf );
+ psz_src = malloc( strlen(psz_vlcpath) + strlen("/http" ) + 1 );
if( !psz_src ) return VLC_ENOMEM;
-#if defined(WIN32)
sprintf( psz_src, "%s/http", psz_vlcpath );
-#else
- sprintf( psz_src, "%s/share/http", psz_vlcpath );
-#endif
}
#else
psz_src = config_GetPsz( p_intf, "http-src" );
# if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32)
{
- char *psz_vlcpath = vlc_path( p_demux );
- ppsz_dir_list[1] = malloc( strlen( psz_vlcpath ) + strlen( "/share/luaplaylist" ) + 1 );
+ char *psz_vlcpath = config_GetDataDir( p_demux );
+ ppsz_dir_list[1] = malloc( strlen( psz_vlcpath ) + strlen( "luaplaylist" ) + 1 );
if( !ppsz_dir_list[1] ) return VLC_ENOMEM;
-# if defined( WIN32 )
- sprintf( ppsz_dir_list[1], "%s/luaplaylist", psz_vlcpath );
-# else
- sprintf( ppsz_dir_list[1], "%s/share/luaplaylist", psz_vlcpath );
-# endif
+ sprintf( ppsz_dir_list[1], "%s/luaplaylist", psz_vlcpath );
}
# else
{
// Initialize the resource path
m_resourcePath.push_back( (string)getIntf()->p_libvlc->psz_homedir +
"\\" + CONFIG_DIR + "\\skins" );
- m_resourcePath.push_back( (string)vlc_path( getIntf() ) +
+ m_resourcePath.push_back( (string)config_GetDataDir( getIntf() ) +
"\\skins" );
- m_resourcePath.push_back( (string)vlc_path( getIntf() ) +
+ m_resourcePath.push_back( (string)config_GetDataDir( getIntf() ) +
"\\skins2" );
- m_resourcePath.push_back( (string)vlc_path( getIntf() ) +
+ m_resourcePath.push_back( (string)config_GetDataDir( getIntf() ) +
"\\share\\skins" );
- m_resourcePath.push_back( (string)vlc_path( getIntf() ) +
+ m_resourcePath.push_back( (string)config_GetDataDir( getIntf() ) +
"\\share\\skins2" );
// All went well
#else
char psz_path[1024];
if (snprintf (psz_path, sizeof (psz_path), "%s/%s",
- libvlc_global.psz_vlcpath, "locale")
+ vlc_global( &libvlc_global )->psz_vlcpath, "locale")
>= (int)sizeof (psz_path))
return -1;
vlc_thread_join( p_this->p_libvlc_global->p_appthread );
vlc_object_destroy( p_this->p_libvlc_global->p_appthread );
- free( p_this->p_libvlc_global->psz_vlcpath );
+ free( vlc_global( p_this )->psz_vlcpath );
}
/* following functions are local */
BEntry entry( &info.ref );
entry.GetPath( &path );
path.GetParent( &path );
- p_this->p_libvlc_global->psz_vlcpath = strdup( path.Path() );
+ vlc_global( p_this )->psz_vlcpath = strdup( path.Path() );
/* Tell the main thread we are finished initializing the BApplication */
vlc_thread_ready( p_this );
char *p_char, *p_oldchar = &i_dummy;
/* Get the full program path and name */
- p_char = p_this->p_libvlc_global->psz_vlcpath = strdup( ppsz_argv[ 0 ] );
+ p_char = vlc_global( p_this )->psz_vlcpath = strdup( ppsz_argv[ 0 ] );
/* Remove trailing program name */
for( ; *p_char ; )
CFRelease( all_locales );
}
- vlc_mutex_init( p_this, &p_this->p_libvlc_global->iconv_lock );
- p_this->p_libvlc_global->iconv_macosx = vlc_iconv_open( "UTF-8", "UTF-8-MAC" );
+ vlc_mutex_init( p_this, &vlc_global( p_this )->iconv_lock );
+ vlc_global( p_this )->iconv_macosx = vlc_iconv_open( "UTF-8", "UTF-8-MAC" );
}
/*****************************************************************************
*****************************************************************************/
void system_End( libvlc_int_t *p_this )
{
- free( p_this->p_libvlc_global->psz_vlcpath );
+ free( vlc_global( p_this )->psz_vlcpath );
- if ( p_this->p_libvlc_global->iconv_macosx != (vlc_iconv_t)-1 )
- vlc_iconv_close( p_this->p_libvlc_global->iconv_macosx );
- vlc_mutex_destroy( &p_this->p_libvlc_global->iconv_lock );
+ if ( vlc_global( p_this )->iconv_macosx != (vlc_iconv_t)-1 )
+ vlc_iconv_close( vlc_global( p_this )->iconv_macosx );
+ vlc_mutex_destroy( &vlc_global( p_this )->iconv_lock );
}
}
}
}
-
-
-#if defined( WIN32 ) || defined( SYS_BEOS ) || defined( __APPLE__ )
-const char *vlc_path( vlc_object_t *p_this )
-{
- return vlc_global( p_this )->psz_vlcpath;
-}
-#endif
if( (psz_vlc = strrchr( psz_path, '\\' )) ) *psz_vlc = '\0';
- p_this->p_libvlc_global->psz_vlcpath = strdup( psz_path );
+ vlc_global( p_this )->psz_vlcpath = strdup( psz_path );
/* Set the default file-translation mode */
#if !defined( UNDER_CE )
*****************************************************************************/
void system_End( libvlc_int_t *p_this )
{
- if( p_this && p_this->p_libvlc_global && p_this->p_libvlc_global->psz_vlcpath )
+ if( p_this && p_this->p_libvlc_global && vlc_global( p_this )->psz_vlcpath )
{
- free( p_this->p_libvlc_global->psz_vlcpath );
- p_this->p_libvlc_global->psz_vlcpath = NULL;
+ free( vlc_global( p_this )->psz_vlcpath );
+ vlc_global( p_this )->psz_vlcpath = NULL;
}
WSACleanup();
const char *config_GetDataDir( const vlc_object_t *p_this )
{
#if defined (WIN32) || defined (UNDER_CE)
- return p_this->p_libvlc_global->psz_vlcpath;
+ return vlc_global( p_this )->psz_vlcpath;
#elif defined(__APPLE__) || defined (SYS_BEOS)
static char path[PATH_MAX] = "";
if( *path == '\0' )
{
snprintf( path, sizeof( path ), "%s/share",
- p_this->p_libvlc_global->psz_vlcpath );
+ vlc_global( p_this )->psz_vlcpath );
path[sizeof( path ) - 1] = '\0';
}
return path;