Move module object inside MODULE_INFO
This allows modules to only expose one entry point with a consistent signature. In the future, this could be used to implement declarations of module parameters.
This commit is contained in:
@ -97,44 +97,39 @@ void qc_thread_end(void)
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
/* @see function load_module in load_utils.c for explanation of the following
|
||||
* lint directives.
|
||||
*/
|
||||
/*lint -e14 */
|
||||
MODULE_INFO info =
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
MODULE_API_QUERY_CLASSIFIER,
|
||||
MODULE_IN_DEVELOPMENT,
|
||||
QUERY_CLASSIFIER_VERSION,
|
||||
"Dummy Query Classifier",
|
||||
"V1.0.0"
|
||||
};
|
||||
static QUERY_CLASSIFIER qc =
|
||||
{
|
||||
qc_init,
|
||||
qc_end,
|
||||
qc_thread_init,
|
||||
qc_thread_end,
|
||||
qc_parse,
|
||||
qc_get_type,
|
||||
qc_get_operation,
|
||||
qc_get_created_table_name,
|
||||
qc_is_drop_table_query,
|
||||
qc_is_real_query,
|
||||
qc_get_table_names,
|
||||
NULL,
|
||||
qc_query_has_clause,
|
||||
qc_get_database_names,
|
||||
qc_get_prepare_name,
|
||||
qc_get_prepare_operation,
|
||||
qc_get_field_info,
|
||||
};
|
||||
|
||||
static QUERY_CLASSIFIER qc =
|
||||
{
|
||||
qc_init,
|
||||
qc_end,
|
||||
qc_thread_init,
|
||||
qc_thread_end,
|
||||
qc_parse,
|
||||
qc_get_type,
|
||||
qc_get_operation,
|
||||
qc_get_created_table_name,
|
||||
qc_is_drop_table_query,
|
||||
qc_is_real_query,
|
||||
qc_get_table_names,
|
||||
NULL,
|
||||
qc_query_has_clause,
|
||||
qc_get_database_names,
|
||||
qc_get_prepare_name,
|
||||
qc_get_prepare_operation,
|
||||
qc_get_field_info,
|
||||
};
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_QUERY_CLASSIFIER,
|
||||
MODULE_IN_DEVELOPMENT,
|
||||
QUERY_CLASSIFIER_VERSION,
|
||||
"Dummy Query Classifier",
|
||||
"V1.0.0",
|
||||
&qc
|
||||
};
|
||||
|
||||
QUERY_CLASSIFIER* GetModuleObject()
|
||||
{
|
||||
return &qc;
|
||||
return &info;
|
||||
}
|
||||
/*lint +e14 */
|
||||
}
|
||||
|
@ -2557,44 +2557,40 @@ void qc_thread_end(void)
|
||||
extern "C"
|
||||
{
|
||||
|
||||
static QUERY_CLASSIFIER qc =
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
qc_init,
|
||||
qc_end,
|
||||
qc_thread_init,
|
||||
qc_thread_end,
|
||||
qc_parse,
|
||||
qc_get_type,
|
||||
qc_get_operation,
|
||||
qc_get_created_table_name,
|
||||
qc_is_drop_table_query,
|
||||
qc_is_real_query,
|
||||
qc_get_table_names,
|
||||
NULL,
|
||||
qc_query_has_clause,
|
||||
qc_get_database_names,
|
||||
qc_get_prepare_name,
|
||||
qc_get_prepare_operation,
|
||||
qc_get_field_info,
|
||||
};
|
||||
static QUERY_CLASSIFIER qc =
|
||||
{
|
||||
qc_init,
|
||||
qc_end,
|
||||
qc_thread_init,
|
||||
qc_thread_end,
|
||||
qc_parse,
|
||||
qc_get_type,
|
||||
qc_get_operation,
|
||||
qc_get_created_table_name,
|
||||
qc_is_drop_table_query,
|
||||
qc_is_real_query,
|
||||
qc_get_table_names,
|
||||
NULL,
|
||||
qc_query_has_clause,
|
||||
qc_get_database_names,
|
||||
qc_get_prepare_name,
|
||||
qc_get_prepare_operation,
|
||||
qc_get_field_info,
|
||||
};
|
||||
|
||||
/* @see function load_module in load_utils.c for explanation of the following
|
||||
* lint directives.
|
||||
*/
|
||||
/*lint -e14 */
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_QUERY_CLASSIFIER,
|
||||
MODULE_IN_DEVELOPMENT,
|
||||
QUERY_CLASSIFIER_VERSION,
|
||||
"Query classifier based upon MySQL Embedded",
|
||||
"V1.0.0"
|
||||
};
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_QUERY_CLASSIFIER,
|
||||
MODULE_IN_DEVELOPMENT,
|
||||
QUERY_CLASSIFIER_VERSION,
|
||||
"Query classifier based upon MySQL Embedded",
|
||||
"V1.0.0",
|
||||
&qc
|
||||
};
|
||||
|
||||
QUERY_CLASSIFIER* GetModuleObject()
|
||||
{
|
||||
return &qc;
|
||||
return &info;
|
||||
}
|
||||
/*lint +e14 */
|
||||
|
||||
}
|
||||
|
@ -3172,38 +3172,38 @@ void qc_sqlite_get_field_info(GWBUF* query, const QC_FIELD_INFO** infos, size_t*
|
||||
* EXPORTS
|
||||
*/
|
||||
|
||||
static QUERY_CLASSIFIER qc =
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
qc_sqlite_init,
|
||||
qc_sqlite_end,
|
||||
qc_sqlite_thread_init,
|
||||
qc_sqlite_thread_end,
|
||||
qc_sqlite_parse,
|
||||
qc_sqlite_get_type,
|
||||
qc_sqlite_get_operation,
|
||||
qc_sqlite_get_created_table_name,
|
||||
qc_sqlite_is_drop_table_query,
|
||||
qc_sqlite_is_real_query,
|
||||
qc_sqlite_get_table_names,
|
||||
NULL,
|
||||
qc_sqlite_query_has_clause,
|
||||
qc_sqlite_get_database_names,
|
||||
qc_sqlite_get_prepare_name,
|
||||
qc_sqlite_get_prepare_operation,
|
||||
qc_sqlite_get_field_info,
|
||||
};
|
||||
static QUERY_CLASSIFIER qc =
|
||||
{
|
||||
qc_sqlite_init,
|
||||
qc_sqlite_end,
|
||||
qc_sqlite_thread_init,
|
||||
qc_sqlite_thread_end,
|
||||
qc_sqlite_parse,
|
||||
qc_sqlite_get_type,
|
||||
qc_sqlite_get_operation,
|
||||
qc_sqlite_get_created_table_name,
|
||||
qc_sqlite_is_drop_table_query,
|
||||
qc_sqlite_is_real_query,
|
||||
qc_sqlite_get_table_names,
|
||||
NULL,
|
||||
qc_sqlite_query_has_clause,
|
||||
qc_sqlite_get_database_names,
|
||||
qc_sqlite_get_prepare_name,
|
||||
qc_sqlite_get_prepare_operation,
|
||||
qc_sqlite_get_field_info,
|
||||
};
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_QUERY_CLASSIFIER,
|
||||
MODULE_BETA_RELEASE,
|
||||
QUERY_CLASSIFIER_VERSION,
|
||||
"Query classifier using sqlite.",
|
||||
"V1.0.0",
|
||||
&qc
|
||||
};
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_QUERY_CLASSIFIER,
|
||||
MODULE_BETA_RELEASE,
|
||||
QUERY_CLASSIFIER_VERSION,
|
||||
"Query classifier using sqlite.",
|
||||
"V1.0.0"
|
||||
};
|
||||
|
||||
QUERY_CLASSIFIER* GetModuleObject()
|
||||
{
|
||||
return &qc;
|
||||
return &info;
|
||||
}
|
||||
|
Reference in New Issue
Block a user