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

References ILOG_DEBUG, and ILOG_ERR.

Referenced by icd_plugin_load_all(), icd_plugin_load_list(), and icd_srv_provider_load_modules().

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

References icd_plugin_load(), and ILOG_WARN.

Referenced by icd_network_api_load_modules().

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

References icd_plugin_load(), ILOG_ERR, and ILOG_WARN.

Referenced by icd_policy_api_load_modules().

void icd_plugin_unload_module ( void *  handle  ) 

Unload a module.

Parameters:
handle module handle given to module initialization callback

Referenced by icd_network_api_init_cb(), icd_network_api_unload_modules(), icd_policy_api_unload_modules(), icd_srv_provider_init(), and icd_srv_provider_unload_modules().


Generated on Thu Mar 11 09:04:50 2010 for ICd2 by  doxygen 1.5.6