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

@ -43,12 +43,12 @@ MODULE_INFO info =
MODULE_API_PROTOCOL,
MODULE_IN_DEVELOPMENT,
GWPROTOCOL_VERSION,
"A Change Data Capture Listener implementation for use in binlog events retrieval"
"A Change Data Capture Listener implementation for use in binlog events retrieval",
"V1.0.0"
};
#define ISspace(x) isspace((int)(x))
#define CDC_SERVER_STRING "MaxScale(c) v.1.0.0"
static char *version_str = "V1.0.0";
static int cdc_read_event(DCB* dcb);
static int cdc_write_event(DCB *dcb);
@ -88,17 +88,6 @@ static GWPROTOCOL MyObject =
cdc_default_auth /* default authentication */
};
/**
* 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.

View File

@ -49,13 +49,13 @@ MODULE_INFO info =
MODULE_API_PROTOCOL,
MODULE_IN_DEVELOPMENT,
GWPROTOCOL_VERSION,
"An experimental HTTPD implementation for use in administration"
"An experimental HTTPD implementation for use in administration",
"V1.2.0"
};
/*lint +e14 */
#define ISspace(x) isspace((int)(x))
#define HTTP_SERVER_STRING "MaxScale(c) v.1.0.0"
static char *version_str = "V1.2.0";
static int httpd_read_event(DCB* dcb);
static int httpd_write_event(DCB *dcb);
@ -89,20 +89,6 @@ static GWPROTOCOL MyObject =
NULL /**< Connection limit reached */
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -60,11 +60,11 @@ MODULE_INFO info =
MODULE_API_PROTOCOL,
MODULE_GA,
GWPROTOCOL_VERSION,
"The MySQL to backend server protocol"
"The MySQL to backend server protocol",
"V2.0.0"
};
/*lint +e14 */
static char *version_str = "V2.0.0";
static int gw_create_backend_connection(DCB *backend, SERVER *server, SESSION *in_session);
static int gw_read_backend_event(DCB* dcb);
static int gw_write_backend_event(DCB *dcb);
@ -112,20 +112,6 @@ static GWPROTOCOL MyObject =
NULL /* Connection limit reached */
};
/*
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/*
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -69,12 +69,11 @@ MODULE_INFO info =
MODULE_API_PROTOCOL,
MODULE_GA,
GWPROTOCOL_VERSION,
"The client to MaxScale MySQL protocol implementation"
"The client to MaxScale MySQL protocol implementation",
"V1.1.0"
};
/*lint +e14*/
static char *version_str = "V1.1.0";
static int gw_MySQLAccept(DCB *listener);
static int gw_MySQLListener(DCB *listener, char *config_bind);
static int gw_read_client_event(DCB* dcb);
@ -115,20 +114,6 @@ static GWPROTOCOL MyObject =
gw_connection_limit /* Send error connection limit */
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -46,7 +46,8 @@ MODULE_INFO info =
MODULE_API_PROTOCOL,
MODULE_GA,
GWPROTOCOL_VERSION,
"A maxscale protocol for the administration interface"
"A maxscale protocol for the administration interface",
"V2.0.0"
};
/*lint +e14 */
@ -64,8 +65,6 @@ MODULE_INFO info =
* @endverbatim
*/
static char *version_str = "V2.0.0";
#define GETPWUID_BUF_LEN 255
static int maxscaled_read_event(DCB* dcb);
@ -192,20 +191,6 @@ static GWPROTOCOL MyObject =
NULL /**< Connection limit reached */
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -42,7 +42,8 @@ MODULE_INFO info =
MODULE_API_PROTOCOL,
MODULE_GA,
GWPROTOCOL_VERSION,
"A telnet deamon protocol for simple administration interface"
"A telnet deamon protocol for simple administration interface",
"V1.1.1"
};
/*lint +e14 */
@ -68,8 +69,6 @@ MODULE_INFO info =
* @endverbatim
*/
static char *version_str = "V1.1.1";
static int telnetd_read_event(DCB* dcb);
static int telnetd_write_event(DCB *dcb);
static int telnetd_write(DCB *dcb, GWBUF *queue);
@ -103,20 +102,6 @@ static GWPROTOCOL MyObject =
static void telnetd_command(DCB *, unsigned char *cmd);
static void telnetd_echo(DCB *dcb, int enable);
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -39,12 +39,11 @@ MODULE_INFO info =
MODULE_API_PROTOCOL,
MODULE_IN_DEVELOPMENT,
GWPROTOCOL_VERSION,
"Test protocol"
"Test protocol",
"V1.1.0"
};
/*lint +e14 */
static char *version_str = "V1.1.0";
static int test_read(DCB* dcb){ return 1;}
static int test_write(DCB *dcb, GWBUF* buf){ return 1;}
static int test_write_ready(DCB *dcb){ return 1;}
@ -78,21 +77,6 @@ static GWPROTOCOL MyObject =
test_connection_limit /**< Connection limit */
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.