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

@ -198,14 +198,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_IN_DEVELOPMENT,
FILTER_VERSION,
"A caching filter that is capable of caching and returning cached data."
"A caching filter that is capable of caching and returning cached data.",
VERSION_STRING
};
extern "C" char *version()
{
return VERSION_STRING;
}
extern "C" void ModuleInit()
{
static modulecmd_arg_type_t show_argv[] =

View File

@ -51,11 +51,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"A routing hint filter that send queries to the master after data modification"
"A routing hint filter that send queries to the master after data modification",
"V1.1.0"
};
static char *version_str = "V1.1.0";
static FILTER *createInstance(const char *name, char **options, FILTER_PARAMETER **params);
static void *newSession(FILTER *instance, SESSION *session);
static void closeSession(FILTER *instance, void *session);
@ -117,17 +116,6 @@ typedef struct
time_t last_modification; /*< Time of the last data modifying operation */
} CCR_SESSION;
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialization routine, called when the module
* is first loaded.

View File

@ -96,11 +96,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"Firewall Filter"
"Firewall Filter",
"V1.2.0"
};
static char *version_str = "V1.2.0";
/*
* The filter entry points
*/
@ -793,15 +792,6 @@ bool dbfw_show_rules(const MODULECMD_ARG *argv)
return true;
}
/**
* 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

View File

@ -28,11 +28,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_ALPHA_RELEASE,
FILTER_VERSION,
"A hint parsing filter"
"A hint parsing filter",
"V1.0.0"
};
static char *version_str = "V1.0.0";
static FILTER *createInstance(const char* name, char **options, FILTER_PARAMETER **params);
static void *newSession(FILTER *instance, SESSION *session);
static void closeSession(FILTER *instance, void *session);
@ -58,17 +57,6 @@ static FILTER_OBJECT MyObject =
NULL, // No destroyInstance
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialization routine, called when the module
* is first loaded.

View File

@ -55,22 +55,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_EXPERIMENTAL,
FILTER_VERSION,
"Lua Filter"
"Lua Filter",
"V1.0.0"
};
static const char *version_str = "V1.0.0";
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return (char*) version_str;
}
/*
* The filter entry points
*/

View File

@ -14,13 +14,6 @@
#define MXS_MODULE_NAME "masking"
#include "maskingfilter.hh"
namespace
{
char VERSION_STRING[] = "V1.0.0";
}
//
// Global symbols of the Module
//
@ -30,23 +23,19 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_IN_DEVELOPMENT,
FILTER_VERSION,
"A masking filter that is capable of masking/obfuscating returned column values."
"A masking filter that is capable of masking/obfuscating returned column values.",
"V1.0.0"
};
extern "C" char *version()
{
return VERSION_STRING;
}
extern "C" void ModuleInit()
{
MXS_NOTICE("Initialized masking module %s.\n", VERSION_STRING);
MXS_NOTICE("Initialized masking module.");
}
extern "C" FILTER_OBJECT *GetModuleObject()
{
return &MaskingFilter::s_object;
};
}
//
// MaskingFilter

View File

@ -46,8 +46,6 @@
#include <maxscale/debug.h>
#include "maxrows.h"
static char VERSION_STRING[] = "V1.0.0";
static FILTER *createInstance(const char *name, char **options, FILTER_PARAMETER **);
static void *newSession(FILTER *instance, SESSION *session);
static void closeSession(FILTER *instance, void *sdata);
@ -66,14 +64,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_IN_DEVELOPMENT,
FILTER_VERSION,
"A filter that is capable of limiting the resultset number of rows."
"A filter that is capable of limiting the resultset number of rows.",
"V1.0.0"
};
char *version()
{
return VERSION_STRING;
}
/**
* The module initialization functions, called when the module has
* been loaded.

View File

@ -83,10 +83,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_ALPHA_RELEASE,
FILTER_VERSION,
"A RabbitMQ query logging filter"
"A RabbitMQ query logging filter",
"V1.0.2"
};
static char *version_str = "V1.0.2";
static int uid_gen;
static int hktask_id = 0;
/*
@ -262,17 +262,6 @@ typedef struct
void sendMessage(void* data);
/**
* 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

@ -45,11 +45,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"A routing hint filter that uses regular expressions to direct queries"
"A routing hint filter that uses regular expressions to direct queries",
"V1.1.0"
};
static char *version_str = "V1.1.0";
static FILTER *createInstance(const char *name, char **options, FILTER_PARAMETER **params);
static void *newSession(FILTER *instance, SESSION *session);
static void closeSession(FILTER *instance, void *session);
@ -98,17 +97,6 @@ typedef struct
int active; /* Is filter active */
} REGEXHINT_SESSION;
/**
* 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

@ -55,11 +55,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"A simple query logging filter"
"A simple query logging filter",
"V1.1.1"
};
static char *version_str = "V1.1.1";
/** Date string buffer size */
#define QLA_DATE_BUFFER_SIZE 20
@ -157,17 +156,6 @@ static FILE* open_log_file(uint32_t, QLA_INSTANCE *, const char *);
static int write_log_entry(uint32_t, FILE*, QLA_INSTANCE*, QLA_SESSION*, const char*,
const char*, size_t);
/**
* 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

@ -45,11 +45,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"A query rewrite filter that uses regular expressions to rewite queries"
"A query rewrite filter that uses regular expressions to rewrite queries",
"V1.1.0"
};
static char *version_str = "V1.1.0";
static FILTER *createInstance(const char *name, char **options, FILTER_PARAMETER **params);
static void *newSession(FILTER *instance, SESSION *session);
static void closeSession(FILTER *instance, void *session);
@ -107,17 +106,6 @@ typedef struct
void log_match(REGEX_INSTANCE* inst, char* re, char* old, char* new);
void log_nomatch(REGEX_INSTANCE* inst, char* re, char* old);
/**
* 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

@ -99,11 +99,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"A tee piece in the filter plumbing"
"A tee piece in the filter plumbing",
"V1.0.0"
};
static char *version_str = "V1.0.0";
/*
* The filter entry points
*/
@ -306,17 +305,6 @@ orphan_free(void* data)
#endif
}
/**
* 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

@ -34,11 +34,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_BETA_RELEASE,
FILTER_VERSION,
"A simple query counting filter"
"A simple query counting filter",
"V2.0.0"
};
static char *version_str = "V2.0.0";
static FILTER *createInstance(const char *name, char **options, FILTER_PARAMETER **params);
static void *newSession(FILTER *instance, SESSION *session);
static void closeSession(FILTER *instance, void *session);
@ -83,17 +82,6 @@ typedef struct
int count;
} TEST_SESSION;
/**
* 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

@ -50,11 +50,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"A top N query logging filter"
"A top N query logging filter",
"V1.0.1"
};
static char *version_str = "V1.0.1";
/*
* The filter entry points
*/
@ -141,17 +140,6 @@ typedef struct
struct timeval disconnect;
} TOPN_SESSION;
/**
* 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

@ -69,10 +69,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"Transaction Performance Monitoring filter"
"Transaction Performance Monitoring filter",
"V1.0.1"
};
static char *version_str = "V1.0.1";
static size_t buf_size = 10;
static size_t sql_size_limit = 64 * 1024 *
1024; /* The maximum size for query statements in a transaction (64MB) */
@ -158,17 +158,6 @@ typedef struct
size_t max_sql_size;
} TPM_SESSION;
/**
* 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.