1 /*************************************************
2 * Perl-Compatible Regular Expressions *
3 *************************************************/
5 /* Copyright (c) 1997-2000 University of Cambridge */
8 * @file include/pcreposix.h
9 * @brief PCRE definitions
15 /* This is the header for the POSIX wrapper interface to the PCRE Perl-
16 Compatible Regular Expression library. It defines the things POSIX says should
19 /* Have to include stdlib.h in order to ensure that size_t is defined. */
23 /* Allow for C++ users */
29 /* Options defined by POSIX. */
32 #define REG_ICASE 0x01
33 /** Don't match newlines with wildcards */
34 #define REG_NEWLINE 0x02
35 /** Don't match BOL */
36 #define REG_NOTBOL 0x04
37 /** Don't match EOL */
38 #define REG_NOTEOL 0x08
40 /* These are not used by PCRE, but by defining them we make it easier
41 to slot PCRE into existing programs that make POSIX calls. */
44 #define REG_EXTENDED 0
48 /* 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. */
79 /* The structure in which a captured offset is returned. */
90 extern int regcomp(regex_t *, const char *, int);
91 extern int regexec(regex_t *, const char *, size_t, regmatch_t *, int);
92 extern size_t regerror(int, const regex_t *, char *, size_t);
93 extern void regfree(regex_t *);
99 #endif /* End of pcreposix.h */