Migrated remaining plugin_t implementations to INIT/METHOD macros

This commit is contained in:
Martin Willi
2011-04-15 10:07:12 +02:00
parent 2b36342551
commit 6e2791715b
18 changed files with 188 additions and 133 deletions
@@ -42,10 +42,8 @@ struct private_eap_simaka_reauth_t {
eap_simaka_reauth_provider_t *provider;
};
/**
* Implementation of eap_simaka_reauth_t.destroy.
*/
static void destroy(private_eap_simaka_reauth_t *this)
METHOD(plugin_t, destroy, void,
private_eap_simaka_reauth_t *this)
{
charon->sim->remove_card(charon->sim, &this->card->card);
charon->sim->remove_provider(charon->sim, &this->provider->provider);
@@ -59,11 +57,17 @@ static void destroy(private_eap_simaka_reauth_t *this)
*/
plugin_t *eap_simaka_reauth_plugin_create()
{
private_eap_simaka_reauth_t *this = malloc_thing(private_eap_simaka_reauth_t);
private_eap_simaka_reauth_t *this;
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
INIT(this,
.public = {
.plugin = {
.destroy = _destroy,
},
},
.provider = eap_simaka_reauth_provider_create(),
);
this->provider = eap_simaka_reauth_provider_create();
if (!this->provider)
{
free(this);