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 and init macros */
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 deflateInit z_deflateInit
45 # define deflateInit2 z_deflateInit2
46 # define deflateInit2_ z_deflateInit2_
47 # define deflateInit_ z_deflateInit_
48 # define deflateParams z_deflateParams
49 # define deflatePending z_deflatePending
50 # define deflatePrime z_deflatePrime
51 # define deflateReset z_deflateReset
52 # define deflateResetKeep z_deflateResetKeep
53 # define deflateSetDictionary z_deflateSetDictionary
54 # define deflateSetHeader z_deflateSetHeader
55 # define deflateTune z_deflateTune
56 # define deflate_copyright z_deflate_copyright
57 # define get_crc_table z_get_crc_table
59 # define gz_error z_gz_error
60 # define gz_intmax z_gz_intmax
61 # define gz_strwinerror z_gz_strwinerror
62 # define gzbuffer z_gzbuffer
63 # define gzclearerr z_gzclearerr
64 # define gzclose z_gzclose
65 # define gzclose_r z_gzclose_r
66 # define gzclose_w z_gzclose_w
67 # define gzdirect z_gzdirect
68 # define gzdopen z_gzdopen
69 # define gzeof z_gzeof
70 # define gzerror z_gzerror
71 # define gzflush z_gzflush
72 # define gzgetc z_gzgetc
73 # define gzgetc_ z_gzgetc_
74 # define gzgets z_gzgets
75 # define gzoffset z_gzoffset
76 # define gzoffset64 z_gzoffset64
77 # define gzopen z_gzopen
78 # define gzopen64 z_gzopen64
80 # define gzopen_w z_gzopen_w
82 # define gzprintf z_gzprintf
83 # define gzvprintf z_gzvprintf
84 # define gzputc z_gzputc
85 # define gzputs z_gzputs
86 # define gzread z_gzread
87 # define gzrewind z_gzrewind
88 # define gzseek z_gzseek
89 # define gzseek64 z_gzseek64
90 # define gzsetparams z_gzsetparams
91 # define gztell z_gztell
92 # define gztell64 z_gztell64
93 # define gzungetc z_gzungetc
94 # define gzwrite z_gzwrite
96 # define inflate z_inflate
97 # define inflateBack z_inflateBack
98 # define inflateBackEnd z_inflateBackEnd
99 # define inflateBackInit z_inflateBackInit
100 # define inflateBackInit_ z_inflateBackInit_
101 # define inflateCopy z_inflateCopy
102 # define inflateEnd z_inflateEnd
103 # define inflateGetHeader z_inflateGetHeader
104 # define inflateInit z_inflateInit
105 # define inflateInit2 z_inflateInit2
106 # define inflateInit2_ z_inflateInit2_
107 # define inflateInit_ z_inflateInit_
108 # define inflateMark z_inflateMark
109 # define inflatePrime z_inflatePrime
110 # define inflateReset z_inflateReset
111 # define inflateReset2 z_inflateReset2
112 # define inflateSetDictionary z_inflateSetDictionary
113 # define inflateGetDictionary z_inflateGetDictionary
114 # define inflateSync z_inflateSync
115 # define inflateSyncPoint z_inflateSyncPoint
116 # define inflateUndermine z_inflateUndermine
117 # define inflateResetKeep z_inflateResetKeep
118 # define inflate_copyright z_inflate_copyright
119 # define inflate_fast z_inflate_fast
120 # define inflate_table z_inflate_table
122 # define uncompress z_uncompress
124 # define zError z_zError
126 # define zcalloc z_zcalloc
127 # define zcfree z_zcfree
129 # define zlibCompileFlags z_zlibCompileFlags
130 # define zlibVersion z_zlibVersion
132 /* all zlib typedefs in zlib.h and zconf.h */
134 # define Bytef z_Bytef
135 # define alloc_func z_alloc_func
136 # define charf z_charf
137 # define free_func z_free_func
139 # define gzFile z_gzFile
141 # define gz_header z_gz_header
142 # define gz_headerp z_gz_headerp
143 # define in_func z_in_func
145 # define out_func z_out_func
147 # define uIntf z_uIntf
148 # define uLong z_uLong
149 # define uLongf z_uLongf
150 # define voidp z_voidp
151 # define voidpc z_voidpc
152 # define voidpf z_voidpf
154 /* all zlib structs in zlib.h and zconf.h */
155 # define gz_header_s z_gz_header_s
156 # define internal_state z_internal_state
160 #if defined(__MSDOS__) && !defined(MSDOS)
163 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
166 #if defined(_WINDOWS) && !defined(WINDOWS)
169 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
174 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
175 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
183 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
184 * than 64k bytes at a time (needed on systems with 16-bit int).
190 # define UNALIGNED_OK
193 #ifdef __STDC_VERSION__
197 # if __STDC_VERSION__ >= 199901L
203 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
206 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
209 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
212 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
216 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
221 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
222 # define const /* note: need a more gentle solution here */
226 #if defined(ZLIB_CONST) && !defined(z_const)
227 # define z_const const
233 # define z_longlong long long
235 typedef unsigned NO_SIZE_T z_size_t;
238 typedef size_t z_size_t;
243 /* Maximum value for memLevel in deflateInit2 */
244 #ifndef MAX_MEM_LEVEL
246 # define MAX_MEM_LEVEL 8
248 # define MAX_MEM_LEVEL 9
252 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
253 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
254 * created by gzip. (Files created by minigzip can still be extracted by
258 # define MAX_WBITS 15 /* 32K LZ77 window */
261 /* The memory requirements for deflate are (in bytes):
262 (1 << (windowBits+2)) + (1 << (memLevel+9))
263 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
264 plus a few kilobytes for small objects. For example, if you want to reduce
265 the default memory requirements from 256K to 128K, compile with
266 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
267 Of course this will generally degrade compression (there's no free lunch).
269 The memory requirements for inflate are (in bytes) 1 << windowBits
270 that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
274 /* Type declarations */
276 #ifndef OF /* function prototypes */
278 # define OF(args) args
284 #ifndef Z_ARG /* function prototypes for stdarg */
285 # if defined(STDC) || defined(Z_HAVE_STDARG_H)
286 # define Z_ARG(args) args
288 # define Z_ARG(args) ()
292 /* The following definitions for FAR are needed only for MSDOS mixed
293 * model programming (small or medium model with some far allocations).
294 * This was tested only with MSC; for other MSDOS compilers you may have
295 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
296 * just define FAR to be empty.
299 # if defined(M_I86SM) || defined(M_I86MM)
300 /* MSC small or medium model */
301 # define SMALL_MEDIUM
308 # if (defined(__SMALL__) || defined(__MEDIUM__))
309 /* Turbo C small or medium model */
310 # define SMALL_MEDIUM
319 #if defined(WINDOWS) || defined(WIN32)
320 /* If building or using zlib as a DLL, define ZLIB_DLL.
321 * This is not mandatory, but it offers a little performance increase.
324 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
325 # ifdef ZLIB_INTERNAL
326 # define ZEXTERN extern __declspec(dllexport)
328 # define ZEXTERN extern __declspec(dllimport)
331 # endif /* ZLIB_DLL */
332 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
333 * define ZLIB_WINAPI.
334 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
340 # include <windows.h>
341 /* No need for _export, use ZLIB.DEF instead. */
342 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
343 # define ZEXPORT WINAPI
345 # define ZEXPORTVA WINAPIV
347 # define ZEXPORTVA FAR CDECL
352 #if defined (__BEOS__)
354 # ifdef ZLIB_INTERNAL
355 # define ZEXPORT __declspec(dllexport)
356 # define ZEXPORTVA __declspec(dllexport)
358 # define ZEXPORT __declspec(dllimport)
359 # define ZEXPORTVA __declspec(dllimport)
365 # define ZEXTERN extern
378 #if !defined(__MACTYPES__)
379 typedef unsigned char Byte; /* 8 bits */
381 typedef unsigned int uInt; /* 16 bits or more */
382 typedef unsigned long uLong; /* 32 bits or more */
385 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
386 # define Bytef Byte FAR
388 typedef Byte FAR Bytef;
390 typedef char FAR charf;
391 typedef int FAR intf;
392 typedef uInt FAR uIntf;
393 typedef uLong FAR uLongf;
396 typedef void const *voidpc;
397 typedef void FAR *voidpf;
400 typedef Byte const *voidpc;
401 typedef Byte FAR *voidpf;
405 #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
407 # if (UINT_MAX == 0xffffffffUL)
408 # define Z_U4 unsigned
409 # elif (ULONG_MAX == 0xffffffffUL)
410 # define Z_U4 unsigned long
411 # elif (USHRT_MAX == 0xffffffffUL)
412 # define Z_U4 unsigned short
417 typedef Z_U4 z_crc_t;
419 typedef unsigned long z_crc_t;
422 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
423 # define Z_HAVE_UNISTD_H
426 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
427 # define Z_HAVE_STDARG_H
432 # include <sys/types.h> /* for off_t */
436 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
438 # include <stdarg.h> /* for va_list */
444 # include <stddef.h> /* for wchar_t */
448 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
449 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
450 * though the former does not conform to the LFS document), but considering
451 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
452 * equivalently requesting no 64-bit operations
454 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
455 # undef _LARGEFILE64_SOURCE
458 #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
459 # define Z_HAVE_UNISTD_H
462 # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
463 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
465 # include <unixio.h> /* for off_t */
468 # define z_off_t off_t
473 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
477 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
481 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
485 #if !defined(SEEK_SET) && !defined(Z_SOLO)
486 # define SEEK_SET 0 /* Seek from beginning of file. */
487 # define SEEK_CUR 1 /* Seek from current position. */
488 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
492 # define z_off_t long
495 #if !defined(_WIN32) && defined(Z_LARGE64)
496 # define z_off64_t off64_t
498 # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
499 # define z_off64_t __int64
501 # define z_off64_t z_off_t
505 /* MVS linker does not support external names larger than 8 bytes */
507 #pragma map(deflateInit_,"DEIN")
508 #pragma map(deflateInit2_,"DEIN2")
509 #pragma map(deflateEnd,"DEEND")
510 #pragma map(deflateBound,"DEBND")
511 #pragma map(inflateInit_,"ININ")
512 #pragma map(inflateInit2_,"ININ2")
513 #pragma map(inflateEnd,"INEND")
514 #pragma map(inflateSync,"INSY")
515 #pragma map(inflateSetDictionary,"INSEDI")
516 #pragma map(compressBound,"CMBND")
517 #pragma map(inflate_table,"INTABL")
518 #pragma map(inflate_fast,"INFA")
519 #pragma map(inflate_copyright,"INCOPY")