/[pcre]/code/tags/pcre-2.08/pcreposix.h
ViewVC logotype

Contents of /code/tags/pcre-2.08/pcreposix.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 40 - (show annotations) (download)
Sat Feb 24 21:39:15 2007 UTC (7 years, 5 months ago) by nigel
File MIME type: text/plain
File size: 2159 byte(s)
Tag code/trunk as code/tags/pcre-2.08.

1 /*************************************************
2 * Perl-Compatible Regular Expressions *
3 *************************************************/
4
5 /* Copyright (c) 1997-1999 University of Cambridge */
6
7 #ifndef _PCREPOSIX_H
8 #define _PCREPOSIX_H
9
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
12 be there. I hope. */
13
14 /* Have to include stdlib.h in order to ensure that size_t is defined. */
15
16 #include <stdlib.h>
17
18 /* Allow for C++ users */
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 /* Options defined by POSIX. */
25
26 #define REG_ICASE 0x01
27 #define REG_NEWLINE 0x02
28 #define REG_NOTBOL 0x04
29 #define REG_NOTEOL 0x08
30
31 /* Error values. Not all these are relevant or used by the wrapper. */
32
33 enum {
34 REG_ASSERT = 1, /* internal error ? */
35 REG_BADBR, /* invalid repeat counts in {} */
36 REG_BADPAT, /* pattern error */
37 REG_BADRPT, /* ? * + invalid */
38 REG_EBRACE, /* unbalanced {} */
39 REG_EBRACK, /* unbalanced [] */
40 REG_ECOLLATE, /* collation error - not relevant */
41 REG_ECTYPE, /* bad class */
42 REG_EESCAPE, /* bad escape sequence */
43 REG_EMPTY, /* empty expression */
44 REG_EPAREN, /* unbalanced () */
45 REG_ERANGE, /* bad range inside [] */
46 REG_ESIZE, /* expression too big */
47 REG_ESPACE, /* failed to get memory */
48 REG_ESUBREG, /* bad back reference */
49 REG_INVARG, /* bad argument */
50 REG_NOMATCH /* match failed */
51 };
52
53
54 /* The structure representing a compiled regular expression. */
55
56 typedef struct {
57 void *re_pcre;
58 size_t re_nsub;
59 size_t re_erroffset;
60 } regex_t;
61
62 /* The structure in which a captured offset is returned. */
63
64 typedef int regoff_t;
65
66 typedef struct {
67 regoff_t rm_so;
68 regoff_t rm_eo;
69 } regmatch_t;
70
71 /* The functions */
72
73 extern int regcomp(regex_t *, const char *, int);
74 extern int regexec(regex_t *, const char *, size_t, regmatch_t *, int);
75 extern size_t regerror(int, const regex_t *, char *, size_t);
76 extern void regfree(regex_t *);
77
78 #ifdef __cplusplus
79 } /* extern "C" */
80 #endif
81
82 #endif /* End of pcreposix.h */

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12