]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/xlint/lint1/lint.h
Remove i386 XBOX support.
[FreeBSD/FreeBSD.git] / usr.bin / xlint / lint1 / lint.h
1 /*      $NetBSD: lint.h,v 1.2 1995/07/03 21:24:18 cgd 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  * $FreeBSD$
34  */
35
36 #include <sys/types.h>
37 #include <stdio.h>
38 #include <stddef.h>
39
40 #include "param.h"
41
42 /*
43  * Type specifiers, used in type structures (type_t) and otherwere.
44  */
45 typedef enum {
46         NOTSPEC,
47         SIGNED,         /* keyword "signed", only used in the parser */
48         UNSIGN,         /* keyword "unsigned", only used in the parser */
49         CHAR,           /* char */
50         SCHAR,          /* signed char */
51         UCHAR,          /* unsigned char */
52         SHORT,          /* (signed) short */
53         USHORT,         /* unsigned short */
54         INT,            /* (signed) int */
55         UINT,           /* unsigned int */
56         LONG,           /* (signed) long */
57         ULONG,          /* unsigned long */
58         QUAD,           /* (signed) long long */
59         UQUAD,          /* unsigned long long */
60         FLOAT,          /* float */
61         DOUBLE,         /* double or, with tflag, long float */
62         LDOUBLE,        /* long double */
63         VOID,           /* void */
64         STRUCT,         /* structure tag */
65         UNION,          /* union tag */
66         ENUM,           /* enum tag */
67         PTR,            /* pointer */
68         ARRAY,          /* array */
69         FUNC            /* function */
70 #define NTSPEC          ((int)FUNC + 1)
71 } tspec_t;
72
73 /*
74  * size of types, name and classification
75  */
76 typedef struct {
77         int     tt_sz;                  /* size in bits */
78         int     tt_psz;                 /* size, different from tt_sz
79                                            if pflag is set */
80         tspec_t tt_styp;                /* signed counterpart */
81         tspec_t tt_utyp;                /* unsigned counterpart */
82         u_int   tt_isityp : 1;          /* 1 if integer type */
83         u_int   tt_isutyp : 1;          /* 1 if unsigned integer type */
84         u_int   tt_isftyp : 1;          /* 1 if floating point type */
85         u_int   tt_isatyp : 1;          /* 1 if arithmetic type */
86         u_int   tt_issclt : 1;          /* 1 if scalar type */
87         char    *tt_name;               /* type name */
88 } ttab_t;
89
90 #define size(t)         (ttab[t].tt_sz)
91 #define psize(t)        (ttab[t].tt_psz)
92 #define styp(t)         (ttab[t].tt_styp)
93 #define utyp(t)         (ttab[t].tt_utyp)
94 #define isityp(t)       (ttab[t].tt_isityp)
95 #define isutyp(t)       (ttab[t].tt_isutyp)
96 #define isftyp(t)       (ttab[t].tt_isftyp)
97 #define isatyp(t)       (ttab[t].tt_isatyp)
98 #define issclt(t)       (ttab[t].tt_issclt)
99
100 extern  ttab_t  ttab[];
101
102
103 typedef enum {
104         NODECL,                 /* until now not declared */
105         DECL,                   /* declared */
106         TDEF,                   /* tentative defined */
107         DEF                     /* defined */
108 } def_t;
109
110 /*
111  * Following structure contains some data used for the output buffer.
112  */
113 typedef struct  ob {
114         char    *o_buf;         /* buffer */
115         char    *o_end;         /* first byte after buffer */
116         size_t  o_len;          /* length of buffer */
117         char    *o_nxt;         /* next free byte in buffer */
118 } ob_t;
119
120 #include "externs.h"