Rename FILTER to MXS_FILTER
This commit is contained in:
@ -36,7 +36,7 @@ MXS_BEGIN_DECLS
|
||||
* The FILTER handle points to module specific data, so the best we can do
|
||||
* is to make it a void * externally.
|
||||
*/
|
||||
typedef void *FILTER;
|
||||
typedef void *MXS_FILTER;
|
||||
|
||||
/**
|
||||
* @verbatim
|
||||
@ -63,19 +63,19 @@ typedef void *FILTER;
|
||||
*/
|
||||
typedef struct mxs_filter_object
|
||||
{
|
||||
FILTER *(*createInstance)(const char *name,
|
||||
char **options,
|
||||
CONFIG_PARAMETER *params);
|
||||
void *(*newSession)(FILTER *instance, SESSION *session);
|
||||
void (*closeSession)(FILTER *instance, void *fsession);
|
||||
void (*freeSession)(FILTER *instance, void *fsession);
|
||||
void (*setDownstream)(FILTER *instance, void *fsession, DOWNSTREAM *downstream);
|
||||
void (*setUpstream)(FILTER *instance, void *fsession, UPSTREAM *downstream);
|
||||
int32_t (*routeQuery)(FILTER *instance, void *fsession, GWBUF *queue);
|
||||
int32_t (*clientReply)(FILTER *instance, void *fsession, GWBUF *queue);
|
||||
void (*diagnostics)(FILTER *instance, void *fsession, DCB *dcb);
|
||||
MXS_FILTER *(*createInstance)(const char *name,
|
||||
char **options,
|
||||
CONFIG_PARAMETER *params);
|
||||
void *(*newSession)(MXS_FILTER *instance, SESSION *session);
|
||||
void (*closeSession)(MXS_FILTER *instance, void *fsession);
|
||||
void (*freeSession)(MXS_FILTER *instance, void *fsession);
|
||||
void (*setDownstream)(MXS_FILTER *instance, void *fsession, DOWNSTREAM *downstream);
|
||||
void (*setUpstream)(MXS_FILTER *instance, void *fsession, UPSTREAM *downstream);
|
||||
int32_t (*routeQuery)(MXS_FILTER *instance, void *fsession, GWBUF *queue);
|
||||
int32_t (*clientReply)(MXS_FILTER *instance, void *fsession, GWBUF *queue);
|
||||
void (*diagnostics)(MXS_FILTER *instance, void *fsession, DCB *dcb);
|
||||
uint64_t (*getCapabilities)(void);
|
||||
void (*destroyInstance)(FILTER *instance);
|
||||
void (*destroyInstance)(MXS_FILTER *instance);
|
||||
} MXS_FILTER_OBJECT;
|
||||
|
||||
/**
|
||||
@ -91,14 +91,14 @@ typedef struct mxs_filter_object
|
||||
*/
|
||||
typedef struct filter_def
|
||||
{
|
||||
char *name; /**< The Filter name */
|
||||
char *module; /**< The module to load */
|
||||
char **options; /**< The options set for this filter */
|
||||
char *name; /**< The Filter name */
|
||||
char *module; /**< The module to load */
|
||||
char **options; /**< The options set for this filter */
|
||||
CONFIG_PARAMETER *parameters; /**< The filter parameters */
|
||||
FILTER filter; /**< The runtime filter */
|
||||
MXS_FILTER_OBJECT *obj; /**< The "MODULE_OBJECT" for the filter */
|
||||
SPINLOCK spin; /**< Spinlock to protect the filter definition */
|
||||
struct filter_def *next; /**< Next filter in the chain of all filters */
|
||||
MXS_FILTER* filter; /**< The runtime filter */
|
||||
MXS_FILTER_OBJECT *obj; /**< The "MODULE_OBJECT" for the filter */
|
||||
SPINLOCK spin; /**< Spinlock to protect the filter definition */
|
||||
struct filter_def *next; /**< Next filter in the chain of all filters */
|
||||
} FILTER_DEF;
|
||||
|
||||
FILTER_DEF *filter_alloc(const char *, const char *);
|
||||
|
@ -203,16 +203,16 @@ template<class FilterType, class FilterSessionType>
|
||||
class Filter
|
||||
{
|
||||
public:
|
||||
static FILTER* createInstance(const char* zName, char** pzOptions, CONFIG_PARAMETER* ppParams)
|
||||
static MXS_FILTER* createInstance(const char* zName, char** pzOptions, CONFIG_PARAMETER* ppParams)
|
||||
{
|
||||
FilterType* pFilter = NULL;
|
||||
|
||||
MXS_EXCEPTION_GUARD(pFilter = FilterType::create(zName, pzOptions, ppParams));
|
||||
|
||||
return reinterpret_cast<FILTER*>(pFilter);
|
||||
return reinterpret_cast<MXS_FILTER*>(pFilter);
|
||||
}
|
||||
|
||||
static void* newSession(FILTER* pInstance, SESSION* pSession)
|
||||
static void* newSession(MXS_FILTER* pInstance, SESSION* pSession)
|
||||
{
|
||||
FilterType* pFilter = reinterpret_cast<FilterType*>(pInstance);
|
||||
void* pFilterSession;
|
||||
@ -222,21 +222,21 @@ public:
|
||||
return pFilterSession;
|
||||
}
|
||||
|
||||
static void closeSession(FILTER*, void* pData)
|
||||
static void closeSession(MXS_FILTER*, void* pData)
|
||||
{
|
||||
FilterSessionType* pFilterSession = static_cast<FilterSessionType*>(pData);
|
||||
|
||||
MXS_EXCEPTION_GUARD(pFilterSession->close());
|
||||
}
|
||||
|
||||
static void freeSession(FILTER*, void* pData)
|
||||
static void freeSession(MXS_FILTER*, void* pData)
|
||||
{
|
||||
FilterSessionType* pFilterSession = static_cast<FilterSessionType*>(pData);
|
||||
|
||||
MXS_EXCEPTION_GUARD(delete pFilterSession);
|
||||
}
|
||||
|
||||
static void setDownstream(FILTER*, void* pData, DOWNSTREAM* pDownstream)
|
||||
static void setDownstream(MXS_FILTER*, void* pData, DOWNSTREAM* pDownstream)
|
||||
{
|
||||
FilterSessionType* pFilterSession = static_cast<FilterSessionType*>(pData);
|
||||
|
||||
@ -245,7 +245,7 @@ public:
|
||||
MXS_EXCEPTION_GUARD(pFilterSession->setDownstream(down));
|
||||
}
|
||||
|
||||
static void setUpstream(FILTER* pInstance, void* pData, UPSTREAM* pUpstream)
|
||||
static void setUpstream(MXS_FILTER* pInstance, void* pData, UPSTREAM* pUpstream)
|
||||
{
|
||||
FilterSessionType* pFilterSession = static_cast<FilterSessionType*>(pData);
|
||||
|
||||
@ -254,7 +254,7 @@ public:
|
||||
MXS_EXCEPTION_GUARD(pFilterSession->setUpstream(up));
|
||||
}
|
||||
|
||||
static int routeQuery(FILTER* pInstance, void* pData, GWBUF* pPacket)
|
||||
static int routeQuery(MXS_FILTER* pInstance, void* pData, GWBUF* pPacket)
|
||||
{
|
||||
FilterSessionType* pFilterSession = static_cast<FilterSessionType*>(pData);
|
||||
|
||||
@ -264,7 +264,7 @@ public:
|
||||
return rv;
|
||||
}
|
||||
|
||||
static int clientReply(FILTER* pInstance, void* pData, GWBUF* pPacket)
|
||||
static int clientReply(MXS_FILTER* pInstance, void* pData, GWBUF* pPacket)
|
||||
{
|
||||
FilterSessionType* pFilterSession = static_cast<FilterSessionType*>(pData);
|
||||
|
||||
@ -274,7 +274,7 @@ public:
|
||||
return rv;
|
||||
}
|
||||
|
||||
static void diagnostics(FILTER* pInstance, void* pData, DCB* pDcb)
|
||||
static void diagnostics(MXS_FILTER* pInstance, void* pData, DCB* pDcb)
|
||||
{
|
||||
if (pData)
|
||||
{
|
||||
@ -299,7 +299,7 @@ public:
|
||||
return rv;
|
||||
}
|
||||
|
||||
static void destroyInstance(FILTER* pInstance)
|
||||
static void destroyInstance(MXS_FILTER* pInstance)
|
||||
{
|
||||
FilterType* pFilter = reinterpret_cast<FilterType*>(pInstance);
|
||||
|
||||
|
Reference in New Issue
Block a user