summaryrefslogtreecommitdiff
path: root/src/h/config.h
blob: 2045dd71a89399bd91b91a14e46ab32b1e27034b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
/*
 * Icon configuration.
 */

/*
 * System-specific definitions are in define.h, which is loaded first.
 */

/*
 *  A number of symbols are defined here.
 *  Some enable or disable certain Icon features, for example:
 *	LoadFunc	enables dynamic loading
 *
 *  Many definitions reflect remnants of past research projects.
 *  Changing them to values not used in standard configurations
 *  may result in an unbuildable or nonfunctioning system.
 */

/*
 * Graphics definitions.
 */
#ifdef Graphics

   #ifndef XWindows
      #ifdef MSWIN
         #undef WinGraphics
         #define WinGraphics 1
      #else				/* Graphics */
         #define XWindows 1
      #endif				/* Graphics */
   #endif				/* XWindows */

   #ifndef NoXpmFormat
      #ifdef XWindows
         #undef HaveXpmFormat
         #define HaveXpmFormat
      #endif				/* XWindows */
   #endif				/* NoXpmFormat */

   #undef LineCodes
   #define LineCodes

   #undef Polling
   #define Polling

#else					/* Graphics */
   #undef XWindows
   #undef WinGraphics
#endif					/* Graphics */

/*
 * Data sizes and alignment.
 */

#define WordSize sizeof(word)

#ifndef StackAlign
   #define StackAlign 8
#endif					/* StackAlign */

/*
 * Other defaults.
 */

#ifndef MaxHdr
   /*
    * Maximum allowable BinaryHeader size.
    * WARNING: changing this invalidates old BinaryHeader executables.
    */
   #define MaxHdr 8192
#endif					/* MaxHdr */

#ifndef MaxPath
   #define MaxPath 512
#endif					/* MaxPath */

#ifndef SourceSuffix
   #define SourceSuffix ".icn"
#endif					/* SourceSuffix */

/*
 * Representations of directories. LocalDir is the "current working directory".
 *  SourceDir is where the source file is.
 */

#define LocalDir ""
#define SourceDir (char *)NULL

#ifndef TargetDir
   #define TargetDir LocalDir
#endif					/* TargetDir */

/*
 * Features enabled by default.
 */
#ifndef NoPipes
   #define Pipes
#endif					/* Pipes */

#ifndef NoKeyboardFncs
   #define KeyboardFncs
#endif					/* KeyboardFncs */

#ifndef NoReadDirectory
   #define ReadDirectory
#endif					/* ReadDirectory */

#ifndef NoSysOpt
   #define SysOpt
#endif					/* SysOpt */

/*
 *  The following definitions assume ANSI C.
 */
#define Cat(x,y) x##y
#define Lit(x) #x
#define Bell '\a'

/*
 * Miscellaney.
 */

#ifndef DiffPtrs
   #define DiffPtrs(p1,p2) (word)((p1)-(p2))
#endif					/* DiffPtrs */

#ifndef AllocReg
   #define AllocReg(n) malloc(n)
#endif					/* AllocReg */

#ifndef RttSuffix
   #define RttSuffix ".r"
#endif					/* RttSuffix */

#ifndef DBSuffix
   #define DBSuffix ".db"
#endif					/* DBSuffix */

#ifndef PPDirectives
   #define PPDirectives {"passthru", PpKeep},
#endif					/* PPDirectives */

#ifndef ExecSuffix
   #define ExecSuffix ""
#endif					/* ExecSuffix */

#ifndef CSuffix
   #define CSuffix ".c"
#endif					/* CSuffix */

/*
 * Note, size of the hash table is a power of 2:
 */
#define IHSize 128
#define IHasher(x)	(((unsigned int)(unsigned long)(x))&(IHSize-1))

/*
 * Code for the interpreter.
 */
#ifndef IcodeSuffix
   #define IcodeSuffix ""
#endif				/* IcodeSuffix */

#ifndef IcodeASuffix
   #define IcodeASuffix ""
#endif				/* IcodeASuffix */

#ifndef U1Suffix
   #define U1Suffix ".u1"
#endif				/* U1Suffix */

#ifndef U2Suffix
   #define U2Suffix ".u2"
#endif				/* U2Suffix */

#ifndef USuffix
   #define USuffix ".u"
#endif				/* USuffix */

/*
 *  Vsizeof is for use with variable-sized (i.e., indefinite)
 *   structures containing an array of descriptors declared of size 1
 *   to avoid compiler warnings associated with 0-sized arrays.
 */

#define Vsizeof(s)	(sizeof(s) - sizeof(struct descrip))

/*
 * Other sizeof macros:
 *
 *  Wsizeof(x)	-- Size of x in words.
 *  Vwsizeof(x) -- Size of x in words, minus the size of a descriptor.	Used
 *   when structures have a potentially null list of descriptors
 *   at their end.
 */

#define Wsizeof(x)	((sizeof(x) + sizeof(word) - 1) / sizeof(word))
#define Vwsizeof(x) \
   ((sizeof(x) - sizeof(struct descrip) + sizeof(word) - 1) / sizeof(word))