| [Home] [Tutorials] |
|
|
| Previous | Contents | Next |
typedef struct _sw_plugin sw_plugin; struct _sw_plugin { /* plugin_init () returns a list of procs */ GList * (*plugin_init) (void); /* plugin_cleanup() frees the plugin's private data structures */ void (*plugin_cleanup) (void); };
An sw_plugin structure contains two members, a plugin_init function that takes no arguments and returns a list of procs, and a void plugin_cleanup function.
The initialisation is performed through a function call and can instantiate an indeterminate number of procs. This allows the creation of plugins which may not necessarily know when built how many procs they will create; for example, the LADSPA meta plugin dynamically creates a proc corresponding to every LADSPA function it can find in all the LADSPA plugins it can find.
In the usual case where the procs are known at build time (ie. they
consist of functions within the plugin library) the plugin_init
function can simply construct a GList out of these known procs, each
of which can be statically defined. This list is constructed using
g_list_append(); see
| Previous | Contents | Next |
|