PageRenderTime 48ms CodeModel.GetById 8ms app.highlight 36ms RepoModel.GetById 1ms app.codeStats 0ms

/usr.bin/xlint/lint1/externs1.h

https://bitbucket.org/freebsd/freebsd-head/
C++ Header | 285 lines | 203 code | 21 blank | 61 comment | 0 complexity | 007323e5edc6a579d5924bdb075dbe34 MD5 | raw file
  1/*	$NetBSD: externs1.h,v 1.13 2002/01/18 21:01:39 thorpej Exp $	*/
  2
  3/*
  4 * Copyright (c) 1994, 1995 Jochen Pohl
  5 * All Rights Reserved.
  6 *
  7 * Redistribution and use in source and binary forms, with or without
  8 * modification, are permitted provided that the following conditions
  9 * are met:
 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
 18 *	The NetBSD Project.
 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.
 21 *
 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.
 32 */
 33
 34/*
 35 * main.c
 36 */
 37extern	int	aflag;
 38extern	int	bflag;
 39extern	int	cflag;
 40extern	int	dflag;
 41extern	int	eflag;
 42extern	int	Fflag;
 43extern	int	gflag;
 44extern	int	hflag;
 45extern	int	rflag;
 46extern	int	sflag;
 47extern	int	tflag;
 48extern	int	uflag;
 49extern	int	vflag;
 50extern	int	yflag;
 51extern	int	wflag;
 52extern	int	zflag;
 53
 54extern	void	norecover(void);
 55
 56/*
 57 * cgram.y
 58 */
 59extern	int	blklev;
 60extern	int	mblklev;
 61extern	int	yydebug;
 62
 63extern	int	yyerror(char *);
 64extern	int	yyparse(void);
 65
 66/*
 67 * scan.l
 68 */
 69extern	pos_t	curr_pos;
 70extern	pos_t	csrc_pos;
 71extern	symt_t	symtyp;
 72extern	FILE	*yyin;
 73extern	uint64_t qbmasks[], qlmasks[], qumasks[];
 74
 75extern	void	initscan(void);
 76extern	int	sign(int64_t, tspec_t, int);
 77extern	int	msb(int64_t, tspec_t, int);
 78extern	int64_t	xsign(int64_t, tspec_t, int);
 79extern	void	clrwflgs(void);
 80extern	sym_t	*getsym(sbuf_t *);
 81extern	void	cleanup(void);
 82extern	sym_t	*pushdown(sym_t *);
 83extern	void	rmsym(sym_t *);
 84extern	void	rmsyms(sym_t *);
 85extern	void	inssym(int, sym_t *);
 86extern	void	freeyyv(void *, int);
 87extern	int	yylex(void);
 88
 89/*
 90 * mem1.c
 91 */
 92extern	const	char *fnalloc(const char *);
 93extern	const	char *fnnalloc(const char *, size_t);
 94extern	int	getfnid(const char *);
 95
 96extern	void	initmem(void);
 97
 98extern	void	*getblk(size_t);
 99extern	void	*getlblk(int, size_t);
