Support functions for loadable plugins
[ICd internal functions]


Typedefs

typedef gboolean(*) icd_plugin_load_cb_fn (const gchar *module_name, void *handle, gpointer init_function, gpointer cb_data)

Functions

gboolean icd_plugin_load (const char *filename, const char *name, const char *init_name, icd_plugin_load_cb_fn cb, gpointer cb_data)
gboolean icd_plugin_load_all (const char *plugindir, const char *prefix, const char *init_name, icd_plugin_load_cb_fn cb, gpointer cb_data)
gboolean icd_plugin_load_list (const char *plugindir, GSList *plugin_list, const char *init_name, icd_plugin_load_cb_fn cb, gpointer cb_data)
void icd_plugin_unload_module (void *handle)

Typedef Documentation

typedef gboolean(*) icd_plugin_load_cb_fn(const gchar *module_name, void *handle, gpointer init_function, gpointer cb_data)

Plugin initialization callback function

Parameters:
module_name the moduel filename
handle module handle to pass unloading function
init_function a pointer to the plugin init function
cb_data user data passed to icd_plugin_load_all
Returns:
TRUE on success, FALSE on failure whereby the module is unloaded


Function Documentation

gboolean icd_plugin_load ( const char *  filename,
const char *  name,
const char *  init_name,
icd_plugin_load_cb_fn  cb,
gpointer  cb_data 
)

Load the plugin shared object file

Parameters:
filename full pathname to the shared object file
name name of the module
init_name the name of the plugin initialization function
cb function called when the plugin has been loaded
cb_data data to pass to the callback
Returns:
TRUE on success, FALSE on failure

gboolean icd_plugin_load_all ( const char *  plugindir,
const char *  prefix,
const char *  init_name,
icd_plugin_load_cb_fn  cb,
gpointer  cb_data 
)

Load all plugins in specified directory. Enumerates all files in the directory and tries to load all shared objects in the there.

Parameters:
plugindir path for the plugins
prefix prefix for the plugins to load
init_name the name of the plugin initialization function
cb function called when the plugin has been loaded
cb_data data to pass to the callback
Returns:
TRUE if loading of at least one plugin loading succeeded, FALSE if no modules were loaded

gboolean icd_plugin_load_list ( const char *  plugindir,
GSList *  plugin_list,
const char *  init_name,
icd_plugin_load_cb_fn  cb,
gpointer  cb_data 
)

Load all plugins from a specified list of file names.

Parameters:
plugindir path for the plugins
plugin_list list of plugin file names
init_name the name of the plugin initialization function
cb function called when the plugin has been loaded
cb_data data to pass to the callback
Returns:
TRUE if loading of at least one plugin loading succeeded, FALSE if no modules were loaded

void icd_plugin_unload_module ( void *  handle  ) 

Unload a module.

Parameters:
handle module handle given to module initialization callback


Generated on Tue Feb 24 16:21:36 2009 for ICd2 by  doxygen 1.5.1