if( *path == '\0' )
{
- snprintf( path, sizeof( path ), "%s" DIR_SEP DIR_SHARE,
- vlc_global()->psz_vlcpath );
+ snprintf( path, sizeof( path ), "%s" DIR_SEP DIR_SHARE, psz_vlcpath );
path[sizeof( path ) - 1] = '\0';
}
return path;
if( *path == '\0' )
{
snprintf( path, sizeof( path ), "%s"DIR_SEP DIR_SHARE, /* FIXME: Duh? */
- vlc_global()->psz_vlcpath );
+ psz_vlcpath );
path[sizeof( path ) - 1] = '\0';
}
return path;
#define vlc_custom_create(o, s, t, n) \
__vlc_custom_create(VLC_OBJECT(o), s, t, n)
-/**
- * libvlc_global_data_t (global variable)
- *
- * This structure has an unique instance, statically allocated in libvlc and
- * never accessed from the outside. It stores process-wide VLC variables,
- * mostly process-wide locks, and (currently) the module bank and objects tree.
- */
-typedef struct libvlc_global_data_t
-{
- VLC_COMMON_MEMBERS
-
- char * psz_vlcpath;
-} libvlc_global_data_t;
/**
* The module bank
*/
extern module_bank_t *p_module_bank;
-libvlc_global_data_t *vlc_global (void);
+vlc_object_t *vlc_global (void);
+extern char *psz_vlcpath;
/**
* Private LibVLC data for each object.
vlc_thread_join( p_appthread );
vlc_object_release( p_appthread );
- free( vlc_global()->psz_vlcpath );
+ free( psz_vlcpath );
}
/* following functions are local */
BEntry entry( &info.ref );
entry.GetPath( &path );
path.GetParent( &path );
- vlc_global()->psz_vlcpath = strdup( path.Path() );
+ psz_vlcpath = strdup( path.Path() );
/* Tell the main thread we are finished initializing the BApplication */
vlc_thread_ready( p_this );
p_char = strdup( ppsz_argv[ 0 ] );
}
- vlc_global()->psz_vlcpath = p_char;
+ psz_vlcpath = p_char;
/* Remove trailing program name */
for( ; *p_char ; )
void system_End( libvlc_int_t *p_this )
{
(void)p_this;
- free( vlc_global()->psz_vlcpath );
+ free( psz_vlcpath );
}
assert (strlen (LIBDIR) < sizeof (libvlc_path));
strcpy (libvlc_path, LIBDIR); /* fail safe */
- vlc_global ()->psz_vlcpath = libvlc_path;
+ psz_vlcpath = libvlc_path;
/* Find the path to libvlc (i.e. ourselves) */
FILE *maps = fopen ("/proc/self/maps", "rt");
/**
* Global process-wide VLC object.
- * Contains inter-instance data, such as the module cache and global mutexes.
+ * Contains the global named mutexes.
+ * TODO: remove it.
*/
-static libvlc_global_data_t *p_root;
+static vlc_object_t *p_root;
-libvlc_global_data_t *vlc_global( void )
+vlc_object_t *vlc_global( void )
{
assert( i_initializations > 0 );
return p_root;
*/
vlc_mutex_t *var_AcquireMutex( const char *name )
{
- libvlc_global_data_t *p_global = vlc_global();
+ vlc_object_t *p_global = vlc_global();
vlc_value_t val;
if( var_Create( p_global, name, VLC_VAR_MUTEX ) )
}
#endif
- vlc_global()->psz_vlcpath = strdup( psz_path );
+ psz_vlcpath = strdup( psz_path );
/* Set the default file-translation mode */
#if !defined( UNDER_CE )
HWND ipcwindow;
if( p_this && vlc_global() )
{
- free( vlc_global()->psz_vlcpath );
- vlc_global()->psz_vlcpath = NULL;
+ free( psz_vlcpath );
+ psz_vlcpath = NULL;
}
if( ipcwindow = FindWindow( 0, L"VLC ipc "VERSION ) )
return path;
}
+extern char *psz_vlcpath = NULL;
+
/*****************************************************************************
* AllocateAllPlugins: load all plugin modules we can find.
*****************************************************************************/
#ifdef HAVE_DYNAMIC_PLUGINS
static void AllocateAllPlugins( vlc_object_t *p_this )
{
- const char *vlcpath = vlc_global()->psz_vlcpath;
+ const char *vlcpath = psz_vlcpath;
int count,i;
char * path;
vlc_array_t *arraypaths = vlc_array_new();