1 /* $NetBSD: externs1.h,v 1.13 2002/01/18 21:01:39 thorpej Exp $ */
4 * Copyright (c) 1994, 1995 Jochen Pohl
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by Jochen Pohl for
19 * 4. The name of the author may not be used to endorse or promote products
20 * derived from this software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 extern void norecover(void);
63 extern int yyerror(char *);
64 extern int yyparse(void);
69 extern pos_t curr_pos
;
70 extern pos_t csrc_pos
;
73 extern uint64_t qbmasks
[], qlmasks
[], qumasks
[];
75 extern void initscan(void);
76 extern int sign(int64_t, tspec_t
, int);
77 extern int msb(int64_t, tspec_t
, int);
78 extern int64_t xsign(int64_t, tspec_t
, int);
79 extern void clrwflgs(void);
80 extern sym_t
*getsym(sbuf_t
*);
81 extern void cleanup(void);
82 extern sym_t
*pushdown(sym_t
*);
83 extern void rmsym(sym_t
*);
84 extern void rmsyms(sym_t
*);
85 extern void inssym(int, sym_t
*);
86 extern void freeyyv(void *, int);
87 extern int yylex(void);
92 extern const char *fnalloc(const char *);
93 extern const char *fnnalloc(const char *, size_t);
94 extern int getfnid(const char *);
96 extern void initmem(void);
98 extern void *getblk(size_t);
99 extern void *getlblk(int, size_t);
100 extern void freeblk(void);
101 extern void freelblk(int);
103 extern void *tgetblk(size_t);
104 extern tnode_t
*getnode(void);
105 extern void tfreeblk(void);
106 extern struct mbl
*tsave(void);
107 extern void trestor(struct mbl
*);
114 extern const char *msgs
[];
116 extern void msglist(void);
117 extern void error(int, ...);
118 extern void warning(int, ...);
119 extern void message(int, ...);
120 extern int gnuism(int, ...);
121 extern void lerror(const char *, ...)
122 __attribute__((__noreturn__
,__format__(__printf__
, 1, 2)));
128 extern const char *unnamed
;
131 extern void initdecl(void);
132 extern type_t
*gettyp(tspec_t
);
133 extern type_t
*duptyp(const type_t
*);
134 extern type_t
*tduptyp(const type_t
*);
135 extern int incompl(type_t
*);
136 extern void setcompl(type_t
*, int);
137 extern void addscl(scl_t
);
138 extern void addtype(type_t
*);
139 extern void addqual(tqual_t
);
140 extern void pushdecl(scl_t
);
141 extern void popdecl(void);
142 extern void setasm(void);
143 extern void clrtyp(void);
144 extern void deftyp(void);
145 extern int length(type_t
*, const char *);
146 extern int getbound(type_t
*);
147 extern sym_t
*lnklst(sym_t
*, sym_t
*);
148 extern void chktyp(sym_t
*);
149 extern sym_t
*decl1str(sym_t
*);
150 extern sym_t
*bitfield(sym_t
*, int);
151 extern pqinf_t
*mergepq(pqinf_t
*, pqinf_t
*);
152 extern sym_t
*addptr(sym_t
*, pqinf_t
*);
153 extern sym_t
*addarray(sym_t
*, int, int);
154 extern sym_t
*addfunc(sym_t
*, sym_t
*);
155 extern void chkfdef(sym_t
*, int);
156 extern sym_t
*dname(sym_t
*);
157 extern sym_t
*iname(sym_t
*);
158 extern type_t
*mktag(sym_t
*, tspec_t
, int, int);
159 extern const char *scltoa(scl_t
);
160 extern type_t
*compltag(type_t
*, sym_t
*);
161 extern sym_t
*ename(sym_t
*, int, int);
162 extern void decl1ext(sym_t
*, int);
163 extern void cpuinfo(sym_t
*, sym_t
*);
164 extern int isredec(sym_t
*, int *);
165 extern int eqtype(type_t
*, type_t
*, int, int, int *);
166 extern void compltyp(sym_t
*, sym_t
*);
167 extern sym_t
*decl1arg(sym_t
*, int);
168 extern void cluparg(void);
169 extern void decl1loc(sym_t
*, int);
170 extern sym_t
*aname(void);
171 extern void globclup(void);
172 extern sym_t
*decl1abs(sym_t
*);
173 extern void chksz(sym_t
*);
174 extern void setsflg(sym_t
*);
175 extern void setuflg(sym_t
*, int, int);
176 extern void chkusage(dinfo_t
*);
177 extern void chkusg1(int, sym_t
*);
178 extern void chkglsyms(void);
179 extern void prevdecl(int, sym_t
*);
184 extern void initmtab(void);
185 extern type_t
*incref(type_t
*, tspec_t
);
186 extern type_t
*tincref(type_t
*, tspec_t
);
187 extern tnode_t
*getcnode(type_t
*, val_t
*);
188 extern tnode_t
*getnnode(sym_t
*, int);
189 extern tnode_t
*getsnode(strg_t
*);
190 extern sym_t
*strmemb(tnode_t
*, op_t
, sym_t
*);
191 extern tnode_t
*build(op_t
, tnode_t
*, tnode_t
*);
192 extern tnode_t
*cconv(tnode_t
*);
193 extern int typeok(op_t
, int, tnode_t
*, tnode_t
*);
194 extern tnode_t
*promote(op_t
, int, tnode_t
*);
195 extern tnode_t
*convert(op_t
, int, type_t
*, tnode_t
*);
196 extern void cvtcon(op_t
, int, type_t
*, val_t
*, val_t
*);
197 extern const char *tyname(type_t
*);
198 extern tnode_t
*bldszof(type_t
*);
199 extern tnode_t
*cast(tnode_t
*, type_t
*);
200 extern tnode_t
*funcarg(tnode_t
*, tnode_t
*);
201 extern tnode_t
*funccall(tnode_t
*, tnode_t
*);
202 extern val_t
*constant(tnode_t
*);
203 extern void expr(tnode_t
*, int, int);
204 extern void chkmisc(tnode_t
*, int, int, int, int, int, int);
205 extern int conaddr(tnode_t
*, sym_t
**, ptrdiff_t *);
206 extern strg_t
*catstrg(strg_t
*, strg_t
*);
211 extern sym_t
*funcsym
;
220 extern pos_t prflpos
;
222 extern pos_t scflpos
;
226 extern int bitfieldtype_ok
;
230 extern void pushctrl(int);
231 extern void popctrl(int);
232 extern void chkreach(void);
233 extern void funcdef(sym_t
*);
234 extern void funcend(void);
235 extern void label(int, sym_t
*, tnode_t
*);
236 extern void if1(tnode_t
*);
237 extern void if2(void);
238 extern void if3(int);
239 extern void switch1(tnode_t
*);
240 extern void switch2(void);
241 extern void while1(tnode_t
*);
242 extern void while2(void);
243 extern void do1(void);
244 extern void do2(tnode_t
*);
245 extern void for1(tnode_t
*, tnode_t
*, tnode_t
*);
246 extern void for2(void);
247 extern void dogoto(sym_t
*);
248 extern void docont(void);
249 extern void dobreak(void);
250 extern void doreturn(tnode_t
*);
251 extern void glclup(int);
252 extern void argsused(int);
253 extern void constcond(int);
254 extern void fallthru(int);
255 extern void notreach(int);
256 extern void lintlib(int);
257 extern void linted(int);
258 extern void varargs(int);
259 extern void printflike(int);
260 extern void scanflike(int);
261 extern void protolib(int);
262 extern void longlong(int);
263 extern void bitfieldtype(int);
269 extern sym_t
*initsym
;
270 extern int startinit
;
272 extern void prepinit(void);
273 extern void initrbr(void);
274 extern void initlbr(void);
275 extern void mkinit(tnode_t
*);
280 extern void outtype(type_t
*);
281 extern const char *ttos(type_t
*);
282 extern void outsym(sym_t
*, scl_t
, def_t
);
283 extern void outfdef(sym_t
*, pos_t
*, int, int, sym_t
*);
284 extern void outcall(tnode_t
*, int, int);
285 extern void outusg(sym_t
*);