]>
Commit | Line | Data |
---|---|---|
9697c820 AF |
1 | /* |
2 | * Definitions etc. for regexp(3) routines. | |
3 | * | |
4 | * Caveat: this is V8 regexp(3) [actually, a reimplementation thereof], | |
5 | * not the System V one. | |
6 | */ | |
7 | ||
8 | #ifndef REGEXP_H | |
9 | #define REGEXP_H | |
10 | ||
11 | ||
12 | /* | |
13 | http://www.opensource.apple.com/darwinsource/10.3/expect-1/expect/expect.h , | |
14 | which contains a version of this library, says: | |
15 | ||
16 | * | |
17 | * NSUBEXP must be at least 10, and no greater than 117 or the parser | |
18 | * will not work properly. | |
19 | * | |
20 | ||
21 | However, it looks rather like this library is limited to 10. If you think | |
22 | otherwise, let us know. | |
23 | */ | |
24 | ||
25 | #define NSUBEXP 10 | |
26 | typedef struct regexp { | |
27 | char *startp[NSUBEXP]; | |
28 | char *endp[NSUBEXP]; | |
29 | char regstart; /* Internal use only. */ | |
30 | char reganch; /* Internal use only. */ | |
31 | char *regmust; /* Internal use only. */ | |
32 | int regmlen; /* Internal use only. */ | |
33 | char program[1]; /* Unwarranted chumminess with compiler. */ | |
34 | } regexp; | |
35 | ||
36 | regexp * regcomp(char *exp, int *patternsize); | |
37 | int regexec(regexp *prog, char *string); | |
38 | void regsub(regexp *prog, char *source, char *dest); | |
39 | void regerror(char *s); | |
40 | ||
41 | #endif |