Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/one-true-awk/awk.h
Show First 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | |||||
/* #define freeable(p) (!((p)->tval & DONTFREE)) */ | /* #define freeable(p) (!((p)->tval & DONTFREE)) */ | ||||
#define freeable(p) ( ((p)->tval & (STR|DONTFREE)) == STR ) | #define freeable(p) ( ((p)->tval & (STR|DONTFREE)) == STR ) | ||||
/* structures used by regular expression matching machinery, mostly b.c: */ | /* structures used by regular expression matching machinery, mostly b.c: */ | ||||
#define NCHARS (256+3) /* 256 handles 8-bit chars; 128 does 7-bit */ | #define NCHARS (256+3) /* 256 handles 8-bit chars; 128 does 7-bit */ | ||||
/* watch out in match(), etc. */ | /* watch out in match(), etc. */ | ||||
#define NSTATES 32 | #define NSTATES 32 | ||||
#define HAT (NCHARS+2) /* matches ^ in regular expr */ | |||||
/* NCHARS is 2**n */ | |||||
typedef struct rrow { | typedef struct rrow { | ||||
long ltype; /* long avoids pointer warnings on 64-bit */ | long ltype; /* long avoids pointer warnings on 64-bit */ | ||||
union { | union { | ||||
int i; | int i; | ||||
Node *np; | Node *np; | ||||
uschar *up; | uschar *up; | ||||
} lval; /* because Al stores a pointer in it! */ | } lval; /* because Al stores a pointer in it! */ | ||||
int *lfollow; | int *lfollow; | ||||
} rrow; | } rrow; | ||||
typedef struct fa { | typedef struct fa { | ||||
uschar gototab[NSTATES][NCHARS]; | uschar gototab[NSTATES][HAT + 1]; | ||||
uschar out[NSTATES]; | uschar out[NSTATES]; | ||||
uschar *restr; | uschar *restr; | ||||
int *posns[NSTATES]; | int *posns[NSTATES]; | ||||
int anchor; | int anchor; | ||||
int use; | int use; | ||||
int initstat; | int initstat; | ||||
int curstat; | int curstat; | ||||
int accept; | int accept; | ||||
int reset; | int reset; | ||||
struct rrow re[1]; /* variable: actual size set by calling malloc */ | struct rrow re[1]; /* variable: actual size set by calling malloc */ | ||||
} fa; | } fa; | ||||
#include "proto.h" | #include "proto.h" |