|
1 /* zconf.h -- configuration of the zlib compression library |
|
2 * Copyright (C) 1995-2005 Jean-loup Gailly. |
|
3 * For conditions of distribution and use, see copyright notice in zlib.h |
|
4 */ |
|
5 |
|
6 /* @(#) $Id: zconf.h,v 1.1.2.1 2008/08/14 15:26:57 e0222316 Exp $ */ |
|
7 |
|
8 #ifndef _ZCONF_H |
|
9 #define _ZCONF_H |
|
10 |
|
11 #if (defined(__TOOLS2__) || defined(__TOOLS__)) |
|
12 /** Defined as nothing for tools builds, as EXPORT_C keyword not supported on these platforms */ |
|
13 #define EXPORT_C |
|
14 #else |
|
15 #ifdef __SYMBIAN32__ |
|
16 #include <e32def.h> /* Include for definition of IMPORT_C below */ |
|
17 /** This macro is used in function prototypes in zlib.h and libzcore.h. Use Symbian definition IMPORT_C instead of ZEXTERN */ |
|
18 #define ZEXTERN IMPORT_C |
|
19 /** This macro is used for EZLIB component */ |
|
20 #define SYMBIAN_EZLIB_DEVICE |
|
21 #endif /* __SYMBIAN32__ */ |
|
22 #endif /* __TOOLS2__ || __TOOLS__ */ |
|
23 |
|
24 |
|
25 /* |
|
26 * If you *really* need a unique prefix for all types and library functions, |
|
27 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. |
|
28 */ |
|
29 #ifdef Z_PREFIX |
|
30 # define deflateInit_ z_deflateInit_ |
|
31 # define deflate z_deflate |
|
32 # define deflateEnd z_deflateEnd |
|
33 # define inflateInit_ z_inflateInit_ |
|
34 # define inflate z_inflate |
|
35 # define inflateEnd z_inflateEnd |
|
36 # define deflateInit2_ z_deflateInit2_ |
|
37 # define deflateSetDictionary z_deflateSetDictionary |
|
38 # define deflateCopy z_deflateCopy |
|
39 # define deflateReset z_deflateReset |
|
40 # define deflateParams z_deflateParams |
|
41 # define deflateBound z_deflateBound |
|
42 # define deflatePrime z_deflatePrime |
|
43 # define inflateInit2_ z_inflateInit2_ |
|
44 # define inflateSetDictionary z_inflateSetDictionary |
|
45 # define inflateSync z_inflateSync |
|
46 # define inflateSyncPoint z_inflateSyncPoint |
|
47 # define inflateCopy z_inflateCopy |
|
48 # define inflateReset z_inflateReset |
|
49 # define inflateBack z_inflateBack |
|
50 # define inflateBackEnd z_inflateBackEnd |
|
51 # define compress z_compress |
|
52 # define compress2 z_compress2 |
|
53 # define compressBound z_compressBound |
|
54 # define uncompress z_uncompress |
|
55 # define adler32 z_adler32 |
|
56 # define crc32 z_crc32 |
|
57 # define get_crc_table z_get_crc_table |
|
58 # define zError z_zError |
|
59 |
|
60 # define alloc_func z_alloc_func |
|
61 # define free_func z_free_func |
|
62 # define in_func z_in_func |
|
63 # define out_func z_out_func |
|
64 # define Byte z_Byte |
|
65 # define uInt z_uInt |
|
66 # define uLong z_uLong |
|
67 # define Bytef z_Bytef |
|
68 # define charf z_charf |
|
69 # define intf z_intf |
|
70 # define uIntf z_uIntf |
|
71 # define uLongf z_uLongf |
|
72 # define voidpf z_voidpf |
|
73 # define voidp z_voidp |
|
74 #endif |
|
75 |
|
76 #if defined(__MSDOS__) && !defined(MSDOS) |
|
77 # define MSDOS |
|
78 #endif |
|
79 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) |
|
80 # define OS2 |
|
81 #endif |
|
82 #if defined(_WINDOWS) && !defined(WINDOWS) |
|
83 # define WINDOWS |
|
84 #endif |
|
85 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) |
|
86 # ifndef WIN32 |
|
87 # define WIN32 |
|
88 # endif |
|
89 #endif |
|
90 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) |
|
91 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) |
|
92 # ifndef SYS16BIT |
|
93 # define SYS16BIT |
|
94 # endif |
|
95 # endif |
|
96 #endif |
|
97 |
|
98 /* |
|
99 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more |
|
100 * than 64k bytes at a time (needed on systems with 16-bit int). |
|
101 */ |
|
102 #ifdef SYS16BIT |
|
103 # define MAXSEG_64K |
|
104 #endif |
|
105 #ifdef MSDOS |
|
106 # define UNALIGNED_OK |
|
107 #endif |
|
108 |
|
109 #ifdef __STDC_VERSION__ |
|
110 # ifndef STDC |
|
111 # define STDC |
|
112 # endif |
|
113 # if __STDC_VERSION__ >= 199901L |
|
114 # ifndef STDC99 |
|
115 # define STDC99 |
|
116 # endif |
|
117 # endif |
|
118 #endif |
|
119 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) |
|
120 /** define STDC i.e. Standard C */ |
|
121 # define STDC |
|
122 #endif |
|
123 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) |
|
124 # define STDC |
|
125 #endif |
|
126 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) |
|
127 # define STDC |
|
128 #endif |
|
129 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) |
|
130 # define STDC |
|
131 #endif |
|
132 |
|
133 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ |
|
134 # define STDC |
|
135 #endif |
|
136 |
|
137 #ifndef STDC |
|
138 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ |
|
139 # define const /* note: need a more gentle solution here */ |
|
140 # endif |
|
141 #endif |
|
142 |
|
143 /* Some Mac compilers merge all .h files incorrectly: */ |
|
144 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) |
|
145 # define NO_DUMMY_DECL |
|
146 #endif |
|
147 |
|
148 #ifndef MAX_MEM_LEVEL |
|
149 # ifdef MAXSEG_64K |
|
150 /** Maximum value for memLevel in deflateInit2 */ |
|
151 # define MAX_MEM_LEVEL 8 |
|
152 # else |
|
153 /** Maximum value for memLevel in deflateInit2 */ |
|
154 # define MAX_MEM_LEVEL 9 |
|
155 # endif |
|
156 #endif |
|
157 |
|
158 /* Maximum value for windowBits in deflateInit2 and inflateInit2. |
|
159 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files |
|
160 * created by gzip. (Files created by minigzip can still be extracted by |
|
161 * gzip.) |
|
162 */ |
|
163 #ifndef MAX_WBITS |
|
164 /** 32K LZ77 window */ |
|
165 # define MAX_WBITS 15 |
|
166 #endif |
|
167 |
|
168 /* The memory requirements for deflate are (in bytes): |
|
169 (1 << (windowBits+2)) + (1 << (memLevel+9)) |
|
170 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) |
|
171 plus a few kilobytes for small objects. For example, if you want to reduce |
|
172 the default memory requirements from 256K to 128K, compile with |
|
173 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" |
|
174 Of course this will generally degrade compression (there's no free lunch). |
|
175 |
|
176 The memory requirements for inflate are (in bytes) 1 << windowBits |
|
177 that is, 32K for windowBits=15 (default value) plus a few kilobytes |
|
178 for small objects. |
|
179 */ |
|
180 |
|
181 /* Type declarations */ |
|
182 |
|
183 #ifndef OF /* function prototypes */ |
|
184 # ifdef STDC |
|
185 /** |
|
186 Function prototypes |
|
187 @param args arguments ... |
|
188 */ |
|
189 # define OF(args) args |
|
190 # else |
|
191 /** Function prototypes */ |
|
192 # define OF(args) () |
|
193 # endif |
|
194 #endif |
|
195 |
|
196 /* The following definitions for FAR are needed only for MSDOS mixed |
|
197 * model programming (small or medium model with some far allocations). |
|
198 * This was tested only with MSC; for other MSDOS compilers you may have |
|
199 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, |
|
200 * just define FAR to be empty. |
|
201 */ |
|
202 #ifdef SYS16BIT |
|
203 # if defined(M_I86SM) || defined(M_I86MM) |
|
204 /* MSC small or medium model */ |
|
205 # define SMALL_MEDIUM |
|
206 # ifdef _MSC_VER |
|
207 # define FAR _far |
|
208 # else |
|
209 # define FAR far |
|
210 # endif |
|
211 # endif |
|
212 # if (defined(__SMALL__) || defined(__MEDIUM__)) |
|
213 /* Turbo C small or medium model */ |
|
214 # define SMALL_MEDIUM |
|
215 # ifdef __BORLANDC__ |
|
216 # define FAR _far |
|
217 # else |
|
218 # define FAR far |
|
219 # endif |
|
220 # endif |
|
221 #endif |
|
222 |
|
223 #if defined(WINDOWS) || defined(WIN32) |
|
224 /* If building or using zlib as a DLL, define ZLIB_DLL. |
|
225 * This is not mandatory, but it offers a little performance increase. |
|
226 */ |
|
227 # ifdef ZLIB_DLL |
|
228 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) |
|
229 # ifdef ZLIB_INTERNAL |
|
230 # define ZEXTERN extern __declspec(dllexport) |
|
231 # else |
|
232 # define ZEXTERN extern __declspec(dllimport) |
|
233 # endif |
|
234 # endif |
|
235 # endif /* ZLIB_DLL */ |
|
236 /* If building or using zlib with the WINAPI/WINAPIV calling convention, |
|
237 * define ZLIB_WINAPI. |
|
238 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. |
|
239 */ |
|
240 # ifdef ZLIB_WINAPI |
|
241 # ifdef FAR |
|
242 # undef FAR |
|
243 # endif |
|
244 # include <windows.h> |
|
245 /* No need for _export, use ZLIB.DEF instead. */ |
|
246 /* For complete Windows compatibility, use WINAPI, not __stdcall. */ |
|
247 # define ZEXPORT WINAPI |
|
248 # ifdef WIN32 |
|
249 # define ZEXPORTVA WINAPIV |
|
250 # else |
|
251 # define ZEXPORTVA FAR CDECL |
|
252 # endif |
|
253 # endif |
|
254 #endif |
|
255 |
|
256 #if defined (__BEOS__) |
|
257 # ifdef ZLIB_DLL |
|
258 # ifdef ZLIB_INTERNAL |
|
259 # define ZEXPORT __declspec(dllexport) |
|
260 # define ZEXPORTVA __declspec(dllexport) |
|
261 # else |
|
262 # define ZEXPORT __declspec(dllimport) |
|
263 # define ZEXPORTVA __declspec(dllimport) |
|
264 # endif |
|
265 # endif |
|
266 #endif |
|
267 |
|
268 #ifndef ZEXTERN |
|
269 /** extern defined as ZEXTERN */ |
|
270 # define ZEXTERN extern |
|
271 #endif |
|
272 #ifndef ZEXPORT |
|
273 # define ZEXPORT |
|
274 #endif |
|
275 #ifndef ZEXPORTVA |
|
276 # define ZEXPORTVA |
|
277 #endif |
|
278 |
|
279 |
|
280 #ifndef FAR |
|
281 # define FAR |
|
282 #endif |
|
283 |
|
284 #if !defined(__MACTYPES__) |
|
285 /** 8 bits */ |
|
286 typedef unsigned char Byte; |
|
287 #endif |
|
288 /** 16 bits or more */ |
|
289 typedef unsigned int uInt; |
|
290 /** 32 bits or more */ |
|
291 typedef unsigned long uLong; |
|
292 |
|
293 #ifdef SMALL_MEDIUM |
|
294 /** Borland C/C++ and some old MSC versions ignore FAR inside typedef */ |
|
295 # define Bytef Byte FAR |
|
296 #else |
|
297 /** Borland C/C++ and some old MSC versions ignore FAR inside typedef */ |
|
298 typedef Byte FAR Bytef; |
|
299 #endif |
|
300 /** char typedef to charf */ |
|
301 typedef char FAR charf; |
|
302 /** int typedef to intf */ |
|
303 typedef int FAR intf; |
|
304 /** uInt typedef to uIntf */ |
|
305 typedef uInt FAR uIntf; |
|
306 /** uLong typedef to uLongf */ |
|
307 typedef uLong FAR uLongf; |
|
308 |
|
309 #ifdef STDC |
|
310 /** typedef void const* to voidpc */ |
|
311 typedef void const *voidpc; |
|
312 /** typedef void FAR* to voidpf */ |
|
313 typedef void FAR *voidpf; |
|
314 /** typedef void* to voidp */ |
|
315 typedef void *voidp; |
|
316 #else |
|
317 /** typedef Byte const* to voidpc */ |
|
318 typedef Byte const *voidpc; |
|
319 /** typedef Byte FAR* to voidpf */ |
|
320 typedef Byte FAR *voidpf; |
|
321 /** typedef Byte* to voidp */ |
|
322 typedef Byte *voidp; |
|
323 #endif |
|
324 |
|
325 #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ |
|
326 # include <sys/types.h> /* for off_t */ |
|
327 # include <unistd.h> /* for SEEK_* and off_t */ |
|
328 # ifdef VMS |
|
329 # include <unixio.h> /* for off_t */ |
|
330 # endif |
|
331 # define z_off_t off_t |
|
332 #endif |
|
333 #ifndef SEEK_SET |
|
334 /** Seek from beginning of file. */ |
|
335 # define SEEK_SET 0 |
|
336 /** Seek from current position. */ |
|
337 # define SEEK_CUR 1 |
|
338 /** Set file pointer to EOF plus "offset" */ |
|
339 # define SEEK_END 2 |
|
340 #endif |
|
341 #ifndef z_off_t |
|
342 /** define z_off_t as long */ |
|
343 # define z_off_t long |
|
344 #endif |
|
345 |
|
346 #if defined(__OS400__) |
|
347 # define NO_vsnprintf |
|
348 #endif |
|
349 |
|
350 #if defined(__MVS__) |
|
351 # define NO_vsnprintf |
|
352 # ifdef FAR |
|
353 # undef FAR |
|
354 # endif |
|
355 #endif |
|
356 |
|
357 /* MVS linker does not support external names larger than 8 bytes */ |
|
358 #if defined(__MVS__) |
|
359 # pragma map(deflateInit_,"DEIN") |
|
360 # pragma map(deflateInit2_,"DEIN2") |
|
361 # pragma map(deflateEnd,"DEEND") |
|
362 # pragma map(deflateBound,"DEBND") |
|
363 # pragma map(inflateInit_,"ININ") |
|
364 # pragma map(inflateInit2_,"ININ2") |
|
365 # pragma map(inflateEnd,"INEND") |
|
366 # pragma map(inflateSync,"INSY") |
|
367 # pragma map(inflateSetDictionary,"INSEDI") |
|
368 # pragma map(compressBound,"CMBND") |
|
369 # pragma map(inflate_table,"INTABL") |
|
370 # pragma map(inflate_fast,"INFA") |
|
371 # pragma map(inflate_copyright,"INCOPY") |
|
372 #endif |
|
373 |
|
374 #endif /* _ZCONF_H */ |