xref: /titanic_51/usr/src/tools/lintdump/lnstuff.h (revision 34c989574817eca41f72a5f02c848e51cfef32f0)
1*34c98957Smeem /*
2*34c98957Smeem  * CDDL HEADER START
3*34c98957Smeem  *
4*34c98957Smeem  * The contents of this file are subject to the terms of the
5*34c98957Smeem  * Common Development and Distribution License (the "License").
6*34c98957Smeem  * You may not use this file except in compliance with the License.
7*34c98957Smeem  *
8*34c98957Smeem  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*34c98957Smeem  * or http://www.opensolaris.org/os/licensing.
10*34c98957Smeem  * See the License for the specific language governing permissions
11*34c98957Smeem  * and limitations under the License.
12*34c98957Smeem  *
13*34c98957Smeem  * When distributing Covered Code, include this CDDL HEADER in each
14*34c98957Smeem  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*34c98957Smeem  * If applicable, add the following below this CDDL HEADER, with the
16*34c98957Smeem  * fields enclosed by brackets "[]" replaced with your own identifying
17*34c98957Smeem  * information: Portions Copyright [yyyy] [name of copyright owner]
18*34c98957Smeem  *
19*34c98957Smeem  * CDDL HEADER END
20*34c98957Smeem  */
21*34c98957Smeem 
22*34c98957Smeem /*
23*34c98957Smeem  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*34c98957Smeem  * Use is subject to license terms.
25*34c98957Smeem  */
26*34c98957Smeem 
27*34c98957Smeem /*	Copyright (c) 1989 AT&T					*/
28*34c98957Smeem /*	  All Rights Reserved  					*/
29*34c98957Smeem 
30*34c98957Smeem /*
31*34c98957Smeem  *	Based on @(#)lnstuff.h 1.5 02/06/05 from lint
32*34c98957Smeem  */
33*34c98957Smeem 
34*34c98957Smeem #pragma ident	"%Z%%M%	%I%	%E% SMI"
35*34c98957Smeem 
36*34c98957Smeem #ifndef	LNSTUFF_H
37*34c98957Smeem #define	LNSTUFF_H
38*34c98957Smeem 
39*34c98957Smeem #include <sys/types.h>
40*34c98957Smeem 
41*34c98957Smeem #define	LDI 01		/* defined and initialized: storage set aside	*/
42*34c98957Smeem #define	LIB 02		/* defined on a library				*/
43*34c98957Smeem #define	LDC 04		/* defined as a common region on UNIX		*/
44*34c98957Smeem #define	LDX 010		/* defined by an extern: if ! pflag, same as LDI */
45*34c98957Smeem #define	LRV 020		/* function returns a value			*/
46*34c98957Smeem #define	LUV 040		/* function used in a value context		*/
47*34c98957Smeem #define	LUE 0100	/* function used in effects context		*/
48*34c98957Smeem #define	LUM 0200	/* mentioned somewhere other than at the declaration */
49*34c98957Smeem #define	LDS 0400	/* defined static object (like LDI)		*/
50*34c98957Smeem #define	LFN 01000	/* filename record				*/
51*34c98957Smeem #define	LSU 02000	/* struct/union def				*/
52*34c98957Smeem #define	LPR 04000	/* prototype declaration			*/
53*34c98957Smeem #define	LND 010000	/* end module marker				*/
54*34c98957Smeem #define	LPF 020000	/* printf like					*/
55*34c98957Smeem #define	LSF 040000	/* scanf like					*/
56*34c98957Smeem 
57*34c98957Smeem #define	LNQUAL		00037		/* type w/o qualifiers		*/
58*34c98957Smeem #define	LNUNQUAL	0174000		/* remove type, keep other info */
59*34c98957Smeem #define	LCON		(1<<15)		/* type qualified by const	*/
60*34c98957Smeem #define	LVOL		(1<<14)		/* type qualified by volatile	*/
61*34c98957Smeem #define	LNOAL		(1<<13)		/* not used */
62*34c98957Smeem #define	LCONV		(1<<12)		/* type is an integer constant	*/
63*34c98957Smeem #define	LPTR		(1<<11)		/* last modifier is a pointer	*/
64*34c98957Smeem #define	LINTVER		4
65*34c98957Smeem 
66*34c98957Smeem typedef unsigned long T1WORD;
67*34c98957Smeem typedef long FILEPOS;
68*34c98957Smeem typedef short TY;
69*34c98957Smeem 
70*34c98957Smeem typedef struct flens {
71*34c98957Smeem 	long		f1, f2, f3, f4;
72*34c98957Smeem 	unsigned short	ver, mno;
73*34c98957Smeem } FLENS;
74*34c98957Smeem 
75*34c98957Smeem typedef struct {
76*34c98957Smeem 	TY		aty;		/* base type			*/
77*34c98957Smeem 	unsigned long	dcl_mod;	/* ptr/ftn/ary modifiers	*/
78*34c98957Smeem 	unsigned short	dcl_con;	/* const qualifiers		*/
79*34c98957Smeem 	unsigned short	dcl_vol;	/* volatile qualifiers		*/
80*34c98957Smeem 	union {
81*34c98957Smeem 		T1WORD	ty;
82*34c98957Smeem 		FILEPOS	pos;
83*34c98957Smeem 	} extra;
84*34c98957Smeem } ATYPE;
85*34c98957Smeem 
86*34c98957Smeem typedef struct {
87*34c98957Smeem 	short		decflag;	/* what type of record is this	*/
88*34c98957Smeem 	short		nargs;		/* # of args (or members)	*/
89*34c98957Smeem 	int		fline;		/* line defined/used in		*/
90*34c98957Smeem 	ATYPE		type;		/* type information		*/
91*34c98957Smeem } LINE;
92*34c98957Smeem 
93*34c98957Smeem union rec {
94*34c98957Smeem 	LINE l;
95*34c98957Smeem 	struct {
96*34c98957Smeem 		short decflag;
97*34c98957Smeem 		char *fn;
98*34c98957Smeem 	} f;
99*34c98957Smeem };
100*34c98957Smeem 
101*34c98957Smeem /* type modifiers */
102*34c98957Smeem #define	LN_TMASK 3
103*34c98957Smeem #define	LN_ISPTR(x)	(((x)&LN_TMASK) == 1)  /* is x a pointer type */
104*34c98957Smeem #define	LN_ISFTN(x)	(((x)&LN_TMASK) == 2)  /* is x a function type */
105*34c98957Smeem #define	LN_ISARY(x)	(((x)&LN_TMASK) == 3)  /* is x an array type */
106*34c98957Smeem 
107*34c98957Smeem /* type numbers for pass2 */
108*34c98957Smeem #define	LN_STRUCT	21	/* generic struct */
109*34c98957Smeem #define	LN_UNION	22	/* generic union */
110*34c98957Smeem 
111*34c98957Smeem #endif	/* LNSTUFF_H */
112