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

@ -111,16 +111,10 @@ extern "C"
MODULE_API_QUERY_CLASSIFIER,
MODULE_IN_DEVELOPMENT,
QUERY_CLASSIFIER_VERSION,
const_cast<char*>("Dummy Query Classifier"),
"Dummy Query Classifier",
"V1.0.0"
};
static char version_string[] = "V1.0.0";
char* version()
{
return const_cast<char*>(version_string);
}
static QUERY_CLASSIFIER qc =
{
qc_init,

View File

@ -2557,8 +2557,6 @@ void qc_thread_end(void)
extern "C"
{
static char version_string[] = "V1.0.0";
static QUERY_CLASSIFIER qc =
{
qc_init,
@ -2589,14 +2587,10 @@ MODULE_INFO info =
MODULE_API_QUERY_CLASSIFIER,
MODULE_IN_DEVELOPMENT,
QUERY_CLASSIFIER_VERSION,
const_cast<char*>("Query classifier based upon MySQL Embedded"),
"Query classifier based upon MySQL Embedded",
"V1.0.0"
};
char* version()
{
return const_cast<char*>(version_string);
}
void ModuleInit()
{
}

View File

@ -3172,8 +3172,6 @@ void qc_sqlite_get_field_info(GWBUF* query, const QC_FIELD_INFO** infos, size_t*
* EXPORTS
*/
static char version_string[] = "V1.0.0";
static QUERY_CLASSIFIER qc =
{
qc_sqlite_init,
@ -3202,13 +3200,9 @@ MODULE_INFO info =
MODULE_BETA_RELEASE,
QUERY_CLASSIFIER_VERSION,
"Query classifier using sqlite.",
"V1.0.0"
};
char* version()
{
return version_string;
}
void ModuleInit()
{
}