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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
enum{
Dump = 0, /* Actions must be in order of descending importance */
HoldHeader,
Hold,
SaveLine,
Lineoff, /* Lineoff must be the last action code */
Nactions,
Nhash = 128,
regexp = 1, /* types: literal string or regular expression */
string = 2,
MaxHtml = 256,
Hdrsize = 4096,
Bodysize = 8192,
Maxread = 64*1024
};
typedef struct spat Spat;
typedef struct pattern Pattern;
typedef struct patterns Patterns;
struct spat
{
char* string;
int len;
int c1;
Spat* next;
Spat* alt;
};
struct pattern{
struct pattern *next;
int action;
int type;
Spat* alt;
union{
Reprog* pat;
Spat* spat[Nhash];
};
};
struct patterns {
char *action;
Pattern *strings;
Pattern *regexps;
};
extern int debug;
extern Patterns patterns[];
extern char header[];
extern char cmd[];
extern void conv64(char*, char*, char*, int);
extern int convert(char*, char*, char*, int, int);
extern void* Malloc(long n);
extern int matchpat(Pattern*, char*, Resub*);
extern char* readmsg(Biobuf*, int*, int*);
extern void parsepats(Biobuf*);
extern void* Realloc(void*, ulong);
extern void xprint(int, char*, Resub*);
|