aboutsummaryrefslogtreecommitdiffstats
path: root/src/libhydra/plugins
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2010-11-25 22:52:32 +0100
committerAndreas Steffen <andreas.steffen@strongswan.org>2010-11-25 22:52:32 +0100
commita76ad383651e7de57b872ad2261b07a8bfbb1da2 (patch)
tree98e34dc9ae13ff53ff1415392bfd9f336f805bb5 /src/libhydra/plugins
parentbd801f1b970d3577cebba6cb831d77308222369d (diff)
downloadstrongswan-a76ad383651e7de57b872ad2261b07a8bfbb1da2.tar.bz2
strongswan-a76ad383651e7de57b872ad2261b07a8bfbb1da2.tar.xz
Migrated attr_plugin_t to INIT/METHOD macros
Diffstat (limited to 'src/libhydra/plugins')
-rw-r--r--src/libhydra/plugins/attr/attr_plugin.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/libhydra/plugins/attr/attr_plugin.c b/src/libhydra/plugins/attr/attr_plugin.c
index 24c00bb44..a1d182b55 100644
--- a/src/libhydra/plugins/attr/attr_plugin.c
+++ b/src/libhydra/plugins/attr/attr_plugin.c
@@ -36,10 +36,8 @@ struct private_attr_plugin_t {
attr_provider_t *provider;
};
-/**
- * Implementation of plugin_t.destroy
- */
-static void destroy(private_attr_plugin_t *this)
+METHOD(plugin_t, destroy, void,
+ private_attr_plugin_t *this)
{
hydra->attributes->remove_provider(hydra->attributes, &this->provider->provider);
this->provider->destroy(this->provider);
@@ -53,9 +51,14 @@ plugin_t *attr_plugin_create()
{
private_attr_plugin_t *this = malloc_thing(private_attr_plugin_t);
- this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
-
- this->provider = attr_provider_create();
+ INIT(this,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
+ .provider = attr_provider_create()
+ );
hydra->attributes->add_provider(hydra->attributes, &this->provider->provider);
return &this->public.plugin;