PluginSetupConfig config;
PluginStartup startup;
PluginShutdown shutdown;
- PluginCreate create;
- PluginDestroy destroy;
} Plugin;
static gpointer load_sym(GModule *module, char *name, char *symbol,
FALSE);
p->shutdown = (PluginShutdown)load_sym(p->module, name, "plugin_shutdown",
FALSE);
- p->create = (PluginCreate)load_sym(p->module, name, "plugin_create", TRUE);
- p->destroy = (PluginDestroy)load_sym(p->module, name, "plugin_destroy",
- TRUE);
if (p->config == NULL || p->startup == NULL || p->shutdown == NULL) {
g_module_close(p->module);
if (io == NULL) {
/* load the default plugins */
plugin_open("placement", i);
- plugin_open("resistance", i);
/* XXX rm me when the parser loads me magically */
plugin_open("client_menu", i);
+ plugin_open("client_list_menu", i);
} else {
/* load the plugins in the rc file */
while (g_io_channel_read_line(io, &name, NULL, NULL, &err) ==
g_io_channel_unref(io);
}
}
-
-void *plugin_create(char *name, void *data)
-{
- Plugin *p = (Plugin *)g_datalist_get_data(&plugins, name);
-
- if (p == NULL) {
- g_warning("Unable to find plugin for create: %s", name);
- return NULL;
- }
-
- if (p->create == NULL || p->destroy == NULL) {
- g_critical("Unsupported create/destroy: %s", name);
- return NULL;
- }
-
- return p->create(data);
-}
-
-void plugin_destroy(char *name, void *data)
-{
- Plugin *p = (Plugin *)g_datalist_get_data(&plugins, name);
-
- if (p == NULL) {
- g_critical("Unable to find plugin for destroy: %s", name);
- /* really shouldn't happen, but attempt to free something anyway? */
- g_free(data);
- return;
- }
-
- if (p->destroy == NULL || p->create == NULL) {
- g_critical("Unsupported create/destroy: %s", name);
- /* really, really shouldn't happen, but attempt to free anyway? */
- g_free(data);
- return;
- }
-
- p->destroy(data);
-}