Bonobo API Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
#define BONOBO_STORAGE_VERSION struct StoragePlugin; gint (*StoragePluginInitFn) (StoragePlugin *plugin); BonoboStorage* (*BonoboStorageOpenFn) (const char *path, gint flags, gint mode, CORBA_Environment *ev); BonoboStream* (*BonoboStreamOpenFn) (const char *path, gint flags, gint mode, CORBA_Environment *ev); extern GList *storage_plugin_list; gint init_storage_plugin (StoragePlugin *plugin); void bonobo_storage_load_plugins (void); StoragePlugin* bonobo_storage_plugin_find (const gchar *name); |
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; } |
struct StoragePlugin { /* public, read only */ gchar *filename; gchar *name; /* efs, file */ gchar *description; gchar *version; BonoboStorageOpenFn storage_open; BonoboStreamOpenFn stream_open; /* private */ GModule *handle; }; |
BonoboStorage* (*BonoboStorageOpenFn) (const char *path, gint flags, gint mode, CORBA_Environment *ev); |
BonoboStream* (*BonoboStreamOpenFn) (const char *path, gint flags, gint mode, CORBA_Environment *ev); |