1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* $XConsortium: def.h,v 1.25 94/04/17 20:10:33 gildea 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 <X11/Xosdefs.h>
33 #include <X11/Xw32defs.h>
36 #include <X11/Xfuncproto.h>
52 #include <sys/types.h>
57 #define S_IFDIR 0040000
61 #define S_IFREG 0100000
64 #define MAXFILES 65536
67 #define SYMHASHSEED 131 /* 131 1313 13131 ... */
68 #define SYMHASHMEMBERS 64 /* must be 2^x to work right */
72 /* the following must match the directives table in main.c */
76 #define IFFALSE 15 /* pseudo value --- never matched */
77 #define ELIFFALSE 16 /* pseudo value --- never matched */
78 #define ELIFGUESSFALSE 19 /* pseudo value --- never matched */
81 extern int _debugmask
;
85 * 0 show ifn*(def)*,endif
86 * 1 trace defined/!defined
88 * 3 show #include SYMBOL
91 #define debug(level,arg) { if (_debugmask & (1 << level)) warning arg; }
93 #define debug(level,arg) /**/
96 // VG: a C++ class for information about directories
97 #include "collectdircontent.hxx"
99 typedef unsigned char boolean
;
108 struct pair
*s_pairs
[SYMHASHMEMBERS
];
112 char *i_incstring
; /* string from #include line */
113 char *i_file
; /* path name of the include file */
114 struct inclist
**i_list
; /* list of files it itself includes */
115 int i_listlen
; /* length of i_list */
116 boolean i_notified
; /* whether we have revealed includes */
117 boolean i_marked
; /* whether it's in the makefile */
118 boolean i_searched
; /* whether we have read this */
128 #ifndef X_NOT_STDC_ENV
129 #if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */
130 char *malloc(), *realloc();
137 char *copy(char const *);
138 char *base_name(char *);
139 char *get_line(struct filepointer
*);
140 char *isdefined(char *);
141 struct filepointer
*getfile(char *);
142 struct inclist
*newinclude(char const *newfile
,
143 char const *incstring
);
144 struct inclist
*inc_path(char *, char *, boolean
,
145 struct IncludesCollection
*);
147 void define( char *def
, struct symhash
**symbols
);
148 void hash_define(char *name
, char const * val
, struct symhash
**symbols
);
149 struct symhash
*hash_copy( struct symhash
*symbols
);
150 void hash_free( struct symhash
*symbols
);
151 void freefile( struct filepointer
* fp
);
152 int find_includes(struct filepointer
*filep
, struct inclist
*file
,
153 struct inclist
*file_red
, int recursion
, boolean failOK
,
154 struct IncludesCollection
* incCollection
, struct symhash
*symbols
);
155 void included_by(struct inclist
*ip
,
156 struct inclist
* newfile
);
157 int cppsetup(char const *line
);
158 void add_include(struct filepointer
*filep
, struct inclist
*file
,
159 struct inclist
*file_red
, char *include
, boolean dot
, boolean failOK
,
160 struct IncludesCollection
* incCollection
, struct symhash
*symbols
);
161 int match(char const *str
, char **list
);
162 void recursive_pr_include(struct inclist
*head
, char *file
,
164 void recursive_pr_dummy(struct inclist
*head
, char *file
);
165 void inc_clean(void);
167 void fatalerr(char *, ...);
168 void warning(char const *, ...);
169 void warning1(char const *, ...);
171 void convert_slashes(char *);
172 char *append_slash(char *);
174 extern char * directives
[];
176 extern struct inclist inclist
[ MAXFILES
];
177 extern struct inclist
* inclistp
;
179 extern char *includedirs
[ ];
181 extern char * objprefix
;
183 extern char * objsuffix
;
185 extern boolean printed
;
187 extern boolean verbose
;
189 extern boolean show_where_not
;
191 extern boolean warn_multiple
;
193 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */