-
Notifications
You must be signed in to change notification settings - Fork 0
/
regex.h
35 lines (27 loc) · 594 Bytes
/
regex.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
#ifndef regex_h
#define regex_h
#define regcomp js_regcomp
#define regexec js_regexec
#define regfree js_regfree
typedef struct Reprog Reprog;
typedef struct Resub Resub;
Reprog *regcomp(const char *pattern, int cflags, const char **errorp);
int regexec(Reprog *prog, const char *string, Resub *sub, int eflags);
void regfree(Reprog *prog);
enum {
/* regcomp flags */
REG_ICASE = 1,
REG_NEWLINE = 2,
/* regexec flags */
REG_NOTBOL = 4,
/* limits */
REG_MAXSUB = 16
};
struct Resub {
unsigned int nsub;
struct {
const char *sp;
const char *ep;
} sub[REG_MAXSUB];
};
#endif