15e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes/**************************************************************** 25e21e412ce7c4ecd1987a092e7da881f7a3767dElliott HughesCopyright (C) Lucent Technologies 1997 35e21e412ce7c4ecd1987a092e7da881f7a3767dElliott HughesAll Rights Reserved 45e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 55e21e412ce7c4ecd1987a092e7da881f7a3767dElliott HughesPermission to use, copy, modify, and distribute this software and 65e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesits documentation for any purpose and without fee is hereby 75e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesgranted, provided that the above copyright notice appear in all 85e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughescopies and that both that the copyright notice and this 95e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughespermission notice and warranty disclaimer appear in supporting 105e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesdocumentation, and that the name Lucent Technologies or any of 115e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesits entities not be used in advertising or publicity pertaining 125e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesto distribution of the software without specific, written prior 135e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughespermission. 145e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 155e21e412ce7c4ecd1987a092e7da881f7a3767dElliott HughesLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 165e21e412ce7c4ecd1987a092e7da881f7a3767dElliott HughesINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. 175e21e412ce7c4ecd1987a092e7da881f7a3767dElliott HughesIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY 185e21e412ce7c4ecd1987a092e7da881f7a3767dElliott HughesSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 195e21e412ce7c4ecd1987a092e7da881f7a3767dElliott HughesWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 205e21e412ce7c4ecd1987a092e7da881f7a3767dElliott HughesIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 215e21e412ce7c4ecd1987a092e7da881f7a3767dElliott HughesARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 225e21e412ce7c4ecd1987a092e7da881f7a3767dElliott HughesTHIS SOFTWARE. 235e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes****************************************************************/ 245e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 255e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#include <assert.h> 265e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 275e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughestypedef double Awkfloat; 285e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 295e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes/* unsigned char is more trouble than it's worth */ 305e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 315e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughestypedef unsigned char uschar; 325e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 335e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define xfree(a) { if ((a) != NULL) { free((void *) (a)); (a) = NULL; } } 345e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 355e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define NN(p) ((p) ? (p) : "(null)") /* guaranteed non-null for dprintf 365e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes*/ 375e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define DEBUG 385e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#ifdef DEBUG 395e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes /* uses have to be doubly parenthesized */ 405e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes# define dprintf(x) if (dbg) printf x 415e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#else 425e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes# define dprintf(x) 435e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#endif 445e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 455e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern int compile_time; /* 1 if compiling, 0 if running */ 465e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern int safe; /* 0 => unsafe, 1 => safe */ 475e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 485e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define RECSIZE (8 * 1024) /* sets limit on records, fields, etc., etc. */ 495e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern int recsize; /* size of current record, orig RECSIZE */ 505e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 515e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern char **FS; 525e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern char **RS; 535e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern char **ORS; 545e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern char **OFS; 555e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern char **OFMT; 565e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern Awkfloat *NR; 575e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern Awkfloat *FNR; 585e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern Awkfloat *NF; 595e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern char **FILENAME; 605e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern char **SUBSEP; 615e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern Awkfloat *RSTART; 625e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern Awkfloat *RLENGTH; 635e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 645e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern char *record; /* points to $0 */ 655e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern int lineno; /* line number in awk program */ 665e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern int errorflag; /* 1 if error has occurred */ 675e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern int donefld; /* 1 if record broken into fields */ 685e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern int donerec; /* 1 if record is valid (no fld has changed */ 695e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern char inputFS[]; /* FS at time of input, for field splitting */ 705e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 715e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern int dbg; 725e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 735e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern char *patbeg; /* beginning of pattern matched */ 745e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern int patlen; /* length of pattern matched. set in b.c */ 755e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 765e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes/* Cell: all information about a variable or constant */ 775e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 785e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughestypedef struct Cell { 795e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes uschar ctype; /* OCELL, OBOOL, OJUMP, etc. */ 805e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes uschar csub; /* CCON, CTEMP, CFLD, etc. */ 815e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes char *nval; /* name, for variables only */ 825e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes char *sval; /* string value */ 835e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes Awkfloat fval; /* value as number */ 845e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int tval; /* type info: STR|NUM|ARR|FCN|FLD|CON|DONTFREE */ 855e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes struct Cell *cnext; /* ptr to next if chained */ 865e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes} Cell; 875e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 885e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughestypedef struct Array { /* symbol table array */ 895e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int nelem; /* elements in table right now */ 905e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int size; /* size of tab */ 915e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes Cell **tab; /* hash table pointers */ 925e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes} Array; 935e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 945e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define NSYMTAB 50 /* initial size of a symbol table */ 955e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern Array *symtab; 965e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 975e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern Cell *nrloc; /* NR */ 985e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern Cell *fnrloc; /* FNR */ 995e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern Cell *nfloc; /* NF */ 1005e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern Cell *rstartloc; /* RSTART */ 1015e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern Cell *rlengthloc; /* RLENGTH */ 1025e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1035e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes/* Cell.tval values: */ 1045e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define NUM 01 /* number value is valid */ 1055e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define STR 02 /* string value is valid */ 1065e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define DONTFREE 04 /* string space is not freeable */ 1075e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define CON 010 /* this is a constant */ 1085e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define ARR 020 /* this is an array */ 1095e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FCN 040 /* this is a function name */ 1105e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FLD 0100 /* this is a field $1, $2, ... */ 1115e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define REC 0200 /* this is $0 */ 1125e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1135e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1145e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes/* function types */ 1155e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FLENGTH 1 1165e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FSQRT 2 1175e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FEXP 3 1185e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FLOG 4 1195e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FINT 5 1205e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FSYSTEM 6 1215e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FRAND 7 1225e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FSRAND 8 1235e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FSIN 9 1245e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FCOS 10 1255e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FATAN 11 1265e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FTOUPPER 12 1275e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FTOLOWER 13 1285e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define FFLUSH 14 1295e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1305e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes/* Node: parse tree is made of nodes, with Cell's at bottom */ 1315e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1325e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughestypedef struct Node { 1335e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int ntype; 1345e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes struct Node *nnext; 1355e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int lineno; 1365e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int nobj; 1375e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes struct Node *narg[1]; /* variable: actual size set by calling malloc */ 1385e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes} Node; 1395e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1405e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define NIL ((Node *) 0) 1415e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1425e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern Node *winner; 1435e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern Node *nullstat; 1445e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern Node *nullnode; 1455e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1465e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes/* ctypes */ 1475e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define OCELL 1 1485e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define OBOOL 2 1495e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define OJUMP 3 1505e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1515e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes/* Cell subtypes: csub */ 1525e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define CFREE 7 1535e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define CCOPY 6 1545e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define CCON 5 1555e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define CTEMP 4 1565e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define CNAME 3 1575e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define CVAR 2 1585e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define CFLD 1 1595e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define CUNK 0 1605e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1615e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes/* bool subtypes */ 1625e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define BTRUE 11 1635e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define BFALSE 12 1645e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1655e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes/* jump subtypes */ 1665e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define JEXIT 21 1675e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define JNEXT 22 1685e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define JBREAK 23 1695e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define JCONT 24 1705e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define JRET 25 1715e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define JNEXTFILE 26 1725e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1735e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes/* node types */ 1745e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define NVALUE 1 1755e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define NSTAT 2 1765e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define NEXPR 3 1775e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1785e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1795e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughesextern int pairstack[], paircnt; 1805e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 1815e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define notlegal(n) (n <= FIRSTTOKEN || n >= LASTTOKEN || proctab[n-FIRSTTOKEN] == nullproc) 1825e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define isvalue(n) ((n)->ntype == NVALUE) 1835e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define isexpr(n) ((n)->ntype == NEXPR) 1845e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define isjump(n) ((n)->ctype == OJUMP) 1855e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define isexit(n) ((n)->csub == JEXIT) 1865e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define isbreak(n) ((n)->csub == JBREAK) 1875e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define iscont(n) ((n)->csub == JCONT) 1885e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define isnext(n) ((n)->csub == JNEXT || (n)->csub == JNEXTFILE) 1895e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define isret(n) ((n)->csub == JRET) 1905e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define isrec(n) ((n)->tval & REC) 1915e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define isfld(n) ((n)->tval & FLD) 1925e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define isstr(n) ((n)->tval & STR) 1935e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define isnum(n) ((n)->tval & NUM) 1945e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define isarr(n) ((n)->tval & ARR) 1955e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define isfcn(n) ((n)->tval & FCN) 1965e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define istrue(n) ((n)->csub == BTRUE) 1975e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define istemp(n) ((n)->csub == CTEMP) 1985e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define isargument(n) ((n)->nobj == ARG) 1995e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes/* #define freeable(p) (!((p)->tval & DONTFREE)) */ 2005e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define freeable(p) ( ((p)->tval & (STR|DONTFREE)) == STR ) 2015e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 2025e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes/* structures used by regular expression matching machinery, mostly b.c: */ 2035e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 2045e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define NCHARS (256+3) /* 256 handles 8-bit chars; 128 does 7-bit */ 2055e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes /* watch out in match(), etc. */ 2065e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#define NSTATES 32 2075e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 2085e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughestypedef struct rrow { 2095e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes long ltype; /* long avoids pointer warnings on 64-bit */ 2105e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes union { 2115e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int i; 2125e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes Node *np; 2135e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes uschar *up; 2145e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes } lval; /* because Al stores a pointer in it! */ 2155e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int *lfollow; 2165e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes} rrow; 2175e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 2185e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughestypedef struct fa { 2195e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes uschar gototab[NSTATES][NCHARS]; 2205e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes uschar out[NSTATES]; 2215e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes uschar *restr; 2225e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int *posns[NSTATES]; 2235e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int anchor; 2245e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int use; 2255e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int initstat; 2265e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int curstat; 2275e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int accept; 2285e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes int reset; 2295e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes struct rrow re[1]; /* variable: actual size set by calling malloc */ 2305e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes} fa; 2315e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 2325e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes 2335e21e412ce7c4ecd1987a092e7da881f7a3767dElliott Hughes#include "proto.h" 234