1
/* $XConsortium: def.h /main/30 1996/12/04 10:11:12 swick $ */
4
Copyright (c) 1993, 1994 X Consortium
6
Permission is hereby granted, free of charge, to any person obtaining a copy
7
of this software and associated documentation files (the "Software"), to deal
8
in the Software without restriction, including without limitation the rights
9
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
copies of the Software, and to permit persons to whom the Software is
11
furnished to do so, subject to the following conditions:
13
The above copyright notice and this permission notice shall be included in
14
all copies or substantial portions of the Software.
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
Except as contained in this notice, the name of the X Consortium shall not be
24
used in advertising or otherwise to promote the sale, use or other dealings
25
in this Software without prior written authorization from the X Consortium.
32
#include <sys/types.h>
41
#include <sys/types.h>
45
#define MAXDEFINES 512
48
#define SYMTABINC 10 /* must be > 1 for define() to work right */
52
/* the following must match the directives table in main.c */
68
#define IFFALSE 15 /* pseudo value --- never matched */
69
#define ELIFFALSE 16 /* pseudo value --- never matched */
70
#define INCLUDEDOT 17 /* pseudo value --- never matched */
71
#define IFGUESSFALSE 18 /* pseudo value --- never matched */
72
#define ELIFGUESSFALSE 19 /* pseudo value --- never matched */
75
extern int _debugmask;
79
* 0 show ifn*(def)*,endif
80
* 1 trace defined/!defined
82
* 3 show #include SYMBOL
85
#define debug(level,arg) { if (_debugmask & (1 << level)) warning arg; }
87
#define debug(level,arg) /**/
90
/* typedef unsigned char boolean; */
98
#define DEFCHECKED (1<<0) /* whether defines have been checked */
99
#define NOTIFIED (1<<1) /* whether we have revealed includes */
100
#define MARKED (1<<2) /* whether it's in the makefile */
101
#define SEARCHED (1<<3) /* whether we have read this */
102
#define FINISHED (1<<4) /* whether we are done reading this */
103
#define INCLUDED_SYM (1<<5) /* whether #include SYMBOL was found
104
Can't use i_list if TRUE */
106
char *i_incstring; /* string from #include line */
107
char *i_file; /* path name of the include file */
108
struct inclist **i_list; /* list of files it itself includes */
109
int i_listlen; /* length of i_list */
110
struct symtab **i_defs; /* symbol table for this file and its
111
children when merged */
112
int i_ndefs; /* current # defines */
113
boolean *i_merged; /* whether we have merged child
115
unsigned char i_flags;
126
#ifndef X_NOT_STDC_ENV
128
#if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */
129
char *malloc(), *realloc();
136
#if NeedFunctionPrototypes
137
char *copy( char *str);
138
char *base_name(char *file, int strip);
139
char *getline(struct filepointer *filep);
140
struct filepointer *getfile(char *file);
141
struct inclist *newinclude(char *newfile, char *incstring);
142
struct inclist *inc_path(char *file, char *include, boolean dot);
143
void included_by(struct inclist *ip, struct inclist *newfile);
144
void inc_clean(void);
145
void define2(char *name, char *val, struct inclist *file);
146
void define(char *def, struct inclist *file);
147
int find_includes(struct filepointer *filep, struct inclist *file,
148
struct inclist *file_red, int recursion, boolean failOK);
149
void recursive_pr_include(struct inclist *head, char *file, char *base);
150
void freefile(struct filepointer *fp);
151
int cppsetup(char *line, struct filepointer *filep, struct inclist *inc);
152
struct symtab **isdefined( char *symbol,
153
struct inclist *file,
154
struct inclist **srcfile);
159
struct filepointer *getfile();
160
struct inclist *newinclude();
161
struct inclist *inc_path();
167
void recursive_pr_include();
170
struct symtab **isdefined();
173
#if NeedVarargsPrototypes
174
extern void fatalerr(char *, ...);
175
extern void warning(char *, ...);
176
extern void warning1(char *, ...);
184
extern boolean local_include;