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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (hide annotations) (download)
Sat Feb 24 21:38:01 2007 UTC (7 years, 8 months ago) by nigel
Original Path: code/trunk/pcreposix.h
File MIME type: text/plain
File size: 2039 byte(s)
Load pcre-1.00 into code/trunk.

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

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12