Add features support to mysql plugin
This commit is contained in:
@@ -38,11 +38,20 @@ METHOD(plugin_t, get_name, char*,
|
|||||||
return "mysql";
|
return "mysql";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
METHOD(plugin_t, get_features, int,
|
||||||
|
private_mysql_plugin_t *this, plugin_feature_t *features[])
|
||||||
|
{
|
||||||
|
static plugin_feature_t f[] = {
|
||||||
|
PLUGIN_REGISTER(DATABASE, mysql_database_create),
|
||||||
|
PLUGIN_PROVIDE(DATABASE, DB_MYSQL),
|
||||||
|
};
|
||||||
|
*features = f;
|
||||||
|
return countof(f);
|
||||||
|
}
|
||||||
|
|
||||||
METHOD(plugin_t, destroy, void,
|
METHOD(plugin_t, destroy, void,
|
||||||
private_mysql_plugin_t *this)
|
private_mysql_plugin_t *this)
|
||||||
{
|
{
|
||||||
lib->db->remove_database(lib->db,
|
|
||||||
(database_constructor_t)mysql_database_create);
|
|
||||||
mysql_database_deinit();
|
mysql_database_deinit();
|
||||||
free(this);
|
free(this);
|
||||||
}
|
}
|
||||||
@@ -64,15 +73,12 @@ plugin_t *mysql_plugin_create()
|
|||||||
.public = {
|
.public = {
|
||||||
.plugin = {
|
.plugin = {
|
||||||
.get_name = _get_name,
|
.get_name = _get_name,
|
||||||
.reload = (void*)return_false,
|
.get_features = _get_features,
|
||||||
.destroy = _destroy,
|
.destroy = _destroy,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
lib->db->add_database(lib->db,
|
|
||||||
(database_constructor_t)mysql_database_create);
|
|
||||||
|
|
||||||
return &this->public.plugin;
|
return &this->public.plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user