1 /* $NetBSD: externs1.h,v 1.28 2009/10/02 15:03:45 christos 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.
56 extern void norecover(void);
65 extern int yyerror(const char *);
66 extern int yyparse(void);
71 extern pos_t curr_pos
;
72 extern pos_t csrc_pos
;
75 extern uint64_t qbmasks
[], qlmasks
[], qumasks
[];
77 extern void initscan(void);
78 extern int sign(int64_t, tspec_t
, int);
79 extern int msb(int64_t, tspec_t
, int);
80 extern int64_t xsign(int64_t, tspec_t
, int);
81 extern void clrwflgs(void);
82 extern sym_t
*getsym(sbuf_t
*);
83 extern void cleanup(void);
84 extern sym_t
*pushdown(sym_t
*);
85 extern sym_t
*mktempsym(type_t
*);
86 extern void rmsym(sym_t
*);
87 extern void rmsyms(sym_t
*);
88 extern void inssym(int, sym_t
*);
89 extern void freeyyv(void *, int);
90 extern int yylex(void);
95 extern const char *fnalloc(const char *);
96 extern const char *fnnalloc(const char *, size_t);
97 extern int getfnid(const char *);
99 extern void initmem(void);
101 extern void *getblk(size_t);
102 extern void *getlblk(size_t, size_t);
103 extern void freeblk(void);
104 extern void freelblk(int);
106 extern void *tgetblk(size_t);
107 extern tnode_t
*getnode(void);
108 extern void tfreeblk(void);
109 extern struct mbl
*tsave(void);
110 extern void trestor(struct mbl
*);
117 extern const char *msgs
[];
119 extern void msglist(void);
120 extern void error(int, ...);
121 extern void warning(int, ...);
122 extern void message(int, ...);
123 extern int gnuism(int, ...);
124 extern int c99ism(int, ...);
125 extern void lerror(const char *, int, const char *, ...)
126 __attribute__((__noreturn__
,__format__(__printf__
, 3, 4)));
132 extern const char *unnamed
;
135 extern void initdecl(void);
136 extern type_t
*gettyp(tspec_t
);
137 extern type_t
*duptyp(const type_t
*);
138 extern type_t
*tduptyp(const type_t
*);
139 extern int incompl(type_t
*);
140 extern void setcompl(type_t
*, int);
141 extern void addscl(scl_t
);
142 extern void addtype(type_t
*);
143 extern void addqual(tqual_t
);
144 extern void addpacked(void);
145 extern void pushdecl(scl_t
);
146 extern void popdecl(void);
147 extern void setasm(void);
148 extern void clrtyp(void);
149 extern void deftyp(void);
150 extern int length(type_t
*, const char *);
151 extern int getbound(type_t
*);
152 extern sym_t
*lnklst(sym_t
*, sym_t
*);
153 extern void chktyp(sym_t
*);
154 extern sym_t
*decl1str(sym_t
*);
155 extern sym_t
*bitfield(sym_t
*, int);
156 extern pqinf_t
*mergepq(pqinf_t
*, pqinf_t
*);
157 extern sym_t
*addptr(sym_t
*, pqinf_t
*);
158 extern sym_t
*addarray(sym_t
*, int, int);
159 extern sym_t
*addfunc(sym_t
*, sym_t
*);
160 extern void chkfdef(sym_t
*, int);
161 extern sym_t
*dname(sym_t
*);
162 extern sym_t
*iname(sym_t
*);
163 extern type_t
*mktag(sym_t
*, tspec_t
, int, int);
164 extern const char *scltoa(scl_t
);
165 extern type_t
*compltag(type_t
*, sym_t
*);
166 extern sym_t
*ename(sym_t
*, int, int);
167 extern void decl1ext(sym_t
*, int);
168 extern void cpuinfo(sym_t
*, sym_t
*);
169 extern int isredec(sym_t
*, int *);
170 extern int eqptrtype(type_t
*, type_t
*, int);
171 extern int eqtype(type_t
*, type_t
*, int, int, int *);
172 extern void compltyp(sym_t
*, sym_t
*);
173 extern sym_t
*decl1arg(sym_t
*, int);
174 extern void cluparg(void);
175 extern void decl1loc(sym_t
*, int);
176 extern sym_t
*aname(void);
177 extern void globclup(void);
178 extern sym_t
*decl1abs(sym_t
*);
179 extern void chksz(sym_t
*);
180 extern void setsflg(sym_t
*);
181 extern void setuflg(sym_t
*, int, int);
182 extern void chkusage(dinfo_t
*);
183 extern void chkusg1(int, sym_t
*);
184 extern void chkglsyms(void);
185 extern void prevdecl(int, sym_t
*);
190 extern void initmtab(void);
191 extern type_t
*incref(type_t
*, tspec_t
);
192 extern type_t
*tincref(type_t
*, tspec_t
);
193 extern tnode_t
*getcnode(type_t
*, val_t
*);
194 extern tnode_t
*getnnode(sym_t
*, int);
195 extern tnode_t
*getsnode(strg_t
*);
196 extern sym_t
*strmemb(tnode_t
*, op_t
, sym_t
*);
197 extern tnode_t
*build(op_t
, tnode_t
*, tnode_t
*);
198 extern tnode_t
*cconv(tnode_t
*);
199 extern int typeok(op_t
, int, tnode_t
*, tnode_t
*);
200 extern tnode_t
*promote(op_t
, int, tnode_t
*);
201 extern tnode_t
*convert(op_t
, int, type_t
*, tnode_t
*);
202 extern void cvtcon(op_t
, int, type_t
*, val_t
*, val_t
*);
203 extern tnode_t
*bldszof(type_t
*);
204 extern tnode_t
*bldalof(type_t
*);
205 extern tnode_t
*cast(tnode_t
*, type_t
*);
206 extern tnode_t
*funcarg(tnode_t
*, tnode_t
*);
207 extern tnode_t
*funccall(tnode_t
*, tnode_t
*);
208 extern val_t
*constant(tnode_t
*, int);
209 extern void expr(tnode_t
*, int, int, int);
210 extern void chkmisc(tnode_t
*, int, int, int, int, int, int);
211 extern int conaddr(tnode_t
*, sym_t
**, ptrdiff_t *);
212 extern strg_t
*catstrg(strg_t
*, strg_t
*);
213 extern int64_t tsize(type_t
*);
218 extern sym_t
*funcsym
;
227 extern pos_t prflpos
;
229 extern pos_t scflpos
;
233 extern int bitfieldtype_ok
;
237 extern void pushctrl(int);
238 extern void popctrl(int);
239 extern void chkreach(void);
240 extern void funcdef(sym_t
*);
241 extern void funcend(void);
242 extern void label(int, sym_t
*, tnode_t
*);
243 extern void if1(tnode_t
*);
244 extern void if2(void);
245 extern void if3(int);
246 extern void switch1(tnode_t
*);
247 extern void switch2(void);
248 extern void while1(tnode_t
*);
249 extern void while2(void);
250 extern void do1(void);
251 extern void do2(tnode_t
*);
252 extern void for1(tnode_t
*, tnode_t
*, tnode_t
*);
253 extern void for2(void);
254 extern void dogoto(sym_t
*);
255 extern void docont(void);
256 extern void dobreak(void);
257 extern void doreturn(tnode_t
*);
258 extern void glclup(int);
259 extern void argsused(int);
260 extern void constcond(int);
261 extern void fallthru(int);
262 extern void notreach(int);
263 extern void lintlib(int);
264 extern void linted(int);
265 extern void varargs(int);
266 extern void printflike(int);
267 extern void scanflike(int);
268 extern void protolib(int);
269 extern void longlong(int);
270 extern void bitfieldtype(int);
276 extern sym_t
*initsym
;
277 extern int startinit
;
279 extern void prepinit(void);
280 extern void initrbr(void);
281 extern void initlbr(void);
282 extern void mkinit(tnode_t
*);
283 extern void memberpush(sbuf_t
*);
288 extern void outtype(type_t
*);
289 extern const char *ttos(type_t
*);
290 extern void outsym(sym_t
*, scl_t
, def_t
);
291 extern void outfdef(sym_t
*, pos_t
*, int, int, sym_t
*);
292 extern void outcall(tnode_t
*, int, int);
293 extern void outusg(sym_t
*);
298 extern char *prtnode(char *, size_t, const tnode_t
*);