1
/*************************************************
2
* Perl-Compatible Regular Expressions *
3
*************************************************/
5
/* Copyright (c) 1997-2001 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 */
24
/* Options defined by POSIX. */
26
#define REG_ICASE 0x01
27
#define REG_NEWLINE 0x02
28
#define REG_NOTBOL 0x04
29
#define REG_NOTEOL 0x08
31
/* These are not used by PCRE, but by defining them we make it easier
32
to slot PCRE into existing programs that make POSIX calls. */
34
#define REG_EXTENDED 0
37
/* Error values. Not all these are relevant or used by the wrapper. */
40
REG_ASSERT = 1, /* internal error ? */
41
REG_BADBR, /* invalid repeat counts in {} */
42
REG_BADPAT, /* pattern error */
43
REG_BADRPT, /* ? * + invalid */
44
REG_EBRACE, /* unbalanced {} */
45
REG_EBRACK, /* unbalanced [] */
46
REG_ECOLLATE, /* collation error - not relevant */
47
REG_ECTYPE, /* bad class */
48
REG_EESCAPE, /* bad escape sequence */
49
REG_EMPTY, /* empty expression */
50
REG_EPAREN, /* unbalanced () */
51
REG_ERANGE, /* bad range inside [] */
52
REG_ESIZE, /* expression too big */
53
REG_ESPACE, /* failed to get memory */
54
REG_ESUBREG, /* bad back reference */
55
REG_INVARG, /* bad argument */
56
REG_NOMATCH /* match failed */
60
/* The structure representing a compiled regular expression. */
68
/* The structure in which a captured offset is returned. */
79
extern int regcomp(regex_t *, const char *, int);
80
extern int regexec(regex_t *, const char *, size_t, regmatch_t *, int);
81
extern size_t regerror(int, const regex_t *, char *, size_t);
82
extern void regfree(regex_t *);
88
#endif /* End of pcreposix.h */