|
1 /* zconf.h -- configuration of the zlib compression library |
|
2 * Copyright (C) 1995-2013 Jean-loup Gailly. |
|
3 * For conditions of distribution and use, see copyright notice in zlib.h |
|
4 */ |
|
5 |
|
6 /* @(#) $Id$ */ |
|
7 |
|
8 #ifndef ZCONF_H |
|
9 #define ZCONF_H |
|
10 |
|
11 /* This header does prefixing as below, but with an updated set of names. */ |
|
12 #include "mozzconf.h" |
|
13 |
|
14 /* |
|
15 * If you *really* need a unique prefix for all types and library functions, |
|
16 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. |
|
17 * Even better than compiling with -DZ_PREFIX would be to use configure to set |
|
18 * this permanently in zconf.h using "./configure --zprefix". |
|
19 */ |
|
20 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ |
|
21 # define Z_PREFIX_SET |
|
22 |
|
23 /* all linked symbols */ |
|
24 # define _dist_code z__dist_code |
|
25 # define _length_code z__length_code |
|
26 # define _tr_align z__tr_align |
|
27 # define _tr_flush_bits z__tr_flush_bits |
|
28 # define _tr_flush_block z__tr_flush_block |
|
29 # define _tr_init z__tr_init |
|
30 # define _tr_stored_block z__tr_stored_block |
|
31 # define _tr_tally z__tr_tally |
|
32 # define adler32 z_adler32 |
|
33 # define adler32_combine z_adler32_combine |
|
34 # define adler32_combine64 z_adler32_combine64 |
|
35 # ifndef Z_SOLO |
|
36 # define compress z_compress |
|
37 # define compress2 z_compress2 |
|
38 # define compressBound z_compressBound |
|
39 # endif |
|
40 # define crc32 z_crc32 |
|
41 # define crc32_combine z_crc32_combine |
|
42 # define crc32_combine64 z_crc32_combine64 |
|
43 # define deflate z_deflate |
|
44 # define deflateBound z_deflateBound |
|
45 # define deflateCopy z_deflateCopy |
|
46 # define deflateEnd z_deflateEnd |
|
47 # define deflateInit2_ z_deflateInit2_ |
|
48 # define deflateInit_ z_deflateInit_ |
|
49 # define deflateParams z_deflateParams |
|
50 # define deflatePending z_deflatePending |
|
51 # define deflatePrime z_deflatePrime |
|
52 # define deflateReset z_deflateReset |
|
53 # define deflateResetKeep z_deflateResetKeep |
|
54 # define deflateSetDictionary z_deflateSetDictionary |
|
55 # define deflateSetHeader z_deflateSetHeader |
|
56 # define deflateTune z_deflateTune |
|
57 # define deflate_copyright z_deflate_copyright |
|
58 # define get_crc_table z_get_crc_table |
|
59 # ifndef Z_SOLO |
|
60 # define gz_error z_gz_error |
|
61 # define gz_intmax z_gz_intmax |
|
62 # define gz_strwinerror z_gz_strwinerror |
|
63 # define gzbuffer z_gzbuffer |
|
64 # define gzclearerr z_gzclearerr |
|
65 # define gzclose z_gzclose |
|
66 # define gzclose_r z_gzclose_r |
|
67 # define gzclose_w z_gzclose_w |
|
68 # define gzdirect z_gzdirect |
|
69 # define gzdopen z_gzdopen |
|
70 # define gzeof z_gzeof |
|
71 # define gzerror z_gzerror |
|
72 # define gzflush z_gzflush |
|
73 # define gzgetc z_gzgetc |
|
74 # define gzgetc_ z_gzgetc_ |
|
75 # define gzgets z_gzgets |
|
76 # define gzoffset z_gzoffset |
|
77 # define gzoffset64 z_gzoffset64 |
|
78 # define gzopen z_gzopen |
|
79 # define gzopen64 z_gzopen64 |
|
80 # ifdef _WIN32 |
|
81 # define gzopen_w z_gzopen_w |
|
82 # endif |
|
83 # define gzprintf z_gzprintf |
|
84 # define gzvprintf z_gzvprintf |
|
85 # define gzputc z_gzputc |
|
86 # define gzputs z_gzputs |
|
87 # define gzread z_gzread |
|
88 # define gzrewind z_gzrewind |
|
89 # define gzseek z_gzseek |
|
90 # define gzseek64 z_gzseek64 |
|
91 # define gzsetparams z_gzsetparams |
|
92 # define gztell z_gztell |
|
93 # define gztell64 z_gztell64 |
|
94 # define gzungetc z_gzungetc |
|
95 # define gzwrite z_gzwrite |
|
96 # endif |
|
97 # define inflate z_inflate |
|
98 # define inflateBack z_inflateBack |
|
99 # define inflateBackEnd z_inflateBackEnd |
|
100 # define inflateBackInit_ z_inflateBackInit_ |
|
101 # define inflateCopy z_inflateCopy |
|
102 # define inflateEnd z_inflateEnd |
|
103 # define inflateGetHeader z_inflateGetHeader |
|
104 # define inflateInit2_ z_inflateInit2_ |
|
105 # define inflateInit_ z_inflateInit_ |
|
106 # define inflateMark z_inflateMark |
|
107 # define inflatePrime z_inflatePrime |
|
108 # define inflateReset z_inflateReset |
|
109 # define inflateReset2 z_inflateReset2 |
|
110 # define inflateSetDictionary z_inflateSetDictionary |
|
111 # define inflateGetDictionary z_inflateGetDictionary |
|
112 # define inflateSync z_inflateSync |
|
113 # define inflateSyncPoint z_inflateSyncPoint |
|
114 # define inflateUndermine z_inflateUndermine |
|
115 # define inflateResetKeep z_inflateResetKeep |
|
116 # define inflate_copyright z_inflate_copyright |
|
117 # define inflate_fast z_inflate_fast |
|
118 # define inflate_table z_inflate_table |
|
119 # ifndef Z_SOLO |
|
120 # define uncompress z_uncompress |
|
121 # endif |
|
122 # define zError z_zError |
|
123 # ifndef Z_SOLO |
|
124 # define zcalloc z_zcalloc |
|
125 # define zcfree z_zcfree |
|
126 # endif |
|
127 # define zlibCompileFlags z_zlibCompileFlags |
|
128 # define zlibVersion z_zlibVersion |
|
129 |
|
130 /* all zlib typedefs in zlib.h and zconf.h */ |
|
131 # define Byte z_Byte |
|
132 # define Bytef z_Bytef |
|
133 # define alloc_func z_alloc_func |
|
134 # define charf z_charf |
|
135 # define free_func z_free_func |
|
136 # ifndef Z_SOLO |
|
137 # define gzFile z_gzFile |
|
138 # endif |
|
139 # define gz_header z_gz_header |
|
140 # define gz_headerp z_gz_headerp |
|
141 # define in_func z_in_func |
|
142 # define intf z_intf |
|
143 # define out_func z_out_func |
|
144 # define uInt z_uInt |
|
145 # define uIntf z_uIntf |
|
146 # define uLong z_uLong |
|
147 # define uLongf z_uLongf |
|
148 # define voidp z_voidp |
|
149 # define voidpc z_voidpc |
|
150 # define voidpf z_voidpf |
|
151 |
|
152 /* all zlib structs in zlib.h and zconf.h */ |
|
153 # define gz_header_s z_gz_header_s |
|
154 # define internal_state z_internal_state |
|
155 |
|
156 #endif |
|
157 |
|
158 #if defined(__MSDOS__) && !defined(MSDOS) |
|
159 # define MSDOS |
|
160 #endif |
|
161 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) |
|
162 # define OS2 |
|
163 #endif |
|
164 #if defined(_WINDOWS) && !defined(WINDOWS) |
|
165 # define WINDOWS |
|
166 #endif |
|
167 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) |
|
168 # ifndef WIN32 |
|
169 # define WIN32 |
|
170 # endif |
|
171 #endif |
|
172 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) |
|
173 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) |
|
174 # ifndef SYS16BIT |
|
175 # define SYS16BIT |
|
176 # endif |
|
177 # endif |
|
178 #endif |
|
179 |
|
180 /* |
|
181 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more |
|
182 * than 64k bytes at a time (needed on systems with 16-bit int). |
|
183 */ |
|
184 #ifdef SYS16BIT |
|
185 # define MAXSEG_64K |
|
186 #endif |
|
187 #ifdef MSDOS |
|
188 # define UNALIGNED_OK |
|
189 #endif |
|
190 |
|
191 #ifdef __STDC_VERSION__ |
|
192 # ifndef STDC |
|
193 # define STDC |
|
194 # endif |
|
195 # if __STDC_VERSION__ >= 199901L |
|
196 # ifndef STDC99 |
|
197 # define STDC99 |
|
198 # endif |
|
199 # endif |
|
200 #endif |
|
201 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) |
|
202 # define STDC |
|
203 #endif |
|
204 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) |
|
205 # define STDC |
|
206 #endif |
|
207 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) |
|
208 # define STDC |
|
209 #endif |
|
210 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) |
|
211 # define STDC |
|
212 #endif |
|
213 |
|
214 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ |
|
215 # define STDC |
|
216 #endif |
|
217 |
|
218 #ifndef STDC |
|
219 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ |
|
220 # define const /* note: need a more gentle solution here */ |
|
221 # endif |
|
222 #endif |
|
223 |
|
224 #if defined(ZLIB_CONST) && !defined(z_const) |
|
225 # define z_const const |
|
226 #else |
|
227 # define z_const |
|
228 #endif |
|
229 |
|
230 /* Some Mac compilers merge all .h files incorrectly: */ |
|
231 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) |
|
232 # define NO_DUMMY_DECL |
|
233 #endif |
|
234 |
|
235 /* Maximum value for memLevel in deflateInit2 */ |
|
236 #ifndef MAX_MEM_LEVEL |
|
237 # ifdef MAXSEG_64K |
|
238 # define MAX_MEM_LEVEL 8 |
|
239 # else |
|
240 # define MAX_MEM_LEVEL 9 |
|
241 # endif |
|
242 #endif |
|
243 |
|
244 /* Maximum value for windowBits in deflateInit2 and inflateInit2. |
|
245 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files |
|
246 * created by gzip. (Files created by minigzip can still be extracted by |
|
247 * gzip.) |
|
248 */ |
|
249 #ifndef MAX_WBITS |
|
250 # define MAX_WBITS 15 /* 32K LZ77 window */ |
|
251 #endif |
|
252 |
|
253 /* The memory requirements for deflate are (in bytes): |
|
254 (1 << (windowBits+2)) + (1 << (memLevel+9)) |
|
255 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) |
|
256 plus a few kilobytes for small objects. For example, if you want to reduce |
|
257 the default memory requirements from 256K to 128K, compile with |
|
258 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" |
|
259 Of course this will generally degrade compression (there's no free lunch). |
|
260 |
|
261 The memory requirements for inflate are (in bytes) 1 << windowBits |
|
262 that is, 32K for windowBits=15 (default value) plus a few kilobytes |
|
263 for small objects. |
|
264 */ |
|
265 |
|
266 /* Type declarations */ |
|
267 |
|
268 #ifndef OF /* function prototypes */ |
|
269 # ifdef STDC |
|
270 # define OF(args) args |
|
271 # else |
|
272 # define OF(args) () |
|
273 # endif |
|
274 #endif |
|
275 |
|
276 #ifndef Z_ARG /* function prototypes for stdarg */ |
|
277 # if defined(STDC) || defined(Z_HAVE_STDARG_H) |
|
278 # define Z_ARG(args) args |
|
279 # else |
|
280 # define Z_ARG(args) () |
|
281 # endif |
|
282 #endif |
|
283 |
|
284 /* The following definitions for FAR are needed only for MSDOS mixed |
|
285 * model programming (small or medium model with some far allocations). |
|
286 * This was tested only with MSC; for other MSDOS compilers you may have |
|
287 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, |
|
288 * just define FAR to be empty. |
|
289 */ |
|
290 #ifdef SYS16BIT |
|
291 # if defined(M_I86SM) || defined(M_I86MM) |
|
292 /* MSC small or medium model */ |
|
293 # define SMALL_MEDIUM |
|
294 # ifdef _MSC_VER |
|
295 # define FAR _far |
|
296 # else |
|
297 # define FAR far |
|
298 # endif |
|
299 # endif |
|
300 # if (defined(__SMALL__) || defined(__MEDIUM__)) |
|
301 /* Turbo C small or medium model */ |
|
302 # define SMALL_MEDIUM |
|
303 # ifdef __BORLANDC__ |
|
304 # define FAR _far |
|
305 # else |
|
306 # define FAR far |
|
307 # endif |
|
308 # endif |
|
309 #endif |
|
310 |
|
311 #if defined(WINDOWS) || defined(WIN32) |
|
312 /* If building or using zlib as a DLL, define ZLIB_DLL. |
|
313 * This is not mandatory, but it offers a little performance increase. |
|
314 */ |
|
315 # ifdef ZLIB_DLL |
|
316 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) |
|
317 # ifdef ZLIB_INTERNAL |
|
318 # define ZEXTERN extern __declspec(dllexport) |
|
319 # else |
|
320 # define ZEXTERN extern __declspec(dllimport) |
|
321 # endif |
|
322 # endif |
|
323 # endif /* ZLIB_DLL */ |
|
324 /* If building or using zlib with the WINAPI/WINAPIV calling convention, |
|
325 * define ZLIB_WINAPI. |
|
326 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. |
|
327 */ |
|
328 # ifdef ZLIB_WINAPI |
|
329 # ifdef FAR |
|
330 # undef FAR |
|
331 # endif |
|
332 # include <windows.h> |
|
333 /* No need for _export, use ZLIB.DEF instead. */ |
|
334 /* For complete Windows compatibility, use WINAPI, not __stdcall. */ |
|
335 # define ZEXPORT WINAPI |
|
336 # ifdef WIN32 |
|
337 # define ZEXPORTVA WINAPIV |
|
338 # else |
|
339 # define ZEXPORTVA FAR CDECL |
|
340 # endif |
|
341 # endif |
|
342 #endif |
|
343 |
|
344 #if defined (__BEOS__) || (defined(__OS2__) && defined(__declspec)) |
|
345 # ifdef ZLIB_DLL |
|
346 # ifdef ZLIB_INTERNAL |
|
347 # define ZEXPORT __declspec(dllexport) |
|
348 # define ZEXPORTVA __declspec(dllexport) |
|
349 # else |
|
350 # define ZEXPORT __declspec(dllimport) |
|
351 # define ZEXPORTVA __declspec(dllimport) |
|
352 # endif |
|
353 # endif |
|
354 #endif |
|
355 |
|
356 #ifndef ZEXTERN |
|
357 # define ZEXTERN extern |
|
358 #endif |
|
359 #ifndef ZEXPORT |
|
360 # define ZEXPORT |
|
361 #endif |
|
362 #ifndef ZEXPORTVA |
|
363 # define ZEXPORTVA |
|
364 #endif |
|
365 |
|
366 #ifndef FAR |
|
367 # define FAR |
|
368 #endif |
|
369 |
|
370 #if !defined(__MACTYPES__) |
|
371 typedef unsigned char Byte; /* 8 bits */ |
|
372 #endif |
|
373 typedef unsigned int uInt; /* 16 bits or more */ |
|
374 typedef unsigned long uLong; /* 32 bits or more */ |
|
375 |
|
376 #ifdef SMALL_MEDIUM |
|
377 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ |
|
378 # define Bytef Byte FAR |
|
379 #else |
|
380 typedef Byte FAR Bytef; |
|
381 #endif |
|
382 typedef char FAR charf; |
|
383 typedef int FAR intf; |
|
384 typedef uInt FAR uIntf; |
|
385 typedef uLong FAR uLongf; |
|
386 |
|
387 #ifdef STDC |
|
388 typedef void const *voidpc; |
|
389 typedef void FAR *voidpf; |
|
390 typedef void *voidp; |
|
391 #else |
|
392 typedef Byte const *voidpc; |
|
393 typedef Byte FAR *voidpf; |
|
394 typedef Byte *voidp; |
|
395 #endif |
|
396 |
|
397 #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) |
|
398 # include <limits.h> |
|
399 # if (UINT_MAX == 0xffffffffUL) |
|
400 # define Z_U4 unsigned |
|
401 # elif (ULONG_MAX == 0xffffffffUL) |
|
402 # define Z_U4 unsigned long |
|
403 # elif (USHRT_MAX == 0xffffffffUL) |
|
404 # define Z_U4 unsigned short |
|
405 # endif |
|
406 #endif |
|
407 |
|
408 #ifdef Z_U4 |
|
409 typedef Z_U4 z_crc_t; |
|
410 #else |
|
411 typedef unsigned long z_crc_t; |
|
412 #endif |
|
413 |
|
414 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ |
|
415 # define Z_HAVE_UNISTD_H |
|
416 #endif |
|
417 |
|
418 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ |
|
419 # define Z_HAVE_STDARG_H |
|
420 #endif |
|
421 |
|
422 #ifdef STDC |
|
423 # ifndef Z_SOLO |
|
424 # include <sys/types.h> /* for off_t */ |
|
425 # endif |
|
426 #endif |
|
427 |
|
428 #if defined(STDC) || defined(Z_HAVE_STDARG_H) |
|
429 # ifndef Z_SOLO |
|
430 # include <stdarg.h> /* for va_list */ |
|
431 # endif |
|
432 #endif |
|
433 |
|
434 #ifdef _WIN32 |
|
435 # ifndef Z_SOLO |
|
436 # include <stddef.h> /* for wchar_t */ |
|
437 # endif |
|
438 #endif |
|
439 |
|
440 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and |
|
441 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even |
|
442 * though the former does not conform to the LFS document), but considering |
|
443 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as |
|
444 * equivalently requesting no 64-bit operations |
|
445 */ |
|
446 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 |
|
447 # undef _LARGEFILE64_SOURCE |
|
448 #endif |
|
449 |
|
450 #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) |
|
451 # define Z_HAVE_UNISTD_H |
|
452 #endif |
|
453 #ifndef Z_SOLO |
|
454 # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) |
|
455 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ |
|
456 # ifdef VMS |
|
457 # include <unixio.h> /* for off_t */ |
|
458 # endif |
|
459 # ifndef z_off_t |
|
460 # define z_off_t off_t |
|
461 # endif |
|
462 # endif |
|
463 #endif |
|
464 |
|
465 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 |
|
466 # define Z_LFS64 |
|
467 #endif |
|
468 |
|
469 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) |
|
470 # define Z_LARGE64 |
|
471 #endif |
|
472 |
|
473 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) |
|
474 # define Z_WANT64 |
|
475 #endif |
|
476 |
|
477 #if !defined(SEEK_SET) && !defined(Z_SOLO) |
|
478 # define SEEK_SET 0 /* Seek from beginning of file. */ |
|
479 # define SEEK_CUR 1 /* Seek from current position. */ |
|
480 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ |
|
481 #endif |
|
482 |
|
483 #ifndef z_off_t |
|
484 # define z_off_t long |
|
485 #endif |
|
486 |
|
487 #if !defined(_WIN32) && defined(Z_LARGE64) |
|
488 # define z_off64_t off64_t |
|
489 #else |
|
490 # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) |
|
491 # define z_off64_t __int64 |
|
492 # else |
|
493 # define z_off64_t z_off_t |
|
494 # endif |
|
495 #endif |
|
496 |
|
497 /* MVS linker does not support external names larger than 8 bytes */ |
|
498 #if defined(__MVS__) |
|
499 #pragma map(deflateInit_,"DEIN") |
|
500 #pragma map(deflateInit2_,"DEIN2") |
|
501 #pragma map(deflateEnd,"DEEND") |
|
502 #pragma map(deflateBound,"DEBND") |
|
503 #pragma map(inflateInit_,"ININ") |
|
504 #pragma map(inflateInit2_,"ININ2") |
|
505 #pragma map(inflateEnd,"INEND") |
|
506 #pragma map(inflateSync,"INSY") |
|
507 #pragma map(inflateSetDictionary,"INSEDI") |
|
508 #pragma map(compressBound,"CMBND") |
|
509 #pragma map(inflate_table,"INTABL") |
|
510 #pragma map(inflate_fast,"INFA") |
|
511 #pragma map(inflate_copyright,"INCOPY") |
|
512 #endif |
|
513 |
|
514 #endif /* ZCONF_H */ |