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_pseudonym_t {
eap_simaka_pseudonym_provider_t *provider;
};
/**
* Implementation of eap_simaka_pseudonym_t.destroy.
*/
static void destroy(private_eap_simaka_pseudonym_t *this)
METHOD(plugin_t, destroy, void,
private_eap_simaka_pseudonym_t *this)
{
charon->sim->remove_card(charon->sim, &this->card->card);
charon->sim->remove_provider(charon->sim, &this->provider->provider);
@@ -61,11 +59,15 @@ plugin_t *eap_simaka_pseudonym_plugin_create()
{
private_eap_simaka_pseudonym_t *this;
this = malloc_thing(private_eap_simaka_pseudonym_t);
INIT(this,
.public = {
.plugin = {
.destroy = _destroy,
},
},
.provider = eap_simaka_pseudonym_provider_create(),
);
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
this->provider = eap_simaka_pseudonym_provider_create();
if (!this->provider)
{
free(this);