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