2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $TOG: def.h /main/32 1998/03/25 08:17:45 kaleb $ */
26 Copyright (c) 1993, 1994, 1998 The Open Group.
30 The above copyright notice and this permission notice shall be included in
31 all copies or substantial portions of the Software.
33 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
37 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
38 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
40 Except as contained in this notice, the name of The Open Group shall not be
41 used in advertising or otherwise to promote the sale, use or other dealings
42 in this Software without prior written authorization from The Open Group.
47 #include "Xfuncproto.h"
55 #include <sys/types.h>
59 #define MAXDEFINES 512
62 #define SYMTABINC 10 /* must be > 1 for define() to work right */
66 /* the following must match the directives table in main.c */
83 #define IFFALSE 16 /* pseudo value --- never matched */
84 #define ELIFFALSE 17 /* pseudo value --- never matched */
85 #define INCLUDEDOT 18 /* pseudo value --- never matched */
86 #define IFGUESSFALSE 19 /* pseudo value --- never matched */
87 #define ELIFGUESSFALSE 20 /* pseudo value --- never matched */
90 extern int _debugmask;
94 * 0 show ifn*(def)*,endif
95 * 1 trace defined/!defined
97 * 3 show #include SYMBOL
100 #define debug(level,arg) { if (_debugmask & (1 << level)) warning arg; }
102 #define debug(level,arg) /**/
105 typedef unsigned char boolean;
112 /* possible i_flag */
113 #define DEFCHECKED (1<<0) /* whether defines have been checked */
114 #define NOTIFIED (1<<1) /* whether we have revealed includes */
115 #define MARKED (1<<2) /* whether it's in the makefile */
116 #define SEARCHED (1<<3) /* whether we have read this */
117 #define FINISHED (1<<4) /* whether we are done reading this */
118 #define INCLUDED_SYM (1<<5) /* whether #include SYMBOL was found
119 Can't use i_list if TRUE */
121 char *i_incstring; /* string from #include line */
122 char *i_file; /* path name of the include file */
123 struct inclist **i_list; /* list of files it itself includes */
124 int i_listlen; /* length of i_list */
125 struct symtab **i_defs; /* symbol table for this file and its
126 children when merged */
127 int i_ndefs; /* current # defines */
128 boolean *i_merged; /* whether we have merged child
130 unsigned char i_flags;
141 #ifndef X_NOT_STDC_ENV
152 struct symtab **slookup();
153 struct symtab **isdefined();
154 struct symtab **fdefined();
155 struct filepointer *getfile();
157 struct inclist *newinclude();
159 struct inclist *inc_path();
164 void recursive_pr_include();
168 #if NeedVarargsPrototypes
169 extern void fatalerr(char *, ...);
170 extern void warning(char *, ...);
171 extern void warning1(char *, ...);