-
Notifications
You must be signed in to change notification settings - Fork 0
/
regexp-lexer.h
47 lines (37 loc) · 1.25 KB
/
regexp-lexer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef _REGEXP_H
#define _REGEXP_H
/*
* Definitions etc. for regexp(3) routines.
*
* Caveat: this is V8 regexp(3) [actually, a reimplementation thereof],
* not the System V one.
*/
// Convert from data being char* to data being in a struct...
typedef wint_t CHAR;
CHAR XSTRING[10240]; // global!!!
typedef int CHARINDEX;
#define NSUBEXP 10
typedef struct regexp {
CHARINDEX startp[NSUBEXP];
CHARINDEX endp[NSUBEXP];
wchar_t regstart; /* Internal use only. */
wchar_t reganch; /* Internal use only. */
wchar_t *regmust; /* Internal use only. */
int regmlen; /* Internal use only. */
wchar_t program[1]; /* Unwarranted chumminess with compiler. */
} regexp;
/*
* The first byte of the regexp internal "program" is actually this magic
* number; the start node begins in the second byte.
*/
#define MAGIC (unsigned char)0234
/* Headers for regexp.c */
extern regexp *regcomp(const wchar_t *exp);
extern int regexec(regexp *prog, CHARINDEX string);
extern int regsub(regexp *prog, wchar_t *source, wchar_t *dest);
extern void regerror(wchar_t *s);
/* End of headers for regexp.c */
#ifdef DEBUG
extern void regdump(regexp *r);
#endif
#endif /* _REGEXP_H */