Name
bonobo-storage-plugin -- The interface for pluggable bonobo storage modules
Description
This header is only needed by BonoboStorage and BonoboStream
implementation plugins. Essentialy these are shared library
modules that implement only 1 public function
init_storage_plugin. It is unlikely that
most Bonobo users will wish to implement a storage or stream
plugin.
The init function fills out a StoragePlugin structure,
most importantly it fills in a version string that defines
the plugin ABI version built against, this is defined by
the version of bonobo-storage-plugin.h you build against.
Example 1. Sample Storage plugin init function
gint
init_storage_plugin (StoragePlugin *plugin)
{
g_return_val_if_fail (plugin != NULL, -1);
plugin->name = "fs";
plugin->description = "Native Filesystem Driver";
plugin->version = BONOBO_STORAGE_VERSION;
plugin->storage_open = bonobo_storage_fs_open;
plugin->stream_open = bonobo_stream_fs_open;
return 0;
}
|
The callbacks for opening streams and storages are registered
and these are used by the
bonobo_storage_open
and
bonobo_stream_open functions when your
plugin name is passed to these.
Details
BONOBO_STORAGE_VERSION
#define BONOBO_STORAGE_VERSION "1.0" |
struct StoragePlugin
struct StoragePlugin {
/* public, read only */
gchar *filename;
gchar *name; /* efs, file */
gchar *description;
gchar *version;
BonoboStorageOpenFn storage_open;
BonoboStreamOpenFn stream_open;
/* private */
GModule *handle;
}; |
BonoboStorageOpenFn ()
BonoboStorage* (*BonoboStorageOpenFn) (const char *path,
gint flags,
gint mode,
CORBA_Environment *ev); |
BonoboStreamOpenFn ()
BonoboStream* (*BonoboStreamOpenFn) (const char *path,
gint flags,
gint mode,
CORBA_Environment *ev); |
storage_plugin_list
extern GList *storage_plugin_list; |
bonobo_storage_load_plugins ()
void bonobo_storage_load_plugins (void); |
bonobo_storage_plugin_find ()