VLC_EXPORT( int, config_Duplicate,( module_t *, const module_config_t *, size_t ));
-#define config_GetDataDir( a ) __config_GetDataDir( VLC_OBJECT( a ) )
-VLC_EXPORT(const char *, __config_GetDataDir, ( const vlc_object_t * ));
+VLC_EXPORT(const char *, config_GetDataDir, ( void ));
#define config_GetType(a,b) __config_GetType(VLC_OBJECT(a),b)
#define config_GetInt(a,b) __config_GetInt(VLC_OBJECT(a),b)
VLC_EXPORT( vlc_list_t *, __vlc_list_find, ( vlc_object_t *, int, int ) );
VLC_EXPORT( void, vlc_list_release, ( vlc_list_t * ) );
VLC_EXPORT( libvlc_int_t *, vlc_current_object, ( int ) );
-VLC_EXPORT( vlc_object_t *, vlc_global_object, ( void ) );
/*}@*/
#if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32)
if ( ( psz_src = config_GetPsz( p_intf, "http-src" )) == NULL )
{
- char * psz_vlcpath = config_GetDataDir( p_intf );
+ const char * psz_vlcpath = config_GetDataDir();
psz_src = malloc( strlen(psz_vlcpath) + strlen("/http" ) + 1 );
if( !psz_src ) return VLC_ENOMEM;
sprintf( psz_src, "%s/http", psz_vlcpath );
# if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32)
{
- char *psz_vlcpath = config_GetDataDir( p_demux );
+ const char *psz_vlcpath = config_GetDataDir();
if( asprintf( &ppsz_dir_list[1], "%s" DIR_SEP "luaplaylist", psz_vlcpath ) < 0 )
return VLC_ENOMEM;
if( asprintf( &ppsz_dir_list[2], "%s" DIR_SEP "share" DIR_SEP "luaplaylist", psz_vlcpath ) < 0 )
// Initialize the resource path
m_resourcePath.push_back( (string)getIntf()->p_libvlc->psz_homedir +
"\\" + CONFIG_DIR + "\\skins" );
- m_resourcePath.push_back( (string)config_GetDataDir( getIntf() ) +
+ m_resourcePath.push_back( (string)config_GetDataDir() +
"\\skins" );
- m_resourcePath.push_back( (string)config_GetDataDir( getIntf() ) +
+ m_resourcePath.push_back( (string)config_GetDataDir() +
"\\skins2" );
- m_resourcePath.push_back( (string)config_GetDataDir( getIntf() ) +
+ m_resourcePath.push_back( (string)config_GetDataDir() +
"\\share\\skins" );
- m_resourcePath.push_back( (string)config_GetDataDir( getIntf() ) +
+ m_resourcePath.push_back( (string)config_GetDataDir() +
"\\share\\skins2" );
// All went well
# if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32)
{
- const char *psz_vlcpath = config_GetDataDir( p_this );
+ const char *psz_vlcpath = config_GetDataDir();
if( asprintf( &ppsz_dir_list[1], "%s" DIR_SEP "%s", psz_vlcpath, luadirname ) < 0 )
return VLC_ENOMEM;
vlc_object_attach( p_session, p_tls );
const char *homedir = p_tls->p_libvlc->psz_homedir,
- *datadir = config_GetDataDir ((vlc_object_t *)p_session);
+ *datadir = config_GetDataDir ();
size_t l1 = strlen (homedir), l2 = strlen (datadir);
char path[((l1 > l2) ? l1 : l2) + sizeof ("/"CONFIG_DIR"/ssl/private")];
// > sizeof ("/"CONFIG_DIR"/ssl/certs")
char *psz_vlmconf;
/* Avoid multiple creation */
- if( var_Create( p_this->p_libvlc_global, "vlm_mutex", VLC_VAR_MUTEX ) ||
- var_Get( p_this->p_libvlc_global, "vlm_mutex", &lockval ) )
+ if( var_Create( p_this->p_libvlc, "vlm_mutex", VLC_VAR_MUTEX ) ||
+ var_Get( p_this->p_libvlc, "vlm_mutex", &lockval ) )
return NULL;
vlc_mutex_lock( lockval.p_address );
{
vlc_value_t lockval;
- var_Get( p_vlm->p_libvlc_global, "vlm_mutex", &lockval );
+ var_Get( p_vlm->p_libvlc, "vlm_mutex", &lockval );
vlc_mutex_lock( lockval.p_address );
vlc_object_release( p_vlm );
static void InitDeviceValues( libvlc_int_t * );
-vlc_object_t * vlc_global_object( void )
+libvlc_global_data_t *vlc_global( void )
{
- return VLC_OBJECT( &libvlc_global );
+ return &libvlc_global;
}
/*****************************************************************************
#endif
};
-#define vlc_global( a ) __vlc_global( VLC_OBJECT( a ) )
-static inline libvlc_global_data_t *__vlc_global( vlc_object_t *p_this )
-{
- return (libvlc_global_data_t *)p_this->p_libvlc_global;
-}
+libvlc_global_data_t *vlc_global (void);
extern uint32_t cpu_flags;
uint32_t CPUCapabilities( void );
vlc_b64_encode_binary
vlc_strnlen
stream_Block
-__config_GetDataDir
+config_GetDataDir
__vlc_object_find_name
__var_Command
net_Listen
*****************************************************************************/
void system_Init( libvlc_int_t *p_this, int *pi_argc, char *ppsz_argv[] )
{
- vlc_global( p_this )->p_appthread =
+ vlc_global()->p_appthread =
(vlc_object_t *)vlc_object_create( p_this, sizeof(vlc_object_t) );
/* Create the BApplication thread and wait for initialization */
- vlc_thread_create( vlc_global( p_this )->p_appthread, "app thread", AppThread,
+ vlc_thread_create( vlc_global()->p_appthread, "app thread", AppThread,
VLC_THREAD_PRIORITY_LOW, VLC_TRUE );
}
/* Tell the BApplication to die */
be_app->PostMessage( REALLY_QUIT );
- vlc_thread_join( vlc_global( p_this )->p_appthread );
- vlc_object_destroy( vlc_global( p_this )->p_appthread );
+ vlc_thread_join( vlc_global()->p_appthread );
+ vlc_object_destroy( vlc_global()->p_appthread );
- free( vlc_global( p_this )->psz_vlcpath );
+ free( vlc_global()->psz_vlcpath );
}
/* following functions are local */
BEntry entry( &info.ref );
entry.GetPath( &path );
path.GetParent( &path );
- vlc_global( p_this )->psz_vlcpath = strdup( path.Path() );
+ vlc_global()->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 = vlc_global( p_this )->psz_vlcpath = strdup( ppsz_argv[ 0 ] );
+ p_char = vlc_global()->psz_vlcpath = strdup( ppsz_argv[ 0 ] );
/* Remove trailing program name */
for( ; *p_char ; )
CFRelease( all_locales );
}
- 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" );
+ vlc_mutex_init( p_this, &vlc_global()->iconv_lock );
+ vlc_global()->iconv_macosx = vlc_iconv_open( "UTF-8", "UTF-8-MAC" );
}
/*****************************************************************************
*****************************************************************************/
void system_End( libvlc_int_t *p_this )
{
- free( vlc_global( p_this )->psz_vlcpath );
+ free( vlc_global()->psz_vlcpath );
- 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 ( vlc_global()->iconv_macosx != (vlc_iconv_t)-1 )
+ vlc_iconv_close( vlc_global()->iconv_macosx );
+ vlc_mutex_destroy( &vlc_global()->iconv_lock );
}
}
else
{
- libvlc_global_data_t *p_libvlc_global = vlc_global( p_this );
+ libvlc_global_data_t *p_libvlc_global = vlc_global();
p_new->p_libvlc_global = VLC_OBJECT (p_libvlc_global);
p_new->p_libvlc = ( i_type == VLC_OBJECT_LIBVLC ) ? (libvlc_int_t*)p_new
: p_this->p_libvlc;
}
else
{
- libvlc_global_data_t *p_libvlc_global = vlc_global( p_this );
+ libvlc_global_data_t *p_libvlc_global = vlc_global();
int i_index;
vlc_mutex_lock( &structure_lock );
{
int i_max, i_middle;
vlc_object_t **pp_objects;
- libvlc_global_data_t *p_libvlc_global = vlc_global( p_this );
+ libvlc_global_data_t *p_libvlc_global = vlc_global();
vlc_mutex_lock( &structure_lock );
vlc_list_t *p_list;
vlc_object_t **pp_current, **pp_end;
int i_count = 0, i_index = 0;
- libvlc_global_data_t *p_libvlc_global = vlc_global( p_this );
+ libvlc_global_data_t *p_libvlc_global = vlc_global();
vlc_mutex_lock( &structure_lock );
static int DumpCommand( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
- libvlc_global_data_t *p_libvlc_global = vlc_global( p_this );
+ libvlc_global_data_t *p_libvlc_global = vlc_global();
(void)oldval; (void)p_data;
if( *psz_cmd == 'l' )
if( !p_counter )
{
counter_sample_t *p_sample;
- p_counter = stats_CounterCreate( p_obj->p_libvlc_global, VLC_VAR_TIME,
+ p_counter = stats_CounterCreate( p_obj->p_libvlc, VLC_VAR_TIME,
STATS_TIMER );
if( !p_counter )
{
#ifdef HAVE_STDLIB_H
# include <stdlib.h> /* realloc() */
#endif
+#include "libvlc.h"
/*****************************************************************************
* Private types
*/
vlc_mutex_t *var_GetGlobalMutex( const char *name )
{
- vlc_object_t *p_global = vlc_global_object();
+ libvlc_global_data_t *p_global = vlc_global();
vlc_value_t val;
if( var_Create( p_global, name, VLC_VAR_MUTEX ) )
}
#endif
- vlc_global( p_this )->psz_vlcpath = strdup( psz_path );
+ vlc_global()->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 && vlc_global( p_this )->psz_vlcpath )
+ if( p_this && vlc_global() )
{
- free( vlc_global( p_this )->psz_vlcpath );
- vlc_global( p_this )->psz_vlcpath = NULL;
+ free( vlc_global()->psz_vlcpath );
+ vlc_global()->psz_vlcpath = NULL;
}
WSACleanup();
*
* @return a string (always succeeds).
*/
-const char *__config_GetDataDir( const vlc_object_t *p_this )
+const char *config_GetDataDir( void )
{
#if defined (WIN32) || defined (UNDER_CE)
- return vlc_global( p_this )->psz_vlcpath;
+ return vlc_global()->psz_vlcpath;
#elif defined(__APPLE__) || defined (SYS_BEOS)
static char path[PATH_MAX] = "";
if( *path == '\0' )
{
snprintf( path, sizeof( path ), "%s/share",
- vlc_global( p_this )->psz_vlcpath );
+ vlc_global()->psz_vlcpath );
path[sizeof( path ) - 1] = '\0';
}
return path;
#else
- (void)p_this;
return DATA_PATH;
#endif
}
{
module_bank_t *p_bank = NULL;
vlc_value_t lockval;
- libvlc_global_data_t *p_libvlc_global = vlc_global( p_this );
+ libvlc_global_data_t *p_libvlc_global = vlc_global();
var_Create( p_libvlc_global, "libvlc", VLC_VAR_MUTEX );
var_Get( p_libvlc_global, "libvlc", &lockval );
{
module_t * p_next = NULL;
vlc_value_t lockval;
- libvlc_global_data_t *p_libvlc_global = vlc_global( p_this );
+ libvlc_global_data_t *p_libvlc_global = vlc_global();
var_Create( p_libvlc_global, "libvlc", VLC_VAR_MUTEX );
var_Get( p_libvlc_global, "libvlc", &lockval );
static void module_LoadMain( vlc_object_t *p_this )
{
vlc_value_t lockval;
- libvlc_global_data_t *p_libvlc_global = vlc_global( p_this );
+ libvlc_global_data_t *p_libvlc_global = vlc_global();
var_Create( p_libvlc_global, "libvlc", VLC_VAR_MUTEX );
var_Get( p_libvlc_global, "libvlc", &lockval );
void __module_LoadBuiltins( vlc_object_t * p_this )
{
vlc_value_t lockval;
- libvlc_global_data_t *p_libvlc_global = vlc_global( p_this );
+ libvlc_global_data_t *p_libvlc_global = vlc_global();
var_Create( p_libvlc_global, "libvlc", VLC_VAR_MUTEX );
var_Get( p_libvlc_global, "libvlc", &lockval );
{
#ifdef HAVE_DYNAMIC_PLUGINS
vlc_value_t lockval;
- libvlc_global_data_t *p_libvlc_global = vlc_global( p_this );
+ libvlc_global_data_t *p_libvlc_global = vlc_global();
var_Create( p_libvlc_global, "libvlc", VLC_VAR_MUTEX );
var_Get( p_libvlc_global, "libvlc", &lockval );
#endif
{
if( 0>= asprintf( &psz_fullpath, "%s"DIR_SEP"%s",
- vlc_global( p_this )->psz_vlcpath, *ppsz_path) )
+ vlc_global()->psz_vlcpath, *ppsz_path) )
psz_fullpath = NULL;
}
else
if( p_module )
{
- libvlc_global_data_t *p_libvlc_global = vlc_global( p_this );
+ libvlc_global_data_t *p_libvlc_global = vlc_global();
/* Everything worked fine !
* The module is ready to be added to the list. */
/* msg_Dbg( p_this, "builtin \"%s\", %s",
p_module->psz_object_name, p_module->psz_longname ); */
- vlc_object_attach( p_module, vlc_global( p_this )->p_module_bank );
+ vlc_object_attach( p_module, vlc_global()->p_module_bank );
return 0;
}
int i_cache;
module_cache_t **pp_cache = 0;
int32_t i_file_size, i_marker;
- libvlc_global_data_t *p_libvlc_global = vlc_global( p_this );
+ libvlc_global_data_t *p_libvlc_global = vlc_global();
psz_homedir = p_this->p_libvlc->psz_homedir;
if( !psz_homedir )
int i, j, i_cache;
module_cache_t **pp_cache;
int32_t i_file_size = 0;
- libvlc_global_data_t *p_libvlc_global = vlc_global( p_this );
+ libvlc_global_data_t *p_libvlc_global = vlc_global();
psz_homedir = p_this->p_libvlc->psz_homedir;
if( !psz_homedir )
{
module_cache_t **pp_cache;
int i_cache, i;
- libvlc_global_data_t *p_libvlc_global = vlc_global( p_this );
+ libvlc_global_data_t *p_libvlc_global = vlc_global();
pp_cache = p_libvlc_global->p_module_bank->pp_loaded_cache;
i_cache = p_libvlc_global->p_module_bank->i_loaded_cache;
}
/* to be sure to avoid multiple creation */
- var_Create( p_this->p_libvlc_global, "httpd_mutex", VLC_VAR_MUTEX );
- var_Get( p_this->p_libvlc_global, "httpd_mutex", &lockval );
+ var_Create( p_this->p_libvlc, "httpd_mutex", VLC_VAR_MUTEX );
+ var_Get( p_this->p_libvlc, "httpd_mutex", &lockval );
vlc_mutex_lock( lockval.p_address );
if( !(httpd = vlc_object_find( p_this, VLC_OBJECT_HTTPD, FIND_ANYWHERE )) )
vlc_value_t lockval;
int i;
- var_Get( httpd->p_libvlc_global, "httpd_mutex", &lockval );
+ var_Get( httpd->p_libvlc, "httpd_mutex", &lockval );
vlc_mutex_lock( lockval.p_address );
host->i_ref--;