1 /* $XConsortium: def.h /main/30 1996/12/04 10:11:12 swick $ */
2 /* $XFree86: xc/config/makedepend/def.h,v 3.3 1997/01/12 10:38:17 dawes Exp $ */
5 Copyright (c) 1993, 1994 X Consortium
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 Except as contained in this notice, the name of the X Consortium shall not be
25 used in advertising or otherwise to promote the sale, use or other dealings
26 in this Software without prior written authorization from the X Consortium.
31 #include "Xfuncproto.h"
33 #ifndef X_NOT_STDC_ENV
42 #include <sys/types.h>
46 #define MAXDEFINES 512
49 #define SYMTABINC 10 /* must be > 1 for define() to work right */
53 /* the following must match the directives table in main.c */
70 #define IFFALSE 16 /* pseudo value --- never matched */
71 #define ELIFFALSE 17 /* pseudo value --- never matched */
72 #define INCLUDEDOT 18 /* pseudo value --- never matched */
73 #define IFGUESSFALSE 19 /* pseudo value --- never matched */
74 #define ELIFGUESSFALSE 20 /* pseudo value --- never matched */
77 extern int _debugmask;
81 * 0 show ifn*(def)*,endif
82 * 1 trace defined/!defined
84 * 3 show #include SYMBOL
87 #define debug(level,arg) { if (_debugmask & (1 << level)) warning arg; }
89 #define debug(level,arg) /**/
92 typedef unsigned char boolean;
100 #define DEFCHECKED (1<<0) /* whether defines have been checked */
101 #define NOTIFIED (1<<1) /* whether we have revealed includes */
102 #define MARKED (1<<2) /* whether it's in the makefile */
103 #define SEARCHED (1<<3) /* whether we have read this */
104 #define FINISHED (1<<4) /* whether we are done reading this */
105 #define INCLUDED_SYM (1<<5) /* whether #include SYMBOL was found
106 Can't use i_list if TRUE */
108 char *i_incstring; /* string from #include line */
109 char *i_file; /* path name of the include file */
110 struct inclist **i_list; /* list of files it itself includes */
111 int i_listlen; /* length of i_list */
112 struct symtab **i_defs; /* symbol table for this file and its
113 children when merged */
114 int i_ndefs; /* current # defines */
115 boolean *i_merged; /* whether we have merged child
117 unsigned char i_flags;
128 #ifndef X_NOT_STDC_ENV
130 #if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */
131 char *malloc(), *realloc();
141 struct symtab **slookup();
142 struct symtab **isdefined();
143 struct symtab **fdefined();
144 struct filepointer *getfile();
145 struct inclist *newinclude();
146 struct inclist *inc_path();
148 #if NeedVarargsPrototypes
149 extern void fatalerr(char *, ...);
150 extern void warning(char *, ...);
151 extern void warning1(char *, ...);