]> git.sesse.net Git - rdpsrv/blob - Xserver/config/makedepend/def.h
Support RDP5 logon packets.
[rdpsrv] / Xserver / config / makedepend / def.h
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 $ */
3 /*
4
5 Copyright (c) 1993, 1994  X Consortium
6
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:
13
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16
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.
23
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.
27
28 */
29
30 #include "Xos.h"
31 #include "Xfuncproto.h"
32 #include <stdio.h>
33 #ifndef X_NOT_STDC_ENV
34 #include <string.h>
35 #endif
36 #include <ctype.h>
37 #ifndef X_NOT_POSIX
38 #ifndef _POSIX_SOURCE
39 #define _POSIX_SOURCE
40 #endif
41 #endif
42 #include <sys/types.h>
43 #include <fcntl.h>
44 #include <sys/stat.h>
45
46 #define MAXDEFINES      512
47 #define MAXFILES        1024
48 #define MAXDIRS         64
49 #define SYMTABINC       10      /* must be > 1 for define() to work right */
50 #define TRUE            1
51 #define FALSE           0
52
53 /* the following must match the directives table in main.c */
54 #define IF              0
55 #define IFDEF           1
56 #define IFNDEF          2
57 #define ELSE            3
58 #define ENDIF           4
59 #define DEFINE          5
60 #define UNDEF           6
61 #define INCLUDE         7
62 #define LINE            8
63 #define PRAGMA          9
64 #define ERROR           10
65 #define IDENT           11
66 #define SCCS            12
67 #define ELIF            13
68 #define EJECT           14
69 #define WARNING         15
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 */
75
76 #ifdef DEBUG
77 extern int      _debugmask;
78 /*
79  * debug levels are:
80  * 
81  *     0        show ifn*(def)*,endif
82  *     1        trace defined/!defined
83  *     2        show #include
84  *     3        show #include SYMBOL
85  *     4-6      unused
86  */
87 #define debug(level,arg) { if (_debugmask & (1 << level)) warning arg; }
88 #else
89 #define debug(level,arg) /**/
90 #endif /* DEBUG */
91
92 typedef unsigned char boolean;
93
94 struct symtab {
95         char    *s_name;
96         char    *s_value;
97 };
98
99 /* possible i_flag */
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 */
107 struct  inclist {
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
116                                            defines */
117         unsigned char   i_flags;
118 };
119
120 struct filepointer {
121         char    *f_p;
122         char    *f_base;
123         char    *f_end;
124         long    f_len;
125         long    f_line;
126 };
127
128 #ifndef X_NOT_STDC_ENV
129 #include <stdlib.h>
130 #if defined(macII) && !defined(__STDC__)  /* stdlib.h fails to define these */
131 char *malloc(), *realloc();
132 #endif /* macII */
133 #else
134 char                    *malloc();
135 char                    *realloc();
136 #endif
137
138 char                    *copy();
139 char                    *base_name();
140 char                    *x_getline();
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();
147
148 #if NeedVarargsPrototypes
149 extern void fatalerr(char *, ...);
150 extern void warning(char *, ...);
151 extern void warning1(char *, ...);
152 #endif