100extern	void	freeblk(void);
101extern	void	freelblk(int);
102
103extern	void	*tgetblk(size_t);
104extern	tnode_t	*getnode(void);
105extern	void	tfreeblk(void);
106extern	struct	mbl *tsave(void);
107extern	void	trestor(struct mbl *);
108
109/*
110 * err.c
111 */
112extern	int	nerr;
113extern	int	sytxerr;
114extern	const	char *msgs[];
115
116extern	void	msglist(void);
117extern	void	error(int, ...);
118extern	void	warning(int, ...);
119extern	void	message(int, ...);
120extern	int	gnuism(int, ...);
121extern	void	lerror(const char *, ...)
122     __attribute__((__noreturn__,__format__(__printf__, 1, 2)));
123
124/*
125 * decl.c
126 */
127extern	dinfo_t	*dcs;
128extern	const	char *unnamed;
129extern	int	enumval;
130
131extern	void	initdecl(void);
132extern	type_t	*gettyp(tspec_t);
133extern	type_t	*duptyp(const type_t *);
134extern	type_t	*tduptyp(const type_t *);
135extern	int	incompl(type_t *);
136extern	void	setcompl(type_t *, int);
137extern	void	addscl(scl_t);
138extern	void	addtype(type_t *);
139extern	void	addqual(tqual_t);
140extern	void	pushdecl(scl_t);
141extern	void	popdecl(void);
142extern	void	setasm(void);
143extern	void	clrtyp(void);
144extern	void	deftyp(void);
145extern	int	length(type_t *, const char *);
146extern	int	getbound(type_t *);
147extern	sym_t	*lnklst(sym_t *, sym_t *);
148extern	void	chktyp(sym_t *);
149extern	sym_t	*decl1str(sym_t *);
150extern	sym_t	*bitfield(sym_t *, int);
151extern	pqinf_t	*mergepq(pqinf_t *, pqinf_t *);
152extern	sym_t	*addptr(sym_t *, pqinf_t *);
153extern	sym_t	*addarray(sym_t *, int, int);
154extern	sym_t	*addfunc(sym_t *, sym_t *);
155extern	void	chkfdef(sym_t *, int);
156extern	sym_t	*dname(sym_t *);
157extern	sym_t	*iname(sym_t *);
158extern	type_t	*mktag(sym_t *, tspec_t, int, int);
159extern	const	char *scltoa(scl_t);
160extern	type_t	*compltag(type_t *, sym_t *);
161extern	sym_t	*ename(sym_t *, int, int);
162extern	void	decl1ext(sym_t *, int);
163extern	void	cpuinfo(sym_t *, sym_t *);
164extern	int	isredec(sym_t *, int *);
165extern	int	eqtype(type_t *, type_t *, int, int, int *);
166extern	void	compltyp(sym_t *, sym_t *);
167extern	sym_t	*decl1arg(sym_t *, int);
168extern	void	cluparg(void);
169extern	void	decl1loc(sym_t *, int);
170extern	sym_t	*aname(void);
171extern	void	globclup(void);
172extern	sym_t	*decl1abs(sym_t *);
173extern	void	chksz(sym_t *);
174extern	void	setsflg(sym_t *);
175extern	void	setuflg(sym_t *, int, int);
176extern	void	chkusage(dinfo_t *);
177extern	void	chkusg1(int, sym_t *);
178extern	void	chkglsyms(void);
179extern	void	prevdecl(int, sym_t *);
180
181/*
182 * tree.c
183 */
184extern	void	initmtab(void);
185extern	type_t	*incref(type_t *, tspec_t);
186extern	type_t	*tincref(type_t *, tspec_t);
187extern	tnode_t	*getcnode(type_t *, val_t *);
188extern	tnode_t	*getnnode(sym_t *, int);
189extern	tnode_t	*getsnode(strg_t *);
190extern	sym_t	*strmemb(tnode_t *, op_t, sym_t *);
191extern	tnode_t	*build(op_t, tnode_t *, tnode_t *);
192extern	tnode_t	*cconv(tnode_t *);
193extern	int	typeok(op_t, int, tnode_t *, tnode_t *);
194extern	tnode_t	*promote(op_t, int, tnode_t *);
195extern	tnode_t	*convert(op_t, int, type_t *, tnode_t *);
196extern	void	cvtcon(op_t, int, type_t *, val_t *, val_t *);
197extern	const	char *tyname(type_t *);
198extern	tnode_t	*bldszof(type_t *);
199extern	tnode_t	*cast(tnode_t *, type_t *);
200extern	tnode_t	*funcarg(tnode_t *, tnode_t *);
201extern	tnode_t	*funccall(tnode_t *, tnode_t *);
202extern	val_t	*constant(tnode_t *);
203extern	void	expr(tnode_t *, int, int);
204extern	void	chkmisc(tnode_t *, int, int, int, int, int, int);
205extern	int	conaddr(tnode_t *, sym_t **, ptrdiff_t *);
206extern	strg_t	*catstrg(strg_t *, strg_t *);
207
208/*
209 * func.c
210 */
211extern	sym_t	*funcsym;
212extern	int	reached;
213extern	int	rchflg;
214extern	int	ftflg;
215extern	int	nargusg;
216extern	pos_t	aupos;
217extern	int	nvararg;
218extern	pos_t	vapos;
219extern	int	prflstrg;
220extern	pos_t	prflpos;
221extern	int	scflstrg;
222extern	pos_t	scflpos;
223extern	int	ccflg;
224extern	int	llibflg;
225extern	int	nowarn;
226extern	int	bitfieldtype_ok;
227extern	int	plibflg;
228extern	int	quadflg;
229
230extern	void	pushctrl(int);
231extern	void	popctrl(int);
232extern	void	chkreach(void);
233extern	void	funcdef(sym_t *);
234extern	void	funcend(void);
235extern	void	label(int, sym_t *, tnode_t *);
236extern	void	if1(tnode_t *);
237extern	void	if2(void);
238extern	void	if3(int);
239extern	void	switch1(tnode_t *);
240extern	void	switch2(void);
241extern	void	while1(tnode_t *);
242extern	void	while2(void);
243extern	void	do1(void);
244extern	void	do2(tnode_t *);
245extern	void	for1(tnode_t *, tnode_t *, tnode_t *);
246extern	void	for2(void);
247extern	void	dogoto(sym_t *);
248extern	void	docont(void);
249extern	void	dobreak(void);
250extern	void	doreturn(tnode_t *);
251extern	void	glclup(int);
252extern	void	argsused(int);
253extern	void	constcond(int);
254extern	void	fallthru(int);
255extern	void	notreach(int);
256extern	void	lintlib(int);
257extern	void	linted(int);
258extern	void	varargs(int);
259extern	void	printflike(int);
260extern	void	scanflike(int);
261extern	void	protolib(int);
262extern	void	longlong(int);
263extern	void	bitfieldtype(int);
264
265/*
266 * init.c
267 */
268extern	int	initerr;
269extern	sym_t	*initsym;
270extern	int	startinit;
271
272extern	void	prepinit(void);
273extern	void	initrbr(void);
274extern	void	initlbr(void);
275extern	void	mkinit(tnode_t *);
276
277/*
278 * emit.c
279 */
280extern	void	outtype(type_t *);
281extern	const	char *ttos(type_t *);
282extern	void	outsym(sym_t *, scl_t, def_t);
283extern	void	outfdef(sym_t *, pos_t *, int, int, sym_t *);
284extern	void	outcall(tnode_t *, int, int);
285extern	void	outusg(sym_t *);