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".
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
32 # define adler32_z z_adler32_z
34 # define compress z_compress
35 # define compress2 z_compress2
36 # define compressBound z_compressBound
38 # define crc32 z_crc32
39 # define crc32_combine z_crc32_combine
40 # define crc32_combine64 z_crc32_combine64
41 # define crc32_z z_crc32_z
42 # define deflate z_deflate
43 # define deflateBound z_deflateBound
44 # define deflateCopy z_deflateCopy
45 # define deflateEnd z_deflateEnd
46 # define deflateGetDictionary z_deflateGetDictionary
47 # define deflateInit z_deflateInit
48 # define deflateInit2 z_deflateInit2
49 # define deflateInit2_ z_deflateInit2_
50 # define deflateInit_ z_deflateInit_
51 # define deflateParams z_deflateParams
52 # define deflatePending z_deflatePending
53 # define deflatePrime z_deflatePrime
54 # define deflateReset z_deflateReset
55 # define deflateResetKeep z_deflateResetKeep
56 # define deflateSetDictionary z_deflateSetDictionary
57 # define deflateSetHeader z_deflateSetHeader
58 # define deflateTune z_deflateTune
59 # define deflate_copyright z_deflate_copyright
60 # define get_crc_table z_get_crc_table
62 # define gz_error z_gz_error
63 # define gz_intmax z_gz_intmax
64 # define gz_strwinerror z_gz_strwinerror
65 # define gzbuffer z_gzbuffer
66 # define gzclearerr z_gzclearerr
67 # define gzclose z_gzclose
68 # define gzclose_r z_gzclose_r
69 # define gzclose_w z_gzclose_w
70 # define gzdirect z_gzdirect
71 # define gzdopen z_gzdopen
72 # define gzeof z_gzeof
73 # define gzerror z_gzerror
74 # define gzflush z_gzflush
75 # define gzfread z_gzfread
76 # define gzfwrite z_gzfwrite
77 # define gzgetc z_gzgetc
78 # define gzgetc_ z_gzgetc_
79 # define gzgets z_gzgets
80 # define gzoffset z_gzoffset
81 # define gzoffset64 z_gzoffset64
82 # define gzopen z_gzopen
83 # define gzopen64 z_gzopen64
85 # define gzopen_w z_gzopen_w
87 # define gzprintf z_gzprintf
88 # define gzputc z_gzputc
89 # define gzputs z_gzputs
90 # define gzread z_gzread
91 # define gzrewind z_gzrewind
92 # define gzseek z_gzseek
93 # define gzseek64 z_gzseek64
94 # define gzsetparams z_gzsetparams
95 # define gztell z_gztell
96 # define gztell64 z_gztell64
97 # define gzungetc z_gzungetc
98 # define gzvprintf z_gzvprintf
99 # define gzwrite z_gzwrite
101 # define inflate z_inflate
102 # define inflateBack z_inflateBack
103 # define inflateBackEnd z_inflateBackEnd
104 # define inflateBackInit z_inflateBackInit
105 # define inflateBackInit_ z_inflateBackInit_
106 # define inflateCodesUsed z_inflateCodesUsed
107 # define inflateCopy z_inflateCopy
108 # define inflateEnd z_inflateEnd
109 # define inflateGetDictionary z_inflateGetDictionary
110 # define inflateGetHeader z_inflateGetHeader
111 # define inflateInit z_inflateInit
112 # define inflateInit2 z_inflateInit2
113 # define inflateInit2_ z_inflateInit2_
114 # define inflateInit_ z_inflateInit_
115 # define inflateMark z_inflateMark
116 # define inflatePrime z_inflatePrime
117 # define inflateReset z_inflateReset
118 # define inflateReset2 z_inflateReset2
119 # define inflateResetKeep z_inflateResetKeep
120 # define inflateSetDictionary z_inflateSetDictionary
121 # define inflateSync z_inflateSync
122 # define inflateSyncPoint z_inflateSyncPoint
123 # define inflateUndermine z_inflateUndermine
124 # define inflateValidate z_inflateValidate
125 # define inflate_copyright z_inflate_copyright
126 # define inflate_fast z_inflate_fast
127 # define inflate_table z_inflate_table
129 # define uncompress z_uncompress
130 # define uncompress2 z_uncompress2
132 # define zError z_zError
134 # define zcalloc z_zcalloc
135 # define zcfree z_zcfree
137 # define zlibCompileFlags z_zlibCompileFlags
138 # define zlibVersion z_zlibVersion
140 /* all zlib typedefs in zlib.h and zconf.h */
142 # define Bytef z_Bytef
143 # define alloc_func z_alloc_func
144 # define charf z_charf
145 # define free_func z_free_func
147 # define gzFile z_gzFile
149 # define gz_header z_gz_header
150 # define gz_headerp z_gz_headerp
151 # define in_func z_in_func
153 # define out_func z_out_func
155 # define uIntf z_uIntf
156 # define uLong z_uLong
157 # define uLongf z_uLongf
158 # define voidp z_voidp
159 # define voidpc z_voidpc
160 # define voidpf z_voidpf
162 /* all zlib structs in zlib.h and zconf.h */
163 # define gz_header_s z_gz_header_s
164 # define internal_state z_internal_state
168 #if defined(__MSDOS__) && !defined(MSDOS)
171 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
174 #if defined(_WINDOWS) && !defined(WINDOWS)
177 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
182 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
183 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
191 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
192 * than 64k bytes at a time (needed on systems with 16-bit int).
198 # define UNALIGNED_OK
201 #ifdef __STDC_VERSION__
205 # if __STDC_VERSION__ >= 199901L
211 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
214 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
217 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
220 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
224 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
229 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
230 # define const /* note: need a more gentle solution here */
234 #if defined(ZLIB_CONST) && !defined(z_const)
235 # define z_const const
241 typedef unsigned long z_size_t
;
243 # define z_longlong long long
244 # if defined(NO_SIZE_T)
245 typedef unsigned NO_SIZE_T z_size_t
;
248 typedef size_t z_size_t
;
250 typedef unsigned long z_size_t
;
255 /* Maximum value for memLevel in deflateInit2 */
256 #ifndef MAX_MEM_LEVEL
258 # define MAX_MEM_LEVEL 8
260 # define MAX_MEM_LEVEL 9
264 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
265 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
266 * created by gzip. (Files created by minigzip can still be extracted by
270 # define MAX_WBITS 15 /* 32K LZ77 window */
273 /* The memory requirements for deflate are (in bytes):
274 (1 << (windowBits+2)) + (1 << (memLevel+9))
275 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
276 plus a few kilobytes for small objects. For example, if you want to reduce
277 the default memory requirements from 256K to 128K, compile with
278 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
279 Of course this will generally degrade compression (there's no free lunch).
281 The memory requirements for inflate are (in bytes) 1 << windowBits
282 that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
286 /* Type declarations */
288 #ifndef OF /* function prototypes */
290 # define OF(args) args
296 #ifndef Z_ARG /* function prototypes for stdarg */
297 # if defined(STDC) || defined(Z_HAVE_STDARG_H)
298 # define Z_ARG(args) args
300 # define Z_ARG(args) ()
304 /* The following definitions for FAR are needed only for MSDOS mixed
305 * model programming (small or medium model with some far allocations).
306 * This was tested only with MSC; for other MSDOS compilers you may have
307 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
308 * just define FAR to be empty.
311 # if defined(M_I86SM) || defined(M_I86MM)
312 /* MSC small or medium model */
313 # define SMALL_MEDIUM
320 # if (defined(__SMALL__) || defined(__MEDIUM__))
321 /* Turbo C small or medium model */
322 # define SMALL_MEDIUM
331 #if defined(WINDOWS) || defined(WIN32)
332 /* If building or using zlib as a DLL, define ZLIB_DLL.
333 * This is not mandatory, but it offers a little performance increase.
336 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
337 # ifdef ZLIB_INTERNAL
338 # define ZEXTERN extern __declspec(dllexport)
340 # define ZEXTERN extern __declspec(dllimport)
343 # endif /* ZLIB_DLL */
344 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
345 * define ZLIB_WINAPI.
346 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
352 # include <windows.h>
353 /* No need for _export, use ZLIB.DEF instead. */
354 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
355 # define ZEXPORT WINAPI
357 # define ZEXPORTVA WINAPIV
359 # define ZEXPORTVA FAR CDECL
364 #if defined (__BEOS__)
366 # ifdef ZLIB_INTERNAL
367 # define ZEXPORT __declspec(dllexport)
368 # define ZEXPORTVA __declspec(dllexport)
370 # define ZEXPORT __declspec(dllimport)
371 # define ZEXPORTVA __declspec(dllimport)
377 # define ZEXTERN extern
390 #if !defined(__MACTYPES__)
391 typedef unsigned char Byte
; /* 8 bits */
393 typedef unsigned int uInt
; /* 16 bits or more */
394 typedef unsigned long uLong
; /* 32 bits or more */
397 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
398 # define Bytef Byte FAR
400 typedef Byte FAR Bytef
;
402 typedef char FAR charf
;
403 typedef int FAR intf
;
404 typedef uInt FAR uIntf
;
405 typedef uLong FAR uLongf
;
408 typedef void const *voidpc
;
409 typedef void FAR
*voidpf
;
412 typedef Byte
const *voidpc
;
413 typedef Byte FAR
*voidpf
;
417 #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
419 # if (UINT_MAX == 0xffffffffUL)
420 # define Z_U4 unsigned
421 # elif (ULONG_MAX == 0xffffffffUL)
422 # define Z_U4 unsigned long
423 # elif (USHRT_MAX == 0xffffffffUL)
424 # define Z_U4 unsigned short
429 typedef Z_U4 z_crc_t
;
431 typedef unsigned long z_crc_t
;
434 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
435 # define Z_HAVE_UNISTD_H
438 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
439 # define Z_HAVE_STDARG_H
444 # include <sys/types.h> /* for off_t */
448 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
450 # include <stdarg.h> /* for va_list */
456 # include <stddef.h> /* for wchar_t */
460 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
461 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
462 * though the former does not conform to the LFS document), but considering
463 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
464 * equivalently requesting no 64-bit operations
466 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
467 # undef _LARGEFILE64_SOURCE
470 #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
471 # define Z_HAVE_UNISTD_H
474 # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
475 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
477 # include <unixio.h> /* for off_t */
480 # define z_off_t off_t
485 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
489 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
493 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
497 #if !defined(SEEK_SET) && !defined(Z_SOLO)
498 # define SEEK_SET 0 /* Seek from beginning of file. */
499 # define SEEK_CUR 1 /* Seek from current position. */
500 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
504 # define z_off_t long
507 #if !defined(_WIN32) && defined(Z_LARGE64)
508 # define z_off64_t off64_t
510 # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
511 # define z_off64_t __int64
513 # define z_off64_t z_off_t
517 /* MVS linker does not support external names larger than 8 bytes */
519 #pragma map(deflateInit_,"DEIN")
520 #pragma map(deflateInit2_,"DEIN2")
521 #pragma map(deflateEnd,"DEEND")
522 #pragma map(deflateBound,"DEBND")
523 #pragma map(inflateInit_,"ININ")
524 #pragma map(inflateInit2_,"ININ2")
525 #pragma map(inflateEnd,"INEND")
526 #pragma map(inflateSync,"INSY")
527 #pragma map(inflateSetDictionary,"INSEDI")
528 #pragma map(compressBound,"CMBND")
529 #pragma map(inflate_table,"INTABL")
530 #pragma map(inflate_fast,"INFA")
531 #pragma map(inflate_copyright,"INCOPY")