3
* Module begun 2008-03-05 by Rainer Gerhards, based on some code
6
* Copyright 2008 Rainer Gerhards and Adiscon GmbH.
8
* This file is part of the rsyslog runtime library.
10
* The rsyslog runtime library is free software: you can redistribute it and/or modify
11
* it under the terms of the GNU Lesser General Public License as published by
12
* the Free Software Foundation, either version 3 of the License, or
13
* (at your option) any later version.
15
* The rsyslog runtime library is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Lesser General Public License for more details.
20
* You should have received a copy of the GNU Lesser General Public License
21
* along with the rsyslog runtime library. If not, see <http://www.gnu.org/licenses/>.
23
* A copy of the GPL can be found in the file "COPYING" in this distribution.
24
* A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution.
33
#include "module-template.h"
43
/* ------------------------------ methods ------------------------------ */
47
/* queryInterface function
48
* rgerhards, 2008-03-05
50
BEGINobjQueryInterface(regexp)
51
CODESTARTobjQueryInterface(regexp)
52
if(pIf->ifVersion != regexpCURR_IF_VERSION) { /* check for current version, increment on each change */
53
ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED);
56
/* ok, we have the right interface, so let's fill it
57
* Please note that we may also do some backwards-compatibility
58
* work here (if we can support an older interface version - that,
59
* of course, also affects the "if" above).
61
pIf->regcomp = regcomp;
62
pIf->regexec = regexec;
63
pIf->regerror = regerror;
64
pIf->regfree = regfree;
66
ENDobjQueryInterface(regexp)
69
/* Initialize the regexp class. Must be called as the very first method
70
* before anything else is called inside this class.
71
* rgerhards, 2008-02-19
73
BEGINAbstractObjClassInit(regexp, 1, OBJ_IS_LOADABLE_MODULE) /* class, version */
74
/* request objects we use */
76
/* set our own handlers */
77
ENDObjClassInit(regexp)
80
/* --------------- here now comes the plumbing that makes as a library module --------------- */
90
CODEqueryEtryPt_STD_LIB_QUERIES
96
*ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */
98
CHKiRet(regexpClassInit(pModInfo)); /* must be done after tcps_sess, as we use it */
99
/* Initialize all classes that are in our module - this includes ourselfs */