VLC  2.1.0-git
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
modules.h File Reference

Go to the source code of this file.

Data Structures

struct  module_cache_t
struct  module_t
 Internal module descriptor. More...

Macros

#define MODULE_SHORTCUT_MAX   20
#define module_LoadPlugins(a)   module_LoadPlugins(VLC_OBJECT(a))

Typedefs

typedef struct module_cache_t module_cache_t
typedef void * module_handle_t
 The module handle type.
typedef int(* vlc_plugin_cb )(int(*)(void *, void *, int,...), void *)
 Plugin entry point prototype.

Functions

int vlc_entry__main (int(*)(void *, void *, int,...), void *)
 Main module.
module_tvlc_plugin_describe (vlc_plugin_cb)
 Runs a plug-in descriptor.
module_tvlc_module_create (module_t *)
void vlc_module_destroy (module_t *)
 Destroys a plug-in.
void module_InitBank (void)
 Init bank.
size_t module_LoadPlugins (vlc_object_t *)
 Loads module descriptions for all available plugins.
void module_EndBank (bool)
 Unloads all unused plugin modules and empties the module bank in case of success.
int module_Map (vlc_object_t *, module_t *)
 Makes sure the module is loaded in memory.
ssize_t module_list_cap (module_t ***, const char *)
int vlc_bindtextdomain (const char *)
int module_Load (vlc_object_t *, const char *, module_handle_t *, bool)
 Load a dynamically linked library using a system dependent method.
void * module_Lookup (module_handle_t, const char *)
 Looks up a symbol from a dynamically loaded library.
void module_Unload (module_handle_t)
 CloseModule: unload a dynamic library.
void CacheMerge (vlc_object_t *, module_t *, module_t *)
void CacheDelete (vlc_object_t *, const char *)
size_t CacheLoad (vlc_object_t *, const char *, module_cache_t **)
int CacheAdd (module_cache_t **, size_t *, const char *, const struct stat *, module_t *)
void CacheSave (vlc_object_t *, const char *, module_cache_t *, size_t)
module_tCacheFind (module_cache_t *, size_t, const char *, const struct stat *)

Macro Definition Documentation

#define module_LoadPlugins (   a)    module_LoadPlugins(VLC_OBJECT(a))

Referenced by libvlc_InternalInit().

#define MODULE_SHORTCUT_MAX   20

Referenced by vlc_plugin_setter().

Typedef Documentation

typedef void* module_handle_t

The module handle type.

typedef int(* vlc_plugin_cb)(int(*)(void *, void *, int,...), void *)

Plugin entry point prototype.

Function Documentation

int CacheAdd ( module_cache_t **  ,
size_t *  ,
const char *  ,
const struct stat *  ,
module_t  
)
void CacheDelete ( vlc_object_t ,
const char *   
)
module_t* CacheFind ( module_cache_t ,
size_t  ,
const char *  ,
const struct stat *   
)
size_t CacheLoad ( vlc_object_t ,
const char *  ,
module_cache_t **   
)
void CacheMerge ( vlc_object_t ,
module_t ,
module_t  
)

Referenced by module_Map().

void CacheSave ( vlc_object_t ,
const char *  ,
module_cache_t ,
size_t   
)
void module_EndBank ( bool  )
void module_InitBank ( void  )

Init bank.

Creates a module bank structure which will be filled later on with all the modules found.

References config_SortConfig(), likely, module_InitStatic(), module_StoreBank(), modules, vlc_entry__main(), and vlc_mutex_lock().

Referenced by libvlc_InternalInit().

ssize_t module_list_cap ( module_t ***  ,
const char *   
)
int module_Load ( vlc_object_t p_this,
const char *  path,
module_handle_t p_handle,
bool  lazy 
)

Load a dynamically linked library using a system dependent method.

Parameters
p_thisvlc object
psz_filelibrary file
p_handlethe module handle returned
Returns
0 on success as well as the module handle.
Parameters
p_thisvlc object
pathlibrary file
p_handlethe module handle returned
Returns
0 on success as well as the module handle.

References GetWindowsError(), LocaleFree, msg_Warn, and ToLocale.

size_t module_LoadPlugins ( vlc_object_t obj)

Loads module descriptions for all available plugins.

Fills the module bank structure with the plugin modules.

Parameters
p_thisvlc object structure
Returns
total number of modules in bank after loading all plug-ins

References config_SortConfig(), config_UnsortConfig(), count, list, module_InitStaticModules(), module_list_free(), module_list_get(), modules, msg_Dbg, and vlc_mutex_unlock().

void* module_Lookup ( module_handle_t  handle,
const char *  psz_function 
)

Looks up a symbol from a dynamically loaded library.

This function queries a loaded library for a symbol specified in a string, and returns a pointer to it. We don't check for dlerror() or similar functions, since we want a non-NULL symbol anyway.

Parameters
handlehandle to the module
psz_functionfunction name
Returns
NULL on error, or the address of the symbol
int module_Map ( vlc_object_t obj,
module_t module 
)

Makes sure the module is loaded in memory.

Returns
0 on success, -1 on failure

References module_t::b_loaded, CacheMerge(), msg_Err, module_t::parent, module_t::psz_filename, and vlc_module_destroy().

Referenced by module_load().

void module_Unload ( module_handle_t  handle)

CloseModule: unload a dynamic library.

This function unloads a previously opened dynamically linked library using a system dependent method. No return value is taken in consideration, since some libraries sometimes refuse to close properly.

Parameters
handlehandle of the library
Returns
nothing

References RUNNING_ON_VALGRIND.

Referenced by module_EndBank().

int vlc_bindtextdomain ( const char *  )
int vlc_entry__main ( int(*)(void *, void *, int,...)  ,
void *   
)

Main module.

Referenced by module_InitBank().

module_t* vlc_module_create ( module_t )
void vlc_module_destroy ( module_t module)
module_t* vlc_plugin_describe ( vlc_plugin_cb  entry)

Runs a plug-in descriptor.

This loads the plug-in meta-data in memory.

References vlc_module_destroy(), and vlc_plugin_setter().

Referenced by module_InitStatic().