Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
7641 views
1
#ifndef regex_h
2
#define regex_h
3
4
#define regcomp js_regcomp
5
#define regexec js_regexec
6
#define regfree js_regfree
7
8
typedef struct Reprog Reprog;
9
typedef struct Resub Resub;
10
11
Reprog *regcomp(const char *pattern, int cflags, const char **errorp);
12
int regexec(Reprog *prog, const char *string, Resub *sub, int eflags);
13
void regfree(Reprog *prog);
14
15
enum {
16
/* regcomp flags */
17
REG_ICASE = 1,
18
REG_NEWLINE = 2,
19
20
/* regexec flags */
21
REG_NOTBOL = 4,
22
23
/* limits */
24
REG_MAXSUB = 16
25
};
26
27
struct Resub {
28
unsigned int nsub;
29
struct {
30
const char *sp;
31
const char *ep;
32
} sub[REG_MAXSUB];
33
};
34
35
#endif
36
37