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
12 * If you *really* need a unique prefix for all types and library functions,
13 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
14 * Even better than compiling with -DZ_PREFIX would be to use configure to set
15 * this permanently in zconf.h using "./configure --zprefix".
17 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
20 /* all linked symbols */
21 # define _dist_code z__dist_code
22 # define _length_code z__length_code
23 # define _tr_align z__tr_align
24 # define _tr_flush_bits z__tr_flush_bits
25 # define _tr_flush_block z__tr_flush_block
26 # define _tr_init z__tr_init
27 # define _tr_stored_block z__tr_stored_block
28 # define _tr_tally z__tr_tally
29 # define adler32 z_adler32
30 # define adler32_combine z_adler32_combine
31 # define adler32_combine64 z_adler32_combine64
33 # define compress z_compress
34 # define compress2 z_compress2
35 # define compressBound z_compressBound
37 # define crc32 z_crc32
38 # define crc32_combine z_crc32_combine
39 # define crc32_combine64 z_crc32_combine64
40 # define deflate z_deflate
41 # define deflateBound z_deflateBound
42 # define deflateCopy z_deflateCopy
43 # define deflateEnd z_deflateEnd
44 # define deflateInit2_ z_deflateInit2_
45 # define deflateInit_ z_deflateInit_
46 # define deflateParams z_deflateParams
47 # define deflatePending z_deflatePending
48 # define deflatePrime z_deflatePrime
49 # define deflateReset z_deflateReset
50 # define deflateResetKeep z_deflateResetKeep
51 # define deflateSetDictionary z_deflateSetDictionary
52 # define deflateSetHeader z_deflateSetHeader
53 # define deflateTune z_deflateTune
54 # define deflate_copyright z_deflate_copyright
55 # define get_crc_table z_get_crc_table
57 # define gz_error z_gz_error
58 # define gz_intmax z_gz_intmax
59 # define gz_strwinerror z_gz_strwinerror
60 # define gzbuffer z_gzbuffer
61 # define gzclearerr z_gzclearerr
62 # define gzclose z_gzclose
63 # define gzclose_r z_gzclose_r
64 # define gzclose_w z_gzclose_w
65 # define gzdirect z_gzdirect
66 # define gzdopen z_gzdopen
67 # define gzeof z_gzeof
68 # define gzerror z_gzerror
69 # define gzflush z_gzflush
70 # define gzgetc z_gzgetc
71 # define gzgetc_ z_gzgetc_
72 # define gzgets z_gzgets
73 # define gzoffset z_gzoffset
74 # define gzoffset64 z_gzoffset64
75 # define gzopen z_gzopen
76 # define gzopen64 z_gzopen64
78 # define gzopen_w z_gzopen_w
80 # define gzprintf z_gzprintf
81 # define gzvprintf z_gzvprintf
82 # define gzputc z_gzputc
83 # define gzputs z_gzputs
84 # define gzread z_gzread
85 # define gzrewind z_gzrewind
86 # define gzseek z_gzseek
87 # define gzseek64 z_gzseek64
88 # define gzsetparams z_gzsetparams
89 # define gztell z_gztell
90 # define gztell64 z_gztell64
91 # define gzungetc z_gzungetc
92 # define gzwrite z_gzwrite
94 # define inflate z_inflate
95 # define inflateBack z_inflateBack
96 # define inflateBackEnd z_inflateBackEnd
97 # define inflateBackInit_ z_inflateBackInit_
98 # define inflateCopy z_inflateCopy
99 # define inflateEnd z_inflateEnd
100 # define inflateGetHeader z_inflateGetHeader
101 # define inflateInit2_ z_inflateInit2_
102 # define inflateInit_ z_inflateInit_
103 # define inflateMark z_inflateMark
104 # define inflatePrime z_inflatePrime
105 # define inflateReset z_inflateReset
106 # define inflateReset2 z_inflateReset2
107 # define inflateSetDictionary z_inflateSetDictionary
108 # define inflateGetDictionary z_inflateGetDictionary
109 # define inflateSync z_inflateSync
110 # define inflateSyncPoint z_inflateSyncPoint
111 # define inflateUndermine z_inflateUndermine
112 # define inflateResetKeep z_inflateResetKeep
113 # define inflate_copyright z_inflate_copyright
114 # define inflate_fast z_inflate_fast
115 # define inflate_table z_inflate_table
117 # define uncompress z_uncompress
119 # define zError z_zError
121 # define zcalloc z_zcalloc
122 # define zcfree z_zcfree
124 # define zlibCompileFlags z_zlibCompileFlags
125 # define zlibVersion z_zlibVersion
127 /* all zlib typedefs in zlib.h and zconf.h */
129 # define Bytef z_Bytef
130 # define alloc_func z_alloc_func
131 # define charf z_charf
132 # define free_func z_free_func
134 # define gzFile z_gzFile
136 # define gz_header z_gz_header
137 # define gz_headerp z_gz_headerp
138 # define in_func z_in_func
140 # define out_func z_out_func
142 # define uIntf z_uIntf
143 # define uLong z_uLong
144 # define uLongf z_uLongf
145 # define voidp z_voidp
146 # define voidpc z_voidpc
147 # define voidpf z_voidpf
149 /* all zlib structs in zlib.h and zconf.h */
150 # define gz_header_s z_gz_header_s
151 # define internal_state z_internal_state
155 #if defined(__MSDOS__) && !defined(MSDOS)
158 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
161 #if defined(_WINDOWS) && !defined(WINDOWS)
164 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
169 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
170 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
178 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
179 * than 64k bytes at a time (needed on systems with 16-bit int).
185 # define UNALIGNED_OK
188 #ifdef __STDC_VERSION__
192 # if __STDC_VERSION__ >= 199901L
198 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
201 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
204 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
207 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
211 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
216 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
217 # define const /* note: need a more gentle solution here */
221 #if defined(ZLIB_CONST) && !defined(z_const)
222 # define z_const const
227 /* Maximum value for memLevel in deflateInit2 */
228 #ifndef MAX_MEM_LEVEL
230 # define MAX_MEM_LEVEL 8
232 # define MAX_MEM_LEVEL 9
236 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
237 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
238 * created by gzip. (Files created by minigzip can still be extracted by
242 # define MAX_WBITS 15 /* 32K LZ77 window */
245 /* The memory requirements for deflate are (in bytes):
246 (1 << (windowBits+2)) + (1 << (memLevel+9))
247 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
248 plus a few kilobytes for small objects. For example, if you want to reduce
249 the default memory requirements from 256K to 128K, compile with
250 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
251 Of course this will generally degrade compression (there's no free lunch).
253 The memory requirements for inflate are (in bytes) 1 << windowBits
254 that is, 32K for windowBits=15 (default value) plus a few kilobytes
258 /* Type declarations */
260 #ifndef OF /* function prototypes */
262 # define OF(args) args
268 #ifndef Z_ARG /* function prototypes for stdarg */
269 # if defined(STDC) || defined(Z_HAVE_STDARG_H)
270 # define Z_ARG(args) args
272 # define Z_ARG(args) ()
276 /* The following definitions for FAR are needed only for MSDOS mixed
277 * model programming (small or medium model with some far allocations).
278 * This was tested only with MSC; for other MSDOS compilers you may have
279 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
280 * just define FAR to be empty.
283 # if defined(M_I86SM) || defined(M_I86MM)
284 /* MSC small or medium model */
285 # define SMALL_MEDIUM
292 # if (defined(__SMALL__) || defined(__MEDIUM__))
293 /* Turbo C small or medium model */
294 # define SMALL_MEDIUM
303 #if defined(WINDOWS) || defined(WIN32)
304 /* If building or using zlib as a DLL, define ZLIB_DLL.
305 * This is not mandatory, but it offers a little performance increase.
308 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
309 # ifdef ZLIB_INTERNAL
310 # define ZEXTERN extern __declspec(dllexport)
312 # define ZEXTERN extern __declspec(dllimport)
315 # endif /* ZLIB_DLL */
316 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
317 * define ZLIB_WINAPI.
318 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
324 # include <windows.h>
325 /* No need for _export, use ZLIB.DEF instead. */
326 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
327 # define ZEXPORT WINAPI
329 # define ZEXPORTVA WINAPIV
331 # define ZEXPORTVA FAR CDECL
336 #if defined (__BEOS__)
338 # ifdef ZLIB_INTERNAL
339 # define ZEXPORT __declspec(dllexport)
340 # define ZEXPORTVA __declspec(dllexport)
342 # define ZEXPORT __declspec(dllimport)
343 # define ZEXPORTVA __declspec(dllimport)
349 # define ZEXTERN extern
362 #if !defined(__MACTYPES__)
363 typedef unsigned char Byte; /* 8 bits */
365 typedef unsigned int uInt; /* 16 bits or more */
366 typedef unsigned long uLong; /* 32 bits or more */
369 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
370 # define Bytef Byte FAR
372 typedef Byte FAR Bytef;
374 typedef char FAR charf;
375 typedef int FAR intf;
376 typedef uInt FAR uIntf;
377 typedef uLong FAR uLongf;
380 typedef void const *voidpc;
381 typedef void FAR *voidpf;
384 typedef Byte const *voidpc;
385 typedef Byte FAR *voidpf;
389 #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
391 # if (UINT_MAX == 0xffffffffUL)
392 # define Z_U4 unsigned
393 # elif (ULONG_MAX == 0xffffffffUL)
394 # define Z_U4 unsigned long
395 # elif (USHRT_MAX == 0xffffffffUL)
396 # define Z_U4 unsigned short
401 typedef Z_U4 z_crc_t;
403 typedef unsigned long z_crc_t;
406 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
407 # define Z_HAVE_UNISTD_H
410 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
411 # define Z_HAVE_STDARG_H
416 # include <sys/types.h> /* for off_t */
420 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
422 # include <stdarg.h> /* for va_list */
428 # include <stddef.h> /* for wchar_t */
432 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
433 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
434 * though the former does not conform to the LFS document), but considering
435 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
436 * equivalently requesting no 64-bit operations
438 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
439 # undef _LARGEFILE64_SOURCE
442 #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
443 # define Z_HAVE_UNISTD_H
446 # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
447 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
449 # include <unixio.h> /* for off_t */
452 # define z_off_t off_t
457 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
461 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
465 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
469 #if !defined(SEEK_SET) && !defined(Z_SOLO)
470 # define SEEK_SET 0 /* Seek from beginning of file. */
471 # define SEEK_CUR 1 /* Seek from current position. */
472 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
476 # define z_off_t long
479 #if !defined(_WIN32) && defined(Z_LARGE64)
480 # define z_off64_t off64_t
482 # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
483 # define z_off64_t __int64
485 # define z_off64_t z_off_t
489 /* MVS linker does not support external names larger than 8 bytes */
491 #pragma map(deflateInit_,"DEIN")
492 #pragma map(deflateInit2_,"DEIN2")
493 #pragma map(deflateEnd,"DEEND")
494 #pragma map(deflateBound,"DEBND")
495 #pragma map(inflateInit_,"ININ")
496 #pragma map(inflateInit2_,"ININ2")
497 #pragma map(inflateEnd,"INEND")
498 #pragma map(inflateSync,"INSY")
499 #pragma map(inflateSetDictionary,"INSEDI")
500 #pragma map(compressBound,"CMBND")
501 #pragma map(inflate_table,"INTABL")
502 #pragma map(inflate_fast,"INFA")
503 #pragma map(inflate_copyright,"INCOPY")