OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / user / rsyslog / regexp.h
1 /* The regexp object. It encapsulates the C regexp functionality. The primary
2  * purpose of this wrapper class is to enable rsyslogd core to be build without
3  * regexp libraries.
4  *
5  * Copyright 2008 Rainer Gerhards and Adiscon GmbH.
6  *
7  * This file is part of the rsyslog runtime library.
8  *
9  * The rsyslog runtime library is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * The rsyslog runtime library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with the rsyslog runtime library.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  * A copy of the GPL can be found in the file "COPYING" in this distribution.
23  * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution.
24  */
25 #ifndef INCLUDED_REGEXP_H
26 #define INCLUDED_REGEXP_H
27
28 #include <regex.h>
29
30 /* interfaces */
31 BEGINinterface(regexp) /* name must also be changed in ENDinterface macro! */
32         int (*regcomp)(regex_t *preg, const char *regex, int cflags);
33         int (*regexec)(const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags);
34         size_t (*regerror)(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size);
35         void (*regfree)(regex_t *preg);
36 ENDinterface(regexp)
37 #define regexpCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */
38
39
40 /* prototypes */
41 PROTOTYPEObj(regexp);
42
43 /* the name of our library binary */
44 #define LM_REGEXP_FILENAME "lmregexp"
45
46 #endif /* #ifndef INCLUDED_REGEXP_H */