1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/coreconf/mkdepend/def.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,184 @@ 1.4 +/* $Xorg: def.h,v 1.4 2001/02/09 02:03:16 xorgcvs Exp $ */ 1.5 +/* 1.6 + 1.7 +Copyright (c) 1993, 1994, 1998 The Open Group. 1.8 + 1.9 +Permission to use, copy, modify, distribute, and sell this software and its 1.10 +documentation for any purpose is hereby granted without fee, provided that 1.11 +the above copyright notice appear in all copies and that both that 1.12 +copyright notice and this permission notice appear in supporting 1.13 +documentation. 1.14 + 1.15 +The above copyright notice and this permission notice shall be included in 1.16 +all copies or substantial portions of the Software. 1.17 + 1.18 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1.19 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1.20 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1.21 +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 1.22 +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 1.23 +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 1.24 + 1.25 +Except as contained in this notice, the name of The Open Group shall not be 1.26 +used in advertising or otherwise to promote the sale, use or other dealings 1.27 +in this Software without prior written authorization from The Open Group. 1.28 + 1.29 +*/ 1.30 +/* $XFree86: xc/config/makedepend/def.h,v 3.14 2003/01/17 17:09:49 tsi Exp $ */ 1.31 + 1.32 +#ifndef NO_X11 1.33 +#include <X11/Xos.h> 1.34 +#include <X11/Xfuncproto.h> 1.35 +#endif 1.36 +#include <stdlib.h> 1.37 +#include <stdio.h> 1.38 +#include <string.h> 1.39 +#include <ctype.h> 1.40 +#if 0 1.41 +#ifndef X_NOT_POSIX 1.42 +#ifndef _POSIX_SOURCE 1.43 +#define _POSIX_SOURCE 1.44 +#endif 1.45 +#endif 1.46 +#endif 1.47 +#include <sys/types.h> 1.48 +#include <fcntl.h> 1.49 +#include <sys/stat.h> 1.50 + 1.51 +#define MAXDEFINES 512 1.52 +#define MAXFILES 1024 1.53 +#define MAXINCFILES 256 /* "-include" files */ 1.54 +#define MAXDIRS 1024 1.55 +#define SYMTABINC 10 /* must be > 1 for define() to work right */ 1.56 +#define TRUE 1 1.57 +#define FALSE 0 1.58 + 1.59 +/* the following must match the directives table in main.c */ 1.60 +#define IF 0 1.61 +#define IFDEF 1 1.62 +#define IFNDEF 2 1.63 +#define ELSE 3 1.64 +#define ENDIF 4 1.65 +#define DEFINE 5 1.66 +#define UNDEF 6 1.67 +#define INCLUDE 7 1.68 +#define LINE 8 1.69 +#define PRAGMA 9 1.70 +#define ERROR 10 1.71 +#define IDENT 11 1.72 +#define SCCS 12 1.73 +#define ELIF 13 1.74 +#define EJECT 14 1.75 +#define WARNING 15 1.76 +#define INCLUDENEXT 16 1.77 +#define IFFALSE 17 /* pseudo value --- never matched */ 1.78 +#define ELIFFALSE 18 /* pseudo value --- never matched */ 1.79 +#define INCLUDEDOT 19 /* pseudo value --- never matched */ 1.80 +#define IFGUESSFALSE 20 /* pseudo value --- never matched */ 1.81 +#define ELIFGUESSFALSE 21 /* pseudo value --- never matched */ 1.82 +#define INCLUDENEXTDOT 22 /* pseudo value --- never matched */ 1.83 + 1.84 +#ifdef DEBUG 1.85 +extern int _debugmask; 1.86 +/* 1.87 + * debug levels are: 1.88 + * 1.89 + * 0 show ifn*(def)*,endif 1.90 + * 1 trace defined/!defined 1.91 + * 2 show #include 1.92 + * 3 show #include SYMBOL 1.93 + * 4-6 unused 1.94 + */ 1.95 +#define debug(level,arg) { if (_debugmask & (1 << level)) warning arg; } 1.96 +#else 1.97 +#define debug(level,arg) /**/ 1.98 +#endif /* DEBUG */ 1.99 + 1.100 +typedef unsigned char boolean; 1.101 + 1.102 +struct symtab { 1.103 + char *s_name; 1.104 + char *s_value; 1.105 +}; 1.106 + 1.107 +/* possible i_flag */ 1.108 +#define DEFCHECKED (1<<0) /* whether defines have been checked */ 1.109 +#define NOTIFIED (1<<1) /* whether we have revealed includes */ 1.110 +#define MARKED (1<<2) /* whether it's in the makefile */ 1.111 +#define SEARCHED (1<<3) /* whether we have read this */ 1.112 +#define FINISHED (1<<4) /* whether we are done reading this */ 1.113 +#define INCLUDED_SYM (1<<5) /* whether #include SYMBOL was found 1.114 + Can't use i_list if TRUE */ 1.115 +struct inclist { 1.116 + char *i_incstring; /* string from #include line */ 1.117 + char *i_file; /* path name of the include file */ 1.118 + struct inclist **i_list; /* list of files it itself includes */ 1.119 + int i_listlen; /* length of i_list */ 1.120 + struct symtab **i_defs; /* symbol table for this file and its 1.121 + children when merged */ 1.122 + int i_ndefs; /* current # defines */ 1.123 + boolean *i_merged; /* whether we have merged child 1.124 + defines */ 1.125 + unsigned char i_flags; 1.126 +}; 1.127 + 1.128 +struct filepointer { 1.129 + char *f_name; 1.130 + char *f_p; 1.131 + char *f_base; 1.132 + char *f_end; 1.133 + long f_len; 1.134 + long f_line; 1.135 + long cmdinc_count; 1.136 + char **cmdinc_list; 1.137 + long cmdinc_line; 1.138 +}; 1.139 + 1.140 +#include <stdlib.h> 1.141 +#if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */ 1.142 +char *malloc(), *realloc(); 1.143 +#endif /* macII */ 1.144 + 1.145 +char *copy(char *str); 1.146 +int match(char *str, char **list); 1.147 +char *base_name(char *file); 1.148 +char *getnextline(struct filepointer *fp); 1.149 +struct symtab **slookup(char *symbol, struct inclist *file); 1.150 +struct symtab **isdefined(char *symbol, struct inclist *file, 1.151 + struct inclist **srcfile); 1.152 +struct symtab **fdefined(char *symbol, struct inclist *file, 1.153 + struct inclist **srcfile); 1.154 +struct filepointer *getfile(char *file); 1.155 +void included_by(struct inclist *ip, 1.156 + struct inclist *newfile); 1.157 +struct inclist *newinclude(char *newfile, char *incstring); 1.158 +void inc_clean (void); 1.159 +struct inclist *inc_path(char *file, char *include, int type); 1.160 + 1.161 +void freefile(struct filepointer *fp); 1.162 + 1.163 +void define2(char *name, char *val, struct inclist *file); 1.164 +void define(char *def, struct inclist *file); 1.165 +void undefine(char *symbol, struct inclist *file); 1.166 +int find_includes(struct filepointer *filep, 1.167 + struct inclist *file, 1.168 + struct inclist *file_red, 1.169 + int recursion, boolean failOK); 1.170 + 1.171 +void recursive_pr_include(struct inclist *head, 1.172 + char *file, char *base); 1.173 +void add_include(struct filepointer *filep, 1.174 + struct inclist *file, 1.175 + struct inclist *file_red, 1.176 + char *include, int type, 1.177 + boolean failOK); 1.178 + 1.179 +int cppsetup(char *filename, 1.180 + char *line, 1.181 + struct filepointer *filep, 1.182 + struct inclist *inc); 1.183 + 1.184 + 1.185 +extern void fatalerr(char *, ...); 1.186 +extern void warning(char *, ...); 1.187 +extern void warning1(char *, ...);