1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
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".
18 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
21 /* all linked symbols and init macros */
22 # define _dist_code z__dist_code
23 # define _length_code z__length_code
24 # define _tr_align z__tr_align
25 # define _tr_flush_bits z__tr_flush_bits
26 # define _tr_flush_block z__tr_flush_block
27 # define _tr_init z__tr_init
28 # define _tr_stored_block z__tr_stored_block
29 # define _tr_tally z__tr_tally
30 # define adler32 z_adler32
31 # define adler32_combine z_adler32_combine
32 # define adler32_combine64 z_adler32_combine64
33 # define adler32_z z_adler32_z
35 # define compress z_compress
36 # define compress2 z_compress2
37 # define compressBound z_compressBound
39 # define crc32 z_crc32
40 # define crc32_combine z_crc32_combine
41 # define crc32_combine64 z_crc32_combine64
42 # define crc32_z z_crc32_z
43 # define deflate z_deflate
44 # define deflateBound z_deflateBound
45 # define deflateCopy z_deflateCopy
46 # define deflateEnd z_deflateEnd
47 # define deflateGetDictionary z_deflateGetDictionary
48 # define deflateInit z_deflateInit
49 # define deflateInit2 z_deflateInit2
50 # define deflateInit2_ z_deflateInit2_
51 # define deflateInit_ z_deflateInit_
52 # define deflateParams z_deflateParams
53 # define deflatePending z_deflatePending
54 # define deflatePrime z_deflatePrime
55 # define deflateReset z_deflateReset
56 # define deflateResetKeep z_deflateResetKeep
57 # define deflateSetDictionary z_deflateSetDictionary
58 # define deflateSetHeader z_deflateSetHeader
59 # define deflateTune z_deflateTune
60 # define deflate_copyright z_deflate_copyright
61 # define get_crc_table z_get_crc_table
63 # define gz_error z_gz_error
64 # define gz_intmax z_gz_intmax
65 # define gz_strwinerror z_gz_strwinerror
66 # define gzbuffer z_gzbuffer
67 # define gzclearerr z_gzclearerr
68 # define gzclose z_gzclose
69 # define gzclose_r z_gzclose_r
70 # define gzclose_w z_gzclose_w
71 # define gzdirect z_gzdirect
72 # define gzdopen z_gzdopen
73 # define gzeof z_gzeof
74 # define gzerror z_gzerror
75 # define gzflush z_gzflush
76 # define gzfread z_gzfread
77 # define gzfwrite z_gzfwrite
78 # define gzgetc z_gzgetc
79 # define gzgetc_ z_gzgetc_
80 # define gzgets z_gzgets
81 # define gzoffset z_gzoffset
82 # define gzoffset64 z_gzoffset64
83 # define gzopen z_gzopen
84 # define gzopen64 z_gzopen64
86 # define gzopen_w z_gzopen_w
88 # define gzprintf z_gzprintf
89 # define gzputc z_gzputc
90 # define gzputs z_gzputs
91 # define gzread z_gzread
92 # define gzrewind z_gzrewind
93 # define gzseek z_gzseek
94 # define gzseek64 z_gzseek64
95 # define gzsetparams z_gzsetparams
96 # define gztell z_gztell
97 # define gztell64 z_gztell64
98 # define gzungetc z_gzungetc
99 # define gzvprintf z_gzvprintf
100 # define gzwrite z_gzwrite
102 # define inflate z_inflate
103 # define inflateBack z_inflateBack
104 # define inflateBackEnd z_inflateBackEnd
105 # define inflateBackInit z_inflateBackInit
106 # define inflateBackInit_ z_inflateBackInit_
107 # define inflateCodesUsed z_inflateCodesUsed
108 # define inflateCopy z_inflateCopy
109 # define inflateEnd z_inflateEnd
110 # define inflateGetDictionary z_inflateGetDictionary
111 # define inflateGetHeader z_inflateGetHeader
112 # define inflateInit z_inflateInit
113 # define inflateInit2 z_inflateInit2
114 # define inflateInit2_ z_inflateInit2_
115 # define inflateInit_ z_inflateInit_
116 # define inflateMark z_inflateMark
117 # define inflatePrime z_inflatePrime
118 # define inflateReset z_inflateReset
119 # define inflateReset2 z_inflateReset2
120 # define inflateResetKeep z_inflateResetKeep
121 # define inflateSetDictionary z_inflateSetDictionary
122 # define inflateSync z_inflateSync
123 # define inflateSyncPoint z_inflateSyncPoint
124 # define inflateUndermine z_inflateUndermine
125 # define inflateValidate z_inflateValidate
126 # define inflate_copyright z_inflate_copyright
127 # define inflate_fast z_inflate_fast
128 # define inflate_table z_inflate_table
130 # define uncompress z_uncompress
131 # define uncompress2 z_uncompress2
133 # define zError z_zError
135 # define zcalloc z_zcalloc
136 # define zcfree z_zcfree
138 # define zlibCompileFlags z_zlibCompileFlags
139 # define zlibVersion z_zlibVersion
141 /* all zlib typedefs in zlib.h and zconf.h */
143 # define Bytef z_Bytef
144 # define alloc_func z_alloc_func
145 # define charf z_charf
146 # define free_func z_free_func
148 # define gzFile z_gzFile
150 # define gz_header z_gz_header
151 # define gz_headerp z_gz_headerp
152 # define in_func z_in_func
154 # define out_func z_out_func
156 # define uIntf z_uIntf
157 # define uLong z_uLong
158 # define uLongf z_uLongf
159 # define voidp z_voidp
160 # define voidpc z_voidpc
161 # define voidpf z_voidpf
163 /* all zlib structs in zlib.h and zconf.h */
164 # define gz_header_s z_gz_header_s
165 # define internal_state z_internal_state
169 #if defined(__MSDOS__) && !defined(MSDOS)
172 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
175 #if defined(_WINDOWS) && !defined(WINDOWS)
178 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
183 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
184 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
192 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
193 * than 64k bytes at a time (needed on systems with 16-bit int).
199 # define UNALIGNED_OK
202 #ifdef __STDC_VERSION__
206 # if __STDC_VERSION__ >= 199901L
212 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
215 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
218 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
221 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
225 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
230 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
231 # define const /* note: need a more gentle solution here */
235 #if defined(ZLIB_CONST) && !defined(z_const)
236 # define z_const const
242 typedef unsigned long z_size_t;
244 # define z_longlong long long
245 # if defined(NO_SIZE_T)
246 typedef unsigned NO_SIZE_T z_size_t;
249 typedef size_t z_size_t;
251 typedef unsigned long z_size_t;
256 /* Maximum value for memLevel in deflateInit2 */
257 #ifndef MAX_MEM_LEVEL
259 # define MAX_MEM_LEVEL 8
261 # define MAX_MEM_LEVEL 9
265 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
266 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
267 * created by gzip. (Files created by minigzip can still be extracted by
271 # define MAX_WBITS 15 /* 32K LZ77 window */
274 /* The memory requirements for deflate are (in bytes):
275 (1 << (windowBits+2)) + (1 << (memLevel+9))
276 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
277 plus a few kilobytes for small objects. For example, if you want to reduce
278 the default memory requirements from 256K to 128K, compile with
279 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
280 Of course this will generally degrade compression (there's no free lunch).
282 The memory requirements for inflate are (in bytes) 1 << windowBits
283 that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
287 /* Type declarations */
289 #ifndef OF /* function prototypes */
291 # define OF(args) args
297 #ifndef Z_ARG /* function prototypes for stdarg */
298 # if defined(STDC) || defined(Z_HAVE_STDARG_H)
299 # define Z_ARG(args) args
301 # define Z_ARG(args) ()
305 /* The following definitions for FAR are needed only for MSDOS mixed
306 * model programming (small or medium model with some far allocations).
307 * This was tested only with MSC; for other MSDOS compilers you may have
308 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
309 * just define FAR to be empty.
312 # if defined(M_I86SM) || defined(M_I86MM)
313 /* MSC small or medium model */
314 # define SMALL_MEDIUM
321 # if (defined(__SMALL__) || defined(__MEDIUM__))
322 /* Turbo C small or medium model */
323 # define SMALL_MEDIUM
332 #if defined(WINDOWS) || defined(WIN32)
333 /* If building or using zlib as a DLL, define ZLIB_DLL.
334 * This is not mandatory, but it offers a little performance increase.
337 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
338 # ifdef ZLIB_INTERNAL
339 # define ZEXTERN extern __declspec(dllexport)
341 # define ZEXTERN extern __declspec(dllimport)
344 # endif /* ZLIB_DLL */
345 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
346 * define ZLIB_WINAPI.
347 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
353 # include <windows.h>
354 /* No need for _export, use ZLIB.DEF instead. */
355 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
356 # define ZEXPORT WINAPI
358 # define ZEXPORTVA WINAPIV
360 # define ZEXPORTVA FAR CDECL
365 #if defined (__BEOS__)
367 # ifdef ZLIB_INTERNAL
368 # define ZEXPORT __declspec(dllexport)
369 # define ZEXPORTVA __declspec(dllexport)
371 # define ZEXPORT __declspec(dllimport)
372 # define ZEXPORTVA __declspec(dllimport)
378 # define ZEXTERN extern
391 #if !defined(__MACTYPES__)
392 typedef unsigned char Byte; /* 8 bits */
394 typedef unsigned int uInt; /* 16 bits or more */
395 typedef unsigned long uLong; /* 32 bits or more */
398 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
399 # define Bytef Byte FAR
401 typedef Byte FAR Bytef;
403 typedef char FAR charf;
404 typedef int FAR intf;
405 typedef uInt FAR uIntf;
406 typedef uLong FAR uLongf;
409 typedef void const *voidpc;
410 typedef void FAR *voidpf;
413 typedef Byte const *voidpc;
414 typedef Byte FAR *voidpf;
418 #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
420 # if (UINT_MAX == 0xffffffffUL)
421 # define Z_U4 unsigned
422 # elif (ULONG_MAX == 0xffffffffUL)
423 # define Z_U4 unsigned long
424 # elif (USHRT_MAX == 0xffffffffUL)
425 # define Z_U4 unsigned short
430 typedef Z_U4 z_crc_t;
432 typedef unsigned long z_crc_t;
435 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
436 # define Z_HAVE_UNISTD_H
439 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
440 # define Z_HAVE_STDARG_H
445 # include <sys/types.h> /* for off_t */
449 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
451 # include <stdarg.h> /* for va_list */
457 # include <stddef.h> /* for wchar_t */
461 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
462 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
463 * though the former does not conform to the LFS document), but considering
464 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
465 * equivalently requesting no 64-bit operations
467 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
468 # undef _LARGEFILE64_SOURCE
471 #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
472 # define Z_HAVE_UNISTD_H
475 # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
476 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
478 # include <unixio.h> /* for off_t */
481 # define z_off_t off_t
486 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
490 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
494 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
498 #if !defined(SEEK_SET) && !defined(Z_SOLO)
499 # define SEEK_SET 0 /* Seek from beginning of file. */
500 # define SEEK_CUR 1 /* Seek from current position. */
501 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
505 # define z_off_t long
508 #if !defined(_WIN32) && defined(Z_LARGE64)
509 # define z_off64_t off64_t
511 # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
512 # define z_off64_t __int64
514 # define z_off64_t z_off_t
518 /* MVS linker does not support external names larger than 8 bytes */
520 #pragma map(deflateInit_,"DEIN")
521 #pragma map(deflateInit2_,"DEIN2")
522 #pragma map(deflateEnd,"DEEND")
523 #pragma map(deflateBound,"DEBND")
524 #pragma map(inflateInit_,"ININ")
525 #pragma map(inflateInit2_,"ININ2")
526 #pragma map(inflateEnd,"INEND")
527 #pragma map(inflateSync,"INSY")
528 #pragma map(inflateSetDictionary,"INSEDI")
529 #pragma map(compressBound,"CMBND")
530 #pragma map(inflate_table,"INTABL")
531 #pragma map(inflate_fast,"INFA")
532 #pragma map(inflate_copyright,"INCOPY")