Hide definition of MXS_FILTER_DEF

MXS_FILTER_DEF is now private the MaxScale core.
This commit is contained in:
Johan Wikman
2017-01-13 14:59:58 +02:00
parent 41d2d65e71
commit c13a2eeb33
8 changed files with 54 additions and 32 deletions

View File

@ -22,16 +22,17 @@
*
* @endverbatim
*/
#include <maxscale/filter.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <maxscale/filter.h>
#include <maxscale/session.h>
#include <maxscale/modules.h>
#include <maxscale/spinlock.h>
#include <maxscale/log_manager.h>
#include <maxscale/alloc.h>
#include <maxscale/log_manager.h>
#include <maxscale/modules.h>
#include <maxscale/session.h>
#include <maxscale/spinlock.h>
#include "maxscale/filter.h"
static SPINLOCK filter_spin = SPINLOCK_INIT; /**< Protects the list of all filters */
static MXS_FILTER_DEF *allFilters = NULL; /**< The list of all filters */
@ -151,6 +152,11 @@ filter_def_find(const char *name)
return filter;
}
const char* filter_def_get_name(const MXS_FILTER_DEF* filter_def)
{
return filter_def->name;
}
const char* filter_def_get_module_name(const MXS_FILTER_DEF* filter_def)
{
return filter_def->module;

View File

@ -20,6 +20,23 @@
MXS_BEGIN_DECLS
/**
* The definition of a filter from the configuration file.
* This is basically the link between a plugin to load and the
* options to pass to that plugin.
*/
typedef struct mxs_filter_def
{
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 */
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 mxs_filter_def *next; /**< Next filter in the chain of all filters */
} MXS_FILTER_DEF;
void filter_add_option(MXS_FILTER_DEF *filter_def, const char *option);
void filter_add_parameter(MXS_FILTER_DEF *filter_def, const char *name, const char *value);
MXS_FILTER_DEF *filter_alloc(const char *name, const char *module_name);

View File

@ -11,12 +11,13 @@
* Public License.
*/
#include <maxscale/modulecmd.h>
#include <maxscale/alloc.h>
#include <maxscale/config.h>
#include <maxscale/modulecmd.h>
#include <maxscale/pcre2.h>
#include <maxscale/platform.h>
#include <maxscale/spinlock.h>
#include "maxscale/filter.h"
/** Size of the error buffer */
#define MODULECMD_ERRBUF_SIZE 512