Migrated attr_plugin_t to INIT/METHOD macros
This commit is contained in:
@@ -36,10 +36,8 @@ struct private_attr_plugin_t {
|
|||||||
attr_provider_t *provider;
|
attr_provider_t *provider;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
METHOD(plugin_t, destroy, void,
|
||||||
* Implementation of plugin_t.destroy
|
private_attr_plugin_t *this)
|
||||||
*/
|
|
||||||
static void destroy(private_attr_plugin_t *this)
|
|
||||||
{
|
{
|
||||||
hydra->attributes->remove_provider(hydra->attributes, &this->provider->provider);
|
hydra->attributes->remove_provider(hydra->attributes, &this->provider->provider);
|
||||||
this->provider->destroy(this->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);
|
private_attr_plugin_t *this = malloc_thing(private_attr_plugin_t);
|
||||||
|
|
||||||
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
|
INIT(this,
|
||||||
|
.public = {
|
||||||
this->provider = attr_provider_create();
|
.plugin = {
|
||||||
|
.destroy = _destroy,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
.provider = attr_provider_create()
|
||||||
|
);
|
||||||
hydra->attributes->add_provider(hydra->attributes, &this->provider->provider);
|
hydra->attributes->add_provider(hydra->attributes, &this->provider->provider);
|
||||||
|
|
||||||
return &this->public.plugin;
|
return &this->public.plugin;
|
||||||
|
|||||||
Reference in New Issue
Block a user