Migrated ldap plugin to INIT/METHOD macros

This commit is contained in:
Andreas Steffen
2010-12-04 20:15:59 +01:00
parent 4df49844d9
commit 1e84aa74aa
2 changed files with 27 additions and 22 deletions
+10 -6
View File
@@ -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://");