diff options
author | waker <wakeroid@gmail.com> | 2011-02-21 21:45:12 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-02-21 21:45:12 +0100 |
commit | 10dbebc87c1292877d00eaef8a5ddcc51aac8ff1 (patch) | |
tree | 0fc57d9fb67922e6365ec1ea231084f5f006186e /plugins.c | |
parent | b87dcbaadf6064d66c7c34f8c1c9a0c1e9bf5622 (diff) |
added new plugin.connect method to base plugin interface, which does the opposite of connect
Diffstat (limited to 'plugins.c')
-rw-r--r-- | plugins.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -887,6 +887,9 @@ plug_connect_all (void) { if (plug->plugin->connect () < 0) { fprintf (stderr, "plugin %s failed to connect to dependencies, deactivated.\n", plug->plugin->name); + if (plug->plugin->disconnect) { + plug->plugin->disconnect (); + } if (plug->plugin->stop) { plug->plugin->stop (); } @@ -914,6 +917,22 @@ plug_connect_all (void) { } void +plug_disconnect_all (void) { + trace ("plug_disconnect_all\n"); + plugin_t *plug; + plugin_t *prev = NULL; + for (plug = plugins; plug;) { + if (plug->plugin->disconnect) { + if (plug->plugin->disconnect () < 0) { + trace ("plugin %s failed to disconnect\n", plug->plugin->name); + } + } + prev = plug; + plug = plug->next; + } +} + +void plug_unload_all (void) { trace ("plug_unload_all\n"); plugin_t *p; |