| 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-2012 Adiscon GmbH. |
| 6 |
* |
| 7 |
* This file is part of the rsyslog runtime library. |
| 8 |
* |
| 9 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 |
* you may not use this file except in compliance with the License. |
| 11 |
* You may obtain a copy of the License at |
| 12 |
* |
| 13 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 14 |
* -or- |
| 15 |
* see COPYING.ASL20 in the source distribution |
| 16 |
* |
| 17 |
* Unless required by applicable law or agreed to in writing, software |
| 18 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 19 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 20 |
* See the License for the specific language governing permissions and |
| 21 |
* limitations under the License. |
| 22 |
*/ |
| 23 |
#ifndef INCLUDED_REGEXP_H |
| 24 |
#define INCLUDED_REGEXP_H |
| 25 |
|
| 26 |
#include <regex.h> |
| 27 |
|
| 28 |
/* interfaces */ |
| 29 |
BEGINinterface(regexp) /* name must also be changed in ENDinterface macro! */ |
| 30 |
int (*regcomp)(regex_t *preg, const char *regex, int cflags); |
| 31 |
int (*regexec)(const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags); |
| 32 |
size_t (*regerror)(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size); |
| 33 |
void (*regfree)(regex_t *preg); |
| 34 |
ENDinterface(regexp) |
| 35 |
#define regexpCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ |
| 36 |
|
| 37 |
|
| 38 |
/* prototypes */ |
| 39 |
PROTOTYPEObj(regexp); |
| 40 |
|
| 41 |
/* the name of our library binary */ |
| 42 |
#define LM_REGEXP_FILENAME "lmregexp" |
| 43 |
|
| 44 |
#endif /* #ifndef INCLUDED_REGEXP_H */ |