Simplified plugin initialization by using a macro.

This commit is contained in:
Jan Vidar Krey
2010-08-30 11:54:34 +02:00
parent ff8b8f5175
commit 21c22288a2
5 changed files with 17 additions and 30 deletions

View File

@@ -6,22 +6,13 @@
int plugin_register(struct plugin_handle* plugin, const char* config)
{
plugin->name = "Example plugin";
plugin->version = "1.0";
plugin->description = "A simple example plugin";
plugin->ptr = NULL;
plugin->plugin_api_version = PLUGIN_API_VERSION;
plugin->plugin_funcs_size = sizeof(struct plugin_funcs);
memset(&plugin->funcs, 0, sizeof(struct plugin_funcs));
puts("plugin register");
PLUGIN_INITIALIZE(plugin, "Example plugin", "1.0", "A simple example plugin");
return 0;
}
int plugin_unregister(struct plugin_handle* plugin)
{
/* No need to do anything! */
puts("plugin unregister");
return 0;
}