index 446c8672ff890edd7a3180047ba7897677410b03..5928560931932836a4dda90ebae881f38a6365a0 100644 (file)
* missing prototype warnings/errors for the plugin init
* function */
#define SDB_PLUGIN_MAGIC \
- int sdb_module_init(sdb_plugin_info_t *info);
+ int sdb_module_init(sdb_plugin_info_t *info)
typedef struct {
_Bool do_loop;
/*
* sdb_plugin_load:
* Load (any type of) plugin by loading the shared object file and calling the
- * sdb_module_init function.
+ * sdb_module_init function. If specified, 'plugin_ctx' fine-tunes the
+ * behavior of the plugin.
*/
int
-sdb_plugin_load(const char *name);
+sdb_plugin_load(const char *name, const sdb_plugin_ctx_t *plugin_ctx);
/*
* sdb_plugin_set_info:
* plugin has been called. It may be used to pass around various information
* between the different component of the library without having each and
* every plugin care about it.
+ *
+ * If non-NULL, sdb_plugin_set_ctx stores the previous context in the location
+ * pointed to be 'old'.
*/
sdb_plugin_ctx_t
sdb_plugin_get_ctx(void);
-sdb_plugin_ctx_t
-sdb_plugin_set_ctx(sdb_plugin_ctx_t ctx);
+int
+sdb_plugin_set_ctx(sdb_plugin_ctx_t ctx, sdb_plugin_ctx_t *old);
/*
* sdb_plugin_configure:
/*
* sdb_plugin_init_all:
* Initialize all plugins using their registered "init" function.
+ *
+ * Returns:
+ * The number of failed initializations.
*/
int
sdb_plugin_init_all(void);