185587Sobrien/**************************************************************** 285587SobrienCopyright (C) Lucent Technologies 1997 385587SobrienAll Rights Reserved 485587Sobrien 585587SobrienPermission to use, copy, modify, and distribute this software and 685587Sobrienits documentation for any purpose and without fee is hereby 785587Sobriengranted, provided that the above copyright notice appear in all 885587Sobriencopies and that both that the copyright notice and this 985587Sobrienpermission notice and warranty disclaimer appear in supporting 1085587Sobriendocumentation, and that the name Lucent Technologies or any of 1185587Sobrienits entities not be used in advertising or publicity pertaining 1285587Sobriento distribution of the software without specific, written prior 1385587Sobrienpermission. 1485587Sobrien 1585587SobrienLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 1685587SobrienINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. 1785587SobrienIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY 1885587SobrienSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 1985587SobrienWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 2085587SobrienIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 2185587SobrienARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 2285587SobrienTHIS SOFTWARE. 2385587Sobrien****************************************************************/ 2485587Sobrien 2585587Sobrienextern int yywrap(void); 2685587Sobrienextern void setfname(Cell *); 2785587Sobrienextern int constnode(Node *); 2885587Sobrienextern char *strnode(Node *); 2985587Sobrienextern Node *notnull(Node *); 3085587Sobrienextern int yyparse(void); 3185587Sobrien 3285587Sobrienextern int yylex(void); 3385587Sobrienextern void startreg(void); 3485587Sobrienextern int input(void); 3585587Sobrienextern void unput(int); 36107806Sobrienextern void unputstr(const char *); 3785587Sobrienextern int yylook(void); 3885587Sobrienextern int yyback(int *, int); 3985587Sobrienextern int yyinput(void); 4085587Sobrien 41107806Sobrienextern fa *makedfa(const char *, int); 42107806Sobrienextern fa *mkdfa(const char *, int); 4385587Sobrienextern int makeinit(fa *, int); 4485587Sobrienextern void penter(Node *); 4585587Sobrienextern void freetr(Node *); 46224731Sruextern int hexstr(uschar **); 47224731Sruextern int quoted(uschar **); 48107806Sobrienextern char *cclenter(const char *); 49244988Sdelphijextern void overflo(const char *) __attribute__((__noreturn__)); 5085587Sobrienextern void cfoll(fa *, Node *); 5185587Sobrienextern int first(Node *); 5285587Sobrienextern void follow(Node *); 53107806Sobrienextern int member(int, const char *); 54107806Sobrienextern int match(fa *, const char *); 55107806Sobrienextern int pmatch(fa *, const char *); 56107806Sobrienextern int nematch(fa *, const char *); 57107806Sobrienextern Node *reparse(const char *); 5885587Sobrienextern Node *regexp(void); 5985587Sobrienextern Node *primary(void); 6085587Sobrienextern Node *concat(Node *); 6185587Sobrienextern Node *alt(Node *); 6285587Sobrienextern Node *unary(Node *); 6385587Sobrienextern int relex(void); 6485587Sobrienextern int cgoto(fa *, int, int); 6585587Sobrienextern void freefa(fa *); 6685587Sobrien 6785587Sobrienextern int pgetc(void); 6885587Sobrienextern char *cursource(void); 6985587Sobrien 7085587Sobrienextern Node *nodealloc(int); 7185587Sobrienextern Node *exptostat(Node *); 7285587Sobrienextern Node *node1(int, Node *); 7385587Sobrienextern Node *node2(int, Node *, Node *); 7485587Sobrienextern Node *node3(int, Node *, Node *, Node *); 7585587Sobrienextern Node *node4(int, Node *, Node *, Node *, Node *); 7685587Sobrienextern Node *stat3(int, Node *, Node *, Node *); 7785587Sobrienextern Node *op2(int, Node *, Node *); 7885587Sobrienextern Node *op1(int, Node *); 7985587Sobrienextern Node *stat1(int, Node *); 8085587Sobrienextern Node *op3(int, Node *, Node *, Node *); 8185587Sobrienextern Node *op4(int, Node *, Node *, Node *, Node *); 8285587Sobrienextern Node *stat2(int, Node *, Node *); 8385587Sobrienextern Node *stat4(int, Node *, Node *, Node *, Node *); 8485587Sobrienextern Node *celltonode(Cell *, int); 8585587Sobrienextern Node *rectonode(void); 8685587Sobrienextern Node *makearr(Node *); 8785587Sobrienextern Node *pa2stat(Node *, Node *, Node *); 8885587Sobrienextern Node *linkum(Node *, Node *); 8985587Sobrienextern void defn(Cell *, Node *, Node *); 90107806Sobrienextern int isarg(const char *); 9185587Sobrienextern char *tokname(int); 9285587Sobrienextern Cell *(*proctab[])(Node **, int); 9385587Sobrienextern int ptoi(void *); 9485587Sobrienextern Node *itonp(int); 9585587Sobrien 9685587Sobrienextern void syminit(void); 9785587Sobrienextern void arginit(int, char **); 9885587Sobrienextern void envinit(char **); 9985587Sobrienextern Array *makesymtab(int); 10085587Sobrienextern void freesymtab(Cell *); 101107806Sobrienextern void freeelem(Cell *, const char *); 102107806Sobrienextern Cell *setsymtab(const char *, const char *, double, unsigned int, Array *); 103107806Sobrienextern int hash(const char *, int); 10485587Sobrienextern void rehash(Array *); 105107806Sobrienextern Cell *lookup(const char *, Array *); 10685587Sobrienextern double setfval(Cell *, double); 107107806Sobrienextern void funnyvar(Cell *, const char *); 108107806Sobrienextern char *setsval(Cell *, const char *); 10985587Sobrienextern double getfval(Cell *); 11085587Sobrienextern char *getsval(Cell *); 111107806Sobrienextern char *getpssval(Cell *); /* for print */ 112107806Sobrienextern char *tostring(const char *); 113107806Sobrienextern char *qstring(const char *, int); 11485587Sobrien 11585587Sobrienextern void recinit(unsigned int); 11685587Sobrienextern void initgetrec(void); 11785587Sobrienextern void makefields(int, int); 11885587Sobrienextern void growfldtab(int n); 11985587Sobrienextern int getrec(char **, int *, int); 12085587Sobrienextern void nextfile(void); 12185587Sobrienextern int readrec(char **buf, int *bufsize, FILE *inf); 12285587Sobrienextern char *getargv(int); 12385587Sobrienextern void setclvar(char *); 12485587Sobrienextern void fldbld(void); 12585587Sobrienextern void cleanfld(int, int); 12685587Sobrienextern void newfld(int); 127107806Sobrienextern int refldbld(const char *, const char *); 12885587Sobrienextern void recbld(void); 12985587Sobrienextern Cell *fieldadr(int); 130107806Sobrienextern void yyerror(const char *); 13185587Sobrienextern void fpecatch(int); 13285587Sobrienextern void bracecheck(void); 13385587Sobrienextern void bcheck2(int, int, int); 134107806Sobrienextern void SYNTAX(const char *, ...); 135244988Sdelphijextern void FATAL(const char *, ...) __attribute__((__noreturn__)); 136107806Sobrienextern void WARNING(const char *, ...); 13785587Sobrienextern void error(void); 13885587Sobrienextern void eprint(void); 13985587Sobrienextern void bclass(int); 140107806Sobrienextern double errcheck(double, const char *); 141107806Sobrienextern int isclvar(const char *); 142107806Sobrienextern int is_number(const char *); 14385587Sobrien 144107806Sobrienextern int adjbuf(char **pb, int *sz, int min, int q, char **pbp, const char *what); 14585587Sobrienextern void run(Node *); 14685587Sobrienextern Cell *execute(Node *); 14785587Sobrienextern Cell *program(Node **, int); 14885587Sobrienextern Cell *call(Node **, int); 14985587Sobrienextern Cell *copycell(Cell *); 15085587Sobrienextern Cell *arg(Node **, int); 15185587Sobrienextern Cell *jump(Node **, int); 152201951Sruextern Cell *awkgetline(Node **, int); 15385587Sobrienextern Cell *getnf(Node **, int); 15485587Sobrienextern Cell *array(Node **, int); 15585587Sobrienextern Cell *awkdelete(Node **, int); 15685587Sobrienextern Cell *intest(Node **, int); 15785587Sobrienextern Cell *matchop(Node **, int); 15885587Sobrienextern Cell *boolop(Node **, int); 15985587Sobrienextern Cell *relop(Node **, int); 16085587Sobrienextern void tfree(Cell *); 16185587Sobrienextern Cell *gettemp(void); 16285587Sobrienextern Cell *field(Node **, int); 16385587Sobrienextern Cell *indirect(Node **, int); 16485587Sobrienextern Cell *substr(Node **, int); 16585587Sobrienextern Cell *sindex(Node **, int); 166107806Sobrienextern int format(char **, int *, const char *, Node *); 16785587Sobrienextern Cell *awksprintf(Node **, int); 16885587Sobrienextern Cell *awkprintf(Node **, int); 16985587Sobrienextern Cell *arith(Node **, int); 17085587Sobrienextern double ipow(double, int); 17185587Sobrienextern Cell *incrdecr(Node **, int); 17285587Sobrienextern Cell *assign(Node **, int); 17385587Sobrienextern Cell *cat(Node **, int); 17485587Sobrienextern Cell *pastat(Node **, int); 17585587Sobrienextern Cell *dopa2(Node **, int); 17685587Sobrienextern Cell *split(Node **, int); 17785587Sobrienextern Cell *condexpr(Node **, int); 17885587Sobrienextern Cell *ifstat(Node **, int); 17985587Sobrienextern Cell *whilestat(Node **, int); 18085587Sobrienextern Cell *dostat(Node **, int); 18185587Sobrienextern Cell *forstat(Node **, int); 18285587Sobrienextern Cell *instat(Node **, int); 18385587Sobrienextern Cell *bltin(Node **, int); 18485587Sobrienextern Cell *printstat(Node **, int); 18585587Sobrienextern Cell *nullproc(Node **, int); 18685587Sobrienextern FILE *redirect(int, Node *); 187107806Sobrienextern FILE *openfile(int, const char *); 188107806Sobrienextern const char *filename(FILE *); 18985587Sobrienextern Cell *closefile(Node **, int); 19085587Sobrienextern void closeall(void); 19185587Sobrienextern Cell *sub(Node **, int); 19285587Sobrienextern Cell *gsub(Node **, int); 19385587Sobrien 19485587Sobrienextern FILE *popen(const char *, const char *); 19585587Sobrienextern int pclose(FILE *); 196