1
/*************************************************
2
* Perl-Compatible Regular Expressions *
3
*************************************************/
5
/* Copyright (c) 1997-2000 University of Cambridge */
10
/* This is the header for the POSIX wrapper interface to the PCRE Perl-
11
Compatible Regular Expression library. It defines the things POSIX says should
14
/* Have to include stdlib.h in order to ensure that size_t is defined. */
18
/* Allow for C++ users */
26
#define __PCRE_PROTO(a) a
28
#define __PCRE_PROTO(a) ()
31
/* Options defined by POSIX. */
33
#define REG_ICASE 0x01
34
#define REG_NEWLINE 0x02
35
#define REG_NOTBOL 0x04
36
#define REG_NOTEOL 0x08
37
#define REG_EXTENDED 0x10
40
#define REG_DOTALL 0x40
42
/* These are not used by PCRE, but by defining them we make it easier
43
to slot PCRE into existing programs that make POSIX calls. */
47
/* Error values. Not all these are relevant or used by the wrapper. */
51
REG_ASSERT = 1, /* internal error ? */
52
REG_BADBR, /* invalid repeat counts in {} */
53
REG_BADPAT, /* pattern error */
54
REG_BADRPT, /* ? * + invalid */
55
REG_EBRACE, /* unbalanced {} */
56
REG_EBRACK, /* unbalanced [] */
57
REG_ECOLLATE, /* collation error - not relevant */
58
REG_ECTYPE, /* bad class */
59
REG_EESCAPE, /* bad escape sequence */
60
REG_EMPTY, /* empty expression */
61
REG_EPAREN, /* unbalanced () */
62
REG_ERANGE, /* bad range inside [] */
63
REG_ESIZE, /* expression too big */
64
REG_ESPACE, /* failed to get memory */
65
REG_ESUBREG, /* bad back reference */
66
REG_INVARG, /* bad argument */
67
REG_NOMATCH /* match failed */
71
/* The structure representing a compiled regular expression. */
82
/* The structure in which a captured offset is returned. */
95
extern int regcomp __PCRE_PROTO ((regex_t *, const char *, int));
96
extern int regncomp __PCRE_PROTO ((regex_t *, const char *, int, int));
97
extern int regexec __PCRE_PROTO ((regex_t *, const char *, size_t,
99
extern int regnexec __PCRE_PROTO ((regex_t *, const char *, int, size_t,
101
extern int regexec2 __PCRE_PROTO ((regex_t *, const char *, int, int, size_t,
103
extern size_t regerror __PCRE_PROTO ((int, const regex_t *, char *, size_t));
104
extern void regfree __PCRE_PROTO ((regex_t *));