diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-12-04 20:15:59 +0100 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-12-04 20:15:59 +0100 |
commit | 1e84aa74aaaf1f32f97661febe86c8bfab72a7fb (patch) | |
tree | d9cfe65bb3f4dd76245e0122ca9f030e4f8ed721 /src/libstrongswan/plugins/ldap/ldap_plugin.c | |
parent | 4df49844d951135b22341474c52bdf6f406a6262 (diff) | |
download | strongswan-1e84aa74aaaf1f32f97661febe86c8bfab72a7fb.tar.bz2 strongswan-1e84aa74aaaf1f32f97661febe86c8bfab72a7fb.tar.xz |
Migrated ldap plugin to INIT/METHOD macros
Diffstat (limited to 'src/libstrongswan/plugins/ldap/ldap_plugin.c')
-rw-r--r-- | src/libstrongswan/plugins/ldap/ldap_plugin.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/libstrongswan/plugins/ldap/ldap_plugin.c b/src/libstrongswan/plugins/ldap/ldap_plugin.c index 372ac9f93..3682ddd1f 100644 --- a/src/libstrongswan/plugins/ldap/ldap_plugin.c +++ b/src/libstrongswan/plugins/ldap/ldap_plugin.c @@ -31,10 +31,8 @@ struct private_ldap_plugin_t { ldap_plugin_t public; }; -/** - * Implementation of ldap_plugin_t.destroy - */ -static void destroy(private_ldap_plugin_t *this) +METHOD(plugin_t, destroy, void, + private_ldap_plugin_t *this) { lib->fetcher->remove_fetcher(lib->fetcher, (fetcher_constructor_t)ldap_fetcher_create); @@ -46,9 +44,15 @@ static void destroy(private_ldap_plugin_t *this) */ plugin_t *ldap_plugin_create() { - private_ldap_plugin_t *this = malloc_thing(private_ldap_plugin_t); + private_ldap_plugin_t *this; - this->public.plugin.destroy = (void(*)(plugin_t*))destroy; + INIT(this, + .public = { + .plugin = { + .destroy = _destroy, + }, + }, + ); lib->fetcher->add_fetcher(lib->fetcher, (fetcher_constructor_t)ldap_fetcher_create, "ldap://"); |