]> git.lizzy.rs Git - plan9front.git/blob - sys/include/regexp.h
merge
[plan9front.git] / sys / include / regexp.h
1 #pragma src "/sys/src/libregexp"
2 #pragma lib "libregexp.a"
3 enum
4 {
5         OANY = 0,
6         OBOL,
7         OCLASS,
8         OEOL,
9         OJMP,
10         ONOTNL,
11         ORUNE,
12         OSAVE,
13         OSPLIT,
14         OUNSAVE,
15 };
16
17 typedef struct Resub Resub;
18 typedef struct Reinst Reinst;
19 typedef struct Reprog Reprog;
20 typedef struct Rethread Rethread;
21
22 #pragma incomplete Reinst
23 #pragma incomplete Rethread
24
25 struct Resub
26 {
27         union
28         {
29                 char *sp;
30                 Rune *rsp;
31         };
32         union
33         {
34                 char *ep;
35                 Rune *rep;
36         };
37 };
38 struct Reprog
39 {
40         Reinst *startinst;
41         Rethread *threads;
42         char *regstr;
43         int len;
44         int nthr;
45 };
46
47 Reprog* regcomp(char*);
48 Reprog* regcomplit(char*);
49 Reprog* regcompnl(char*);
50 void    regerror(char*);
51 int     regexec(Reprog*, char*, Resub*, int);
52 void    regsub(char*, char*, int, Resub*, int);
53 int     rregexec(Reprog*, Rune*, Resub*, int);
54 void    rregsub(Rune*, Rune*, int, Resub*, int);
55 int     reprogfmt(Fmt *);