Move version entry point into MODULE_INFO

The MODULE_INFO can easily hold the version information of the
module. This removes the need for a explicit version entry point.
This commit is contained in:
Markus Mäkelä
2017-01-03 11:48:55 +02:00
parent d3907882d6
commit 7df29aa1ec
49 changed files with 127 additions and 700 deletions

View File

@ -41,16 +41,15 @@
#include <maxscale/log_manager.h>
MODULE_INFO info =
MODULE_INFO info =
{
MODULE_API_ROUTER,
MODULE_GA,
ROUTER_VERSION,
"The admin user interface"
"The admin user interface",
"V1.0.0"
};
static char *version_str = "V1.0.0";
/* The router entry points */
static ROUTER *createInstance(SERVICE *service, char **options);
static void *newSession(ROUTER *instance, SESSION *session);
@ -80,17 +79,6 @@ extern int execute_cmd(CLI_SESSION *cli);
static SPINLOCK instlock;
static CLI_INSTANCE *instances;
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.
@ -98,7 +86,7 @@ version()
void
ModuleInit()
{
MXS_NOTICE("Initialise CLI router module %s.", version_str);
MXS_NOTICE("Initialise CLI router module");
spinlock_init(&instlock);
instances = NULL;
}