| 2 |
* Perl-Compatible Regular Expressions * |
* Perl-Compatible Regular Expressions * |
| 3 |
*************************************************/ |
*************************************************/ |
| 4 |
|
|
|
/* Copyright (c) 1997 University of Cambridge */ |
|
|
|
|
| 5 |
#ifndef _PCREPOSIX_H |
#ifndef _PCREPOSIX_H |
| 6 |
#define _PCREPOSIX_H |
#define _PCREPOSIX_H |
| 7 |
|
|
| 8 |
/* This is the header for the POSIX wrapper interface to the PCRE Perl- |
/* This is the header for the POSIX wrapper interface to the PCRE Perl- |
| 9 |
Compatible Regular Expression library. It defines the things POSIX says should |
Compatible Regular Expression library. It defines the things POSIX says should |
| 10 |
be there. I hope. */ |
be there. I hope. |
| 11 |
|
|
| 12 |
|
Copyright (c) 1997-2004 University of Cambridge |
| 13 |
|
|
| 14 |
|
----------------------------------------------------------------------------- |
| 15 |
|
Redistribution and use in source and binary forms, with or without |
| 16 |
|
modification, are permitted provided that the following conditions are met: |
| 17 |
|
|
| 18 |
|
* Redistributions of source code must retain the above copyright notice, |
| 19 |
|
this list of conditions and the following disclaimer. |
| 20 |
|
|
| 21 |
|
* Redistributions in binary form must reproduce the above copyright |
| 22 |
|
notice, this list of conditions and the following disclaimer in the |
| 23 |
|
documentation and/or other materials provided with the distribution. |
| 24 |
|
|
| 25 |
|
* Neither the name of the University of Cambridge nor the names of its |
| 26 |
|
contributors may be used to endorse or promote products derived from |
| 27 |
|
this software without specific prior written permission. |
| 28 |
|
|
| 29 |
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 30 |
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 31 |
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 32 |
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 33 |
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 34 |
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 35 |
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 36 |
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 37 |
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 38 |
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 39 |
|
POSSIBILITY OF SUCH DAMAGE. |
| 40 |
|
----------------------------------------------------------------------------- |
| 41 |
|
*/ |
| 42 |
|
|
| 43 |
/* Have to include stdlib.h in order to ensure that size_t is defined. */ |
/* Have to include stdlib.h in order to ensure that size_t is defined. */ |
| 44 |
|
|
| 45 |
#include <stdlib.h> |
#include <stdlib.h> |
| 46 |
|
|
| 47 |
|
/* Allow for C++ users */ |
| 48 |
|
|
| 49 |
|
#ifdef __cplusplus |
| 50 |
|
extern "C" { |
| 51 |
|
#endif |
| 52 |
|
|
| 53 |
/* Options defined by POSIX. */ |
/* Options defined by POSIX. */ |
| 54 |
|
|
| 55 |
#define REG_ICASE 0x01 |
#define REG_ICASE 0x01 |
| 57 |
#define REG_NOTBOL 0x04 |
#define REG_NOTBOL 0x04 |
| 58 |
#define REG_NOTEOL 0x08 |
#define REG_NOTEOL 0x08 |
| 59 |
|
|
| 60 |
|
/* These are not used by PCRE, but by defining them we make it easier |
| 61 |
|
to slot PCRE into existing programs that make POSIX calls. */ |
| 62 |
|
|
| 63 |
|
#define REG_EXTENDED 0 |
| 64 |
|
#define REG_NOSUB 0 |
| 65 |
|
|
| 66 |
/* Error values. Not all these are relevant or used by the wrapper. */ |
/* Error values. Not all these are relevant or used by the wrapper. */ |
| 67 |
|
|
| 68 |
enum { |
enum { |
| 106 |
/* The functions */ |
/* The functions */ |
| 107 |
|
|
| 108 |
extern int regcomp(regex_t *, const char *, int); |
extern int regcomp(regex_t *, const char *, int); |
| 109 |
extern int regexec(regex_t *, const char *, size_t, regmatch_t *, int); |
extern int regexec(const regex_t *, const char *, size_t, regmatch_t *, int); |
| 110 |
extern size_t regerror(int, const regex_t *, char *, size_t); |
extern size_t regerror(int, const regex_t *, char *, size_t); |
| 111 |
extern void regfree(regex_t *); |
extern void regfree(regex_t *); |
| 112 |
|
|
| 113 |
|
#ifdef __cplusplus |
| 114 |
|
} /* extern "C" */ |
| 115 |
|
#endif |
| 116 |
|
|
| 117 |
#endif /* End of pcreposix.h */ |
#endif /* End of pcreposix.h */ |