3 #ifndef _REGEXP_EXTENSION
4 This header file is an extension to ANSI/POSIX
6 #pragma lib "/$M/lib/ape/libregexp.a"
14 typedef struct Resub Resub;
15 typedef struct Reclass Reclass;
16 typedef struct Reinst Reinst;
17 typedef struct Reprog Reprog;
20 * Sub expression matches
36 * character class, each pair of rune's defines a range
44 * Machine instructions
47 int type; /* < 0200 ==> literal, otherwise action */
49 Reclass *cp; /* class pointer */
50 wchar_t r; /* character */
51 int subid; /* sub-expression id for RBRA and LBRA */
52 Reinst *right; /* right child of OR */
54 union { /* regexp relies on these two being in the same union */
55 Reinst *left; /* left child of OR */
56 Reinst *next; /* next instruction for CAT & LBRA */
61 * Reprogram definition
64 Reinst *startinst; /* start pc */
65 Reclass class[16]; /* .data */
66 Reinst firstinst[5]; /* .text */
69 extern Reprog *regcomp(char*);
70 extern Reprog *regcomplit(char*);
71 extern Reprog *regcompnl(char*);
72 extern void regerror(char*);
73 extern int regexec(Reprog*, char*, Resub*, int);
74 extern void regsub(char*, char*, int, Resub*, int);
75 extern int rregexec(Reprog*, wchar_t*, Resub*, int);
76 extern void rregsub(wchar_t*, wchar_t*, int, Resub*, int);