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:
Markus Mäkelä
2017-01-03 14:04:20 +02:00
parent 6c53999c97
commit ae0577c695
53 changed files with 1346 additions and 1483 deletions

View File

@ -52,13 +52,6 @@ static void detectStaleMaster(void *, int);
static MONITOR_SERVERS *get_current_master(MONITOR *);
static bool isMySQLEvent(monitor_event_t event);
static MONITOR_OBJECT MyObject =
{
startMonitor,
stopMonitor,
diagnostics
};
/**
* The module entry point routine. It is this routine that
* must populate the structure that is referred to as the
@ -67,11 +60,28 @@ static MONITOR_OBJECT MyObject =
*
* @return The module object
*/
MONITOR_OBJECT *
GetModuleObject()
MODULE_INFO* GetModuleObject()
{
MXS_NOTICE("Initialise the Multi-Master Monitor module.");
return &MyObject;
static MONITOR_OBJECT MyObject =
{
startMonitor,
stopMonitor,
diagnostics
};
static MODULE_INFO info =
{
MODULE_API_MONITOR,
MODULE_BETA_RELEASE,
MONITOR_VERSION,
"A Multi-Master Multi Master monitor",
"V1.1.1",
&MyObject
};
return &info;
}
/*lint +e14 */