b311480e |
1 | /* |
2 | Copyright (c) 1999-2012 OPEN CASCADE SAS |
7fd59977 |
3 | |
b311480e |
4 | The content of this file is subject to the Open CASCADE Technology Public |
5 | License Version 6.5 (the "License"). You may not use the content of this file |
6 | except in compliance with the License. Please obtain a copy of the License |
7 | at http://www.opencascade.org and read it completely before using this file. |
8 | |
9 | The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
10 | main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
11 | |
12 | The Original Code and all software distributed under the License is |
13 | distributed on an "AS IS" basis, without warranty of any kind, and the |
14 | Initial Developer hereby disclaims all such warranties, including without |
15 | limitation, any warranties of merchantability, fitness for a particular |
16 | purpose or non-infringement. Please see the License for the specific terms |
17 | and conditions governing the rights and limitations under the License. |
18 | |
19 | */ |
20 | |
21 | /* Get local machine id, operating system, compiler and/or library */ |
7fd59977 |
22 | #ifndef CGMMACH_H |
23 | #define CGMMACH_H |
24 | |
25 | /* C Library routines needed in standard include files */ |
26 | |
27 | #include <stdio.h> |
28 | #include <string.h> |
29 | #include <stdlib.h> |
30 | #include <math.h> |
31 | #include <ctype.h> |
32 | #include <time.h> |
33 | |
34 | /* Current CGM version */ |
35 | #define CGMVERSION 1 |
36 | |
37 | #define const |
38 | #define volatile |
39 | #define FREE(x) free ( (char *) x ) |
40 | |
41 | #ifndef NULL /* Null Pointer */ |
42 | #define NULL (int *) 0 |
43 | #endif |
44 | |
45 | /* Define anything that has not been explicitly set **************/ |
46 | |
47 | #ifndef SignChar |
48 | #define SignChar signed char |
49 | #endif |
50 | #ifndef Int16 |
51 | #define Int16 short |
52 | #endif |
53 | #ifndef Char |
54 | #define Char char |
55 | #endif |
56 | #ifndef Int |
57 | #define Int int |
58 | #endif |
59 | #ifndef Long |
60 | #define Long long |
61 | #endif |
62 | #ifndef Float |
63 | #define Float float |
64 | #endif |
65 | #ifndef Double |
66 | #define Double double |
67 | #endif |
68 | |
69 | /* Define macros for some maths routines which may cause problems */ |
70 | |
71 | #ifndef SQRT |
72 | #define SQRT(x) sqrt( (double) (x) ) |
73 | #endif |
74 | #ifndef FABS |
75 | #define FABS(x) fabs( (double) (x) ) |
76 | #endif |
77 | #ifndef MALLOC |
78 | #define MALLOC(n,s) malloc( (size_t) ((n)*(s)) ) |
79 | #endif |
80 | |
81 | /* Define if font system needed */ |
82 | |
83 | #ifdef XW |
84 | #define FONTSYSTEM |
85 | #else |
86 | #ifdef POSTSCRIPT |
87 | #define FONTSYSTEM |
88 | #else |
89 | #ifdef IGL |
90 | #define FONTSYSTEM |
91 | #endif |
92 | #endif |
93 | #endif |
94 | |
95 | |
96 | #ifndef FIXED_BUFFER /* Use variable communications Area by default */ |
97 | #define VAR_BUFFER |
98 | #endif |
99 | |
100 | #ifndef ARRAY_MAX /* Maximum Sizes for Interface buffer */ |
101 | #define ARRAY_MAX 1024 |
102 | #endif |
103 | |
104 | #ifndef STRING_MAX /* Maximum String length */ |
105 | #define STRING_MAX 1024 |
106 | #endif |
107 | |
108 | #ifndef DEFOUT /* Default Standard Output type */ |
109 | #define DEFOUT 'T' |
110 | #endif |
111 | |
112 | #ifndef ERROR_MAX /* Maximum Number of errors */ |
113 | #define ERROR_MAX 16 |
114 | #endif |
115 | |
116 | #ifndef DEFVERBOSE /* Default Verbose mode flag */ |
117 | #define DEFVERBOSE FALSE |
118 | #endif |
119 | |
120 | #ifndef DEFQUIET /* Default quiet output flag */ |
121 | #define DEFQUIET FALSE |
122 | #endif |
123 | |
124 | #ifndef DEFMOVIE /* Default Continuous play mode */ |
125 | #define DEFMOVIE FALSE |
126 | #endif |
127 | |
128 | #ifndef DEFDOUBLE /* Default Double buffer mode */ |
129 | #define DEFDOUBLE FALSE |
130 | #endif |
131 | |
132 | #ifndef DEFFULLSCRN /* Default Full screen mode */ |
133 | #define DEFFULLSCRN TRUE |
134 | #endif |
135 | |
136 | #ifndef DEFRALGKSGDP /* RAL-GKS GDPs recognised */ |
137 | #define DEFRALGKSGDP FALSE |
138 | #endif |
139 | |
140 | #ifndef LPOINT /* Define default LPOINT commands */ |
141 | #define Lpoint Point |
142 | |
143 | #define LPOINT(p) Lpoint *p |
144 | #define BEGINLIST(p) |
145 | #define STOREPOINT(p,q) (*p).x = q.x; (*p++).y = q.y |
146 | #define STOREVALUE(p,q,r) (*p).x = q; (*p++).y = r |
147 | #define CLOSELIST(p) |
148 | #define NEWSUBLIST(p) |
149 | #define ENDLIST(p) |
150 | #endif |
151 | |
152 | #ifndef MAXFNSIZE /* Maximum font name size */ |
153 | #define MAXFNSIZE 40 |
154 | #endif |
155 | |
156 | #ifndef DATADIR /* Directory for font & data files */ |
157 | #define DATADIR "" |
158 | #endif |
159 | |
160 | #ifndef FILESEP /* File seperator */ |
161 | #define FILESEP "." |
162 | #endif |
163 | |
164 | #ifndef PATHDELIM /* Path seperator */ |
165 | #define PATHDELIM '/' |
166 | #endif |
167 | |
168 | #ifndef MAXFLSIZE /* Maximum length of filename - whole tree */ |
169 | #define MAXFLSIZE 80 |
170 | #endif |
171 | |
172 | #ifndef NAMELGTH /* Maximum length of filename - name only */ |
173 | #define NAMELGTH 8 |
174 | #endif |
175 | |
176 | #ifndef EXTLGTH /* Maximum length of filename - extension */ |
177 | #define EXTLGTH 3 |
178 | #endif |
179 | |
180 | #ifndef LFILEDEF /* Maximum length of filename extra data */ |
181 | #define LFILEDEF 0 |
182 | #endif |
183 | |
184 | #ifndef F_READ /* Read file mode */ |
185 | #define F_READ 'r' |
186 | #endif |
187 | |
188 | #ifndef F_WRITE /* Write file mode */ |
189 | #define F_WRITE 'w' |
190 | #endif |
191 | |
192 | #ifndef BUFF_LEN /* CGM output record length */ |
193 | #define BUFF_LEN (size_t) 80 |
194 | #endif |
195 | |
196 | #ifndef OBUFF_LEN /* CGM output buffer size */ |
197 | #define OBUFF_LEN (size_t) 512 |
198 | #endif |
199 | |
200 | #ifndef NFRAME /* Maximum number of frames */ |
201 | #define NFRAME 100 |
202 | #endif |
203 | |
204 | #ifndef NMETA /* Maximum number of metafiles */ |
205 | #define NMETA 10 |
206 | #endif |
207 | |
208 | #ifndef MAXPTS /* Maximum storage for fill area processing */ |
209 | #define MAXPTS 4096 |
210 | #endif |
211 | |
212 | #ifndef SET_MAX /* Maximum number of Polygon sets ?? */ |
213 | #define SET_MAX 50 |
214 | #endif |
215 | |
216 | #ifndef COLOUR_TAB /* Colour table size */ |
217 | #define COLOUR_TAB 256 |
218 | #endif |
219 | |
220 | #ifndef COLOUR_BITS /* Number of bit planes */ |
221 | #define COLOUR_BITS 8 |
222 | #endif |
223 | |
224 | #ifndef PATT_TAB /* Pattern table size */ |
225 | #define PATT_TAB 1024 |
226 | #endif |
227 | |
228 | #ifndef PATTERNS /* Maximum number of Patterns */ |
229 | #define PATTERNS 40 |
230 | #endif |
231 | |
232 | #ifndef NPOWER /* No of entries in power-of-two table */ |
233 | #define NPOWER 32 |
234 | #endif |
235 | |
236 | #ifndef HASHSIZE /* No of entries in Code hash table */ |
237 | #if CGMVERSION == 1 |
238 | #define HASHSIZE 280 |
239 | #endif |
240 | #if CGMVERSION == 2 |
241 | #define HASHSIZE 512 |
242 | #endif |
243 | #if CGMVERSION == 3 |
244 | #define HASHSIZE 1024 |
245 | #endif |
246 | #endif |
247 | |
248 | #ifndef NULLSTR /* Null string pointer */ |
249 | #define NULLSTR (char *) NULL |
250 | #endif |
251 | |
252 | #ifdef DEBUG /* turn on extra debugging in font package */ |
253 | #define CSETNAMES |
254 | #define DESNAMES |
255 | #endif |
256 | |
257 | /* All the following definitions provide limits for the number |
258 | | of values that can be read in by the font utility; they do |
259 | | not cause any permanent memory to be allocated, so can be |
260 | | set high for safety. |
261 | */ |
262 | |
263 | #ifndef MAXCSET /* maximum number of ISO character sets */ |
264 | #define MAXCSET 1000 |
265 | #endif |
266 | |
267 | #ifndef MAXFUDGE /* maximum number of fudge character sets */ |
268 | #define MAXFUDGE 25 |
269 | #endif |
270 | |
271 | #ifndef MAXFAMILY /* maximum number of typeface family definitions */ |
272 | #define MAXFAMILY 2000 |
273 | #endif |
274 | |
275 | #ifndef MAXALIAS /* maximum number of family aliases */ |
276 | #define MAXALIAS 200 |
277 | #endif |
278 | |
279 | #ifndef MAXSFONT /* maximum number of specific fonts */ |
280 | #define MAXFONT 2000 |
281 | #endif |
282 | |
283 | #ifndef MAXSOURCE /* maximum number of typeface sources */ |
284 | #define MAXSOURCE 100 |
285 | #endif |
286 | |
287 | #ifndef MAXDESIGN /* maximum number of ISO design groups */ |
288 | #define MAXDESIGN 200 |
289 | #endif |
290 | |
291 | #ifndef MAXMETHOD /* maximum number of output methods */ |
292 | #define MAXMETHOD 5 |
293 | #endif |
294 | |
295 | #ifndef MAXFPERM /* maximum number of fonts per method */ |
296 | #define MAXFPERM 1000 |
297 | #endif |
298 | |
299 | #ifndef MAXREQ /* maximum number of fonts per method */ |
300 | #define MAXREQ 1000 |
301 | #endif |
302 | |
303 | #endif /* end of cgmmach.h */ |