Migrated ha plugin to INIT/METHOD macros

This commit is contained in:
Martin Willi
2010-07-26 10:15:17 +02:00
parent c74c4c2a20
commit 00c1bd0606
10 changed files with 198 additions and 253 deletions
+5 -9
View File
@@ -78,10 +78,8 @@ struct private_ha_plugin_t {
ha_ctl_t *ctl;
};
/**
* Implementation of plugin_t.destroy
*/
static void destroy(private_ha_plugin_t *this)
METHOD(plugin_t, destroy, void,
private_ha_plugin_t *this)
{
DESTROY_IF(this->ctl);
charon->bus->remove_listener(charon->bus, &this->segments->listener);
@@ -127,11 +125,9 @@ plugin_t *ha_plugin_create()
return NULL;
}
this = malloc_thing(private_ha_plugin_t);
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
this->tunnel = NULL;
this->ctl = NULL;
INIT(this,
.public.plugin.destroy = _destroy,
);
if (secret)
{