| [Insert name here] Reference Manual |
|---|
plugin_generic_t* plugin_search_by_name (const char *name); int plugin_load_from_dir (const char *dirname, int argc, char **argv, int (*subscribe) (plugin_container_t *p), void (*unsubscribe) (plugin_container_t *pc)); int plugin_add (plugin_container_t *pc, struct list_head *h, const char *infos); void plugin_del (plugin_container_t *pc); void plugin_print_stats (plugin_container_t *pc); void plugins_print_stats (void); void plugins_print_opts (const char *dirname); int plugin_get_highest_id (void); #define plugin_compute_stats (func) #define plugin_run (pc, type, member, arg...) #define plugin_run_with_return_value (pc, type, member, ret, arg...)
plugin_generic_t* plugin_search_by_name (const char *name);
Search the whole plugin list (subscribed and unsubscribed), for a plugin with name name.
| name : | Name of the plugin to search. |
| Returns : | the plugin on success, or NULL if the plugin doesn't exist. |
int plugin_load_from_dir (const char *dirname,
int argc,
char **argv,
int (*subscribe) (plugin_container_t *p),
void (*unsubscribe) (plugin_container_t *pc));Load all plugins in directory 'dirname'. Each plugin have a subscribe and unsubscribe callback associated with it.
The plugins are loaded, but not active, until someone call plugin_subscribe() on one of the plugin. Which'll call subscribe in order to register the it.
argc and argv are passed to the plugin at initialization time for option handling.
| dirname : | The directory to load the plugin from. |
| argc : | Argument count for the plugin. |
| argv : | Argument vector for the plugin. |
| subscribe : | Pointer to a callback function for plugin subscribtion. |
| unsubscribe : | Pointer to a callback function for plugin un-subscribtion. |
| Returns : | The number of loaded plugins on success, -1 on error. |
int plugin_add (plugin_container_t *pc,
struct list_head *h,
const char *infos);This function add the plugin associated with pc to the linked list specified by h. If this container is already used somewhere else, a copy is made, because container doesn't share information).
| pc : | Pointer to a plugin container |
| h : | Pointer to a linked list |
| infos : | Specific informations to associate with the container. |
| Returns : | 0 on success or -1 if an error occured. |
void plugin_del (plugin_container_t *pc);
Destroy pc.
| pc : | Pointer to a plugin container. |
void plugin_print_stats (plugin_container_t *pc);
Print plugin stats for *this* plugin (associated with the container).
| pc : | The plugin container to print stats from |
| <<< prelude-io | variable >>> |