Annotation of src/usr.bin/awk/proto.h, Revision 1.18
1.18 ! millert 1: /* $OpenBSD: proto.h,v 1.17 2020/06/10 21:05:50 millert Exp $ */
1.1 tholo 2: /****************************************************************
1.3 kstailey 3: Copyright (C) Lucent Technologies 1997
1.1 tholo 4: All Rights Reserved
5:
6: Permission to use, copy, modify, and distribute this software and
7: its documentation for any purpose and without fee is hereby
8: granted, provided that the above copyright notice appear in all
9: copies and that both that the copyright notice and this
10: permission notice and warranty disclaimer appear in supporting
1.3 kstailey 11: documentation, and that the name Lucent Technologies or any of
12: its entities not be used in advertising or publicity pertaining
13: to distribution of the software without specific, written prior
14: permission.
15:
16: LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17: INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
18: IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
19: SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
20: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
21: IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
22: ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
23: THIS SOFTWARE.
1.1 tholo 24: ****************************************************************/
25:
1.2 millert 26: extern int yywrap(void);
1.1 tholo 27: extern void setfname(Cell *);
28: extern int constnode(Node *);
29: extern char *strnode(Node *);
30: extern Node *notnull(Node *);
31: extern int yyparse(void);
32:
33: extern int yylex(void);
34: extern void startreg(void);
1.2 millert 35: extern int input(void);
36: extern void unput(int);
1.7 millert 37: extern void unputstr(const char *);
1.2 millert 38: extern int yylook(void);
39: extern int yyback(int *, int);
40: extern int yyinput(void);
1.1 tholo 41:
1.16 millert 42: extern fa *makedfa(const char *, bool);
43: extern fa *mkdfa(const char *, bool);
44: extern int makeinit(fa *, bool);
1.1 tholo 45: extern void penter(Node *);
46: extern void freetr(Node *);
1.15 millert 47: extern int hexstr(const uschar **);
48: extern int quoted(const uschar **);
1.7 millert 49: extern char *cclenter(const char *);
1.18 ! millert 50: extern noreturn void overflo(const char *);
1.1 tholo 51: extern void cfoll(fa *, Node *);
52: extern int first(Node *);
53: extern void follow(Node *);
1.7 millert 54: extern int member(int, const char *);
55: extern int match(fa *, const char *);
56: extern int pmatch(fa *, const char *);
57: extern int nematch(fa *, const char *);
1.16 millert 58: extern bool fnematch(fa *, FILE *, char **, int *, int);
1.7 millert 59: extern Node *reparse(const char *);
1.1 tholo 60: extern Node *regexp(void);
61: extern Node *primary(void);
62: extern Node *concat(Node *);
63: extern Node *alt(Node *);
64: extern Node *unary(Node *);
65: extern int relex(void);
66: extern int cgoto(fa *, int, int);
67: extern void freefa(fa *);
68:
69: extern int pgetc(void);
1.5 millert 70: extern char *cursource(void);
1.1 tholo 71:
72: extern Node *nodealloc(int);
73: extern Node *exptostat(Node *);
74: extern Node *node1(int, Node *);
75: extern Node *node2(int, Node *, Node *);
76: extern Node *node3(int, Node *, Node *, Node *);
77: extern Node *node4(int, Node *, Node *, Node *, Node *);
78: extern Node *stat3(int, Node *, Node *, Node *);
79: extern Node *op2(int, Node *, Node *);
80: extern Node *op1(int, Node *);
81: extern Node *stat1(int, Node *);
82: extern Node *op3(int, Node *, Node *, Node *);
83: extern Node *op4(int, Node *, Node *, Node *, Node *);
84: extern Node *stat2(int, Node *, Node *);
85: extern Node *stat4(int, Node *, Node *, Node *, Node *);
1.3 kstailey 86: extern Node *celltonode(Cell *, int);
1.1 tholo 87: extern Node *rectonode(void);
88: extern Node *makearr(Node *);
89: extern Node *pa2stat(Node *, Node *, Node *);
90: extern Node *linkum(Node *, Node *);
91: extern void defn(Cell *, Node *, Node *);
1.7 millert 92: extern int isarg(const char *);
1.15 millert 93: extern const char *tokname(int);
1.5 millert 94: extern Cell *(*proctab[])(Node **, int);
95: extern int ptoi(void *);
96: extern Node *itonp(int);
1.1 tholo 97:
98: extern void syminit(void);
99: extern void arginit(int, char **);
100: extern void envinit(char **);
101: extern Array *makesymtab(int);
102: extern void freesymtab(Cell *);
1.7 millert 103: extern void freeelem(Cell *, const char *);
104: extern Cell *setsymtab(const char *, const char *, double, unsigned int, Array *);
105: extern int hash(const char *, int);
1.1 tholo 106: extern void rehash(Array *);
1.7 millert 107: extern Cell *lookup(const char *, Array *);
1.1 tholo 108: extern double setfval(Cell *, double);
1.7 millert 109: extern void funnyvar(Cell *, const char *);
110: extern char *setsval(Cell *, const char *);
1.1 tholo 111: extern double getfval(Cell *);
112: extern char *getsval(Cell *);
1.7 millert 113: extern char *getpssval(Cell *); /* for print */
114: extern char *tostring(const char *);
1.17 millert 115: extern char *tostringN(const char *, size_t);
1.7 millert 116: extern char *qstring(const char *, int);
1.13 millert 117: extern Cell *catstr(Cell *, Cell *);
1.1 tholo 118:
119: extern void recinit(unsigned int);
120: extern void initgetrec(void);
1.3 kstailey 121: extern void makefields(int, int);
122: extern void growfldtab(int n);
1.13 millert 123: extern void savefs(void);
1.16 millert 124: extern int getrec(char **, int *, bool);
1.1 tholo 125: extern void nextfile(void);
1.17 millert 126: extern int readrec(char **buf, int *bufsize, FILE *inf, bool isnew);
1.1 tholo 127: extern char *getargv(int);
128: extern void setclvar(char *);
129: extern void fldbld(void);
130: extern void cleanfld(int, int);
131: extern void newfld(int);
1.12 millert 132: extern void setlastfld(int);
1.7 millert 133: extern int refldbld(const char *, const char *);
1.1 tholo 134: extern void recbld(void);
135: extern Cell *fieldadr(int);
1.7 millert 136: extern void yyerror(const char *);
1.1 tholo 137: extern void bracecheck(void);
138: extern void bcheck2(int, int, int);
1.17 millert 139: extern void SYNTAX(const char *, ...)
140: __attribute__((__format__(__printf__, 1, 2)));
1.18 ! millert 141: extern noreturn void FATAL(const char *, ...)
! 142: __attribute__((__format__(__printf__, 1, 2)));
1.17 millert 143: extern void WARNING(const char *, ...)
144: __attribute__((__format__(__printf__, 1, 2)));
1.6 millert 145: extern void error(void);
1.1 tholo 146: extern void eprint(void);
147: extern void bclass(int);
1.7 millert 148: extern double errcheck(double, const char *);
149: extern int isclvar(const char *);
150: extern int is_number(const char *);
1.1 tholo 151:
1.7 millert 152: extern int adjbuf(char **pb, int *sz, int min, int q, char **pbp, const char *what);
1.1 tholo 153: extern void run(Node *);
154: extern Cell *execute(Node *);
155: extern Cell *program(Node **, int);
156: extern Cell *call(Node **, int);
157: extern Cell *copycell(Cell *);
158: extern Cell *arg(Node **, int);
159: extern Cell *jump(Node **, int);
1.8 millert 160: extern Cell *awkgetline(Node **, int);
1.1 tholo 161: extern Cell *getnf(Node **, int);
162: extern Cell *array(Node **, int);
1.4 millert 163: extern Cell *awkdelete(Node **, int);
1.1 tholo 164: extern Cell *intest(Node **, int);
165: extern Cell *matchop(Node **, int);
166: extern Cell *boolop(Node **, int);
167: extern Cell *relop(Node **, int);
168: extern void tfree(Cell *);
169: extern Cell *gettemp(void);
170: extern Cell *field(Node **, int);
171: extern Cell *indirect(Node **, int);
172: extern Cell *substr(Node **, int);
173: extern Cell *sindex(Node **, int);
1.7 millert 174: extern int format(char **, int *, const char *, Node *);
1.1 tholo 175: extern Cell *awksprintf(Node **, int);
176: extern Cell *awkprintf(Node **, int);
177: extern Cell *arith(Node **, int);
178: extern double ipow(double, int);
179: extern Cell *incrdecr(Node **, int);
180: extern Cell *assign(Node **, int);
181: extern Cell *cat(Node **, int);
182: extern Cell *pastat(Node **, int);
183: extern Cell *dopa2(Node **, int);
184: extern Cell *split(Node **, int);
185: extern Cell *condexpr(Node **, int);
186: extern Cell *ifstat(Node **, int);
187: extern Cell *whilestat(Node **, int);
188: extern Cell *dostat(Node **, int);
189: extern Cell *forstat(Node **, int);
190: extern Cell *instat(Node **, int);
191: extern Cell *bltin(Node **, int);
192: extern Cell *printstat(Node **, int);
193: extern Cell *nullproc(Node **, int);
194: extern FILE *redirect(int, Node *);
1.17 millert 195: extern FILE *openfile(int, const char *, bool *);
1.7 millert 196: extern const char *filename(FILE *);
1.1 tholo 197: extern Cell *closefile(Node **, int);
198: extern void closeall(void);
199: extern Cell *sub(Node **, int);
200: extern Cell *gsub(Node **, int);
201:
202: extern FILE *popen(const char *, const char *);
203: extern int pclose(FILE *);
1.12 millert 204:
205: extern const char *flags2str(int flags);