1 f7012583 2003-11-25 devnull #ifndef _REGEXP9_H_
2 f7012583 2003-11-25 devnull #define _REGEXP9_H_ 1
3 f7012583 2003-11-25 devnull #if defined(__cplusplus)
4 f7012583 2003-11-25 devnull extern "C" {
7 b2cfc4e2 2003-09-30 devnull #include <utf.h>
9 b2cfc4e2 2003-09-30 devnull typedef struct Resub Resub;
10 b2cfc4e2 2003-09-30 devnull typedef struct Reclass Reclass;
11 b2cfc4e2 2003-09-30 devnull typedef struct Reinst Reinst;
12 b2cfc4e2 2003-09-30 devnull typedef struct Reprog Reprog;
15 b2cfc4e2 2003-09-30 devnull * Sub expression matches
17 b2cfc4e2 2003-09-30 devnull struct Resub{
20 b2cfc4e2 2003-09-30 devnull char *sp;
21 b2cfc4e2 2003-09-30 devnull Rune *rsp;
25 b2cfc4e2 2003-09-30 devnull char *ep;
26 b2cfc4e2 2003-09-30 devnull Rune *rep;
31 b2cfc4e2 2003-09-30 devnull * character class, each pair of rune's defines a range
33 b2cfc4e2 2003-09-30 devnull struct Reclass{
34 b2cfc4e2 2003-09-30 devnull Rune *end;
35 b2cfc4e2 2003-09-30 devnull Rune spans[64];
39 b2cfc4e2 2003-09-30 devnull * Machine instructions
41 b2cfc4e2 2003-09-30 devnull struct Reinst{
42 b2cfc4e2 2003-09-30 devnull int type;
44 b2cfc4e2 2003-09-30 devnull Reclass *cp; /* class pointer */
45 b2cfc4e2 2003-09-30 devnull Rune r; /* character */
46 b2cfc4e2 2003-09-30 devnull int subid; /* sub-expression id for RBRA and LBRA */
47 b2cfc4e2 2003-09-30 devnull Reinst *right; /* right child of OR */
49 b2cfc4e2 2003-09-30 devnull union { /* regexp relies on these two being in the same union */
50 b2cfc4e2 2003-09-30 devnull Reinst *left; /* left child of OR */
51 b2cfc4e2 2003-09-30 devnull Reinst *next; /* next instruction for CAT & LBRA */
56 b2cfc4e2 2003-09-30 devnull * Reprogram definition
58 b2cfc4e2 2003-09-30 devnull struct Reprog{
59 b2cfc4e2 2003-09-30 devnull Reinst *startinst; /* start pc */
60 b2cfc4e2 2003-09-30 devnull Reclass class[16]; /* .data */
61 b2cfc4e2 2003-09-30 devnull Reinst firstinst[5]; /* .text */
64 54952cec 2003-11-24 devnull extern Reprog *regcomp9(char*);
65 54952cec 2003-11-24 devnull extern Reprog *regcomplit9(char*);
66 54952cec 2003-11-24 devnull extern Reprog *regcompnl9(char*);
67 54952cec 2003-11-24 devnull extern void regerror9(char*);
68 54952cec 2003-11-24 devnull extern int regexec9(Reprog*, char*, Resub*, int);
69 54952cec 2003-11-24 devnull extern void regsub9(char*, char*, int, Resub*, int);
71 54952cec 2003-11-24 devnull extern int rregexec9(Reprog*, Rune*, Resub*, int);
72 230d62c4 2004-03-05 devnull extern void rregsub9(Rune*, Rune*, int, Resub*, int);
75 54952cec 2003-11-24 devnull * Darwin simply cannot handle having routines that
76 54952cec 2003-11-24 devnull * override other library routines.
78 54952cec 2003-11-24 devnull #ifndef NOPLAN9DEFINES
79 54952cec 2003-11-24 devnull #define regcomp regcomp9
80 54952cec 2003-11-24 devnull #define regcomplit regcomplit9
81 54952cec 2003-11-24 devnull #define regcompnl regcompnl9
82 54952cec 2003-11-24 devnull #define regerror regerror9
83 54952cec 2003-11-24 devnull #define regexec regexec9
84 54952cec 2003-11-24 devnull #define regsub regsub9
85 54952cec 2003-11-24 devnull #define rregexec rregexec9
86 54952cec 2003-11-24 devnull #define rregsub rregsub9
89 f7012583 2003-11-25 devnull #if defined(__cplusplus)