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;
241 typedef NO_SSIZE_T z_ssize_t;
243 # include <sys/types.h>
244 typedef ssize_t z_ssize_t;
249 /* Maximum value for memLevel in deflateInit2 */
250 #ifndef MAX_MEM_LEVEL
252 # define MAX_MEM_LEVEL 8
254 # define MAX_MEM_LEVEL 9
258 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
259 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
260 * created by gzip. (Files created by minigzip can still be extracted by
264 # define MAX_WBITS 15 /* 32K LZ77 window */
267 /* The memory requirements for deflate are (in bytes):
268 (1 << (windowBits+2)) + (1 << (memLevel+9))
269 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
270 plus a few kilobytes for small objects. For example, if you want to reduce
271 the default memory requirements from 256K to 128K, compile with
272 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
273 Of course this will generally degrade compression (there's no free lunch).
275 The memory requirements for inflate are (in bytes) 1 << windowBits
276 that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
280 /* Type declarations */
282 #ifndef OF /* function prototypes */
284 # define OF(args) args
290 #ifndef Z_ARG /* function prototypes for stdarg */
291 # if defined(STDC) || defined(Z_HAVE_STDARG_H)
292 # define Z_ARG(args) args
294 # define Z_ARG(args) ()
298 /* The following definitions for FAR are needed only for MSDOS mixed
299 * model programming (small or medium model with some far allocations).
300 * This was tested only with MSC; for other MSDOS compilers you may have
301 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
302 * just define FAR to be empty.
305 # if defined(M_I86SM) || defined(M_I86MM)
306 /* MSC small or medium model */
307 # define SMALL_MEDIUM
314 # if (defined(__SMALL__) || defined(__MEDIUM__))
315 /* Turbo C small or medium model */
316 # define SMALL_MEDIUM
325 #if defined(WINDOWS) || defined(WIN32)
326 /* If building or using zlib as a DLL, define ZLIB_DLL.
327 * This is not mandatory, but it offers a little performance increase.
330 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
331 # ifdef ZLIB_INTERNAL
332 # define ZEXTERN extern __declspec(dllexport)
334 # define ZEXTERN extern __declspec(dllimport)
337 # endif /* ZLIB_DLL */
338 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
339 * define ZLIB_WINAPI.
340 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
346 # include <windows.h>
347 /* No need for _export, use ZLIB.DEF instead. */
348 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
349 # define ZEXPORT WINAPI
351 # define ZEXPORTVA WINAPIV
353 # define ZEXPORTVA FAR CDECL
358 #if defined (__BEOS__)
360 # ifdef ZLIB_INTERNAL
361 # define ZEXPORT __declspec(dllexport)
362 # define ZEXPORTVA __declspec(dllexport)
364 # define ZEXPORT __declspec(dllimport)
365 # define ZEXPORTVA __declspec(dllimport)
371 # define ZEXTERN extern
384 #if !defined(__MACTYPES__)
385 typedef unsigned char Byte; /* 8 bits */
387 typedef unsigned int uInt; /* 16 bits or more */
388 typedef unsigned long uLong; /* 32 bits or more */
391 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
392 # define Bytef Byte FAR
394 typedef Byte FAR Bytef;
396 typedef char FAR charf;
397 typedef int FAR intf;
398 typedef uInt FAR uIntf;
399 typedef uLong FAR uLongf;
402 typedef void const *voidpc;
403 typedef void FAR *voidpf;
406 typedef Byte const *voidpc;
407 typedef Byte FAR *voidpf;
411 #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
413 # if (UINT_MAX == 0xffffffffUL)
414 # define Z_U4 unsigned
415 # elif (ULONG_MAX == 0xffffffffUL)
416 # define Z_U4 unsigned long
417 # elif (USHRT_MAX == 0xffffffffUL)
418 # define Z_U4 unsigned short
423 typedef Z_U4 z_crc_t;
425 typedef unsigned long z_crc_t;
428 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
429 # define Z_HAVE_UNISTD_H
432 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
433 # define Z_HAVE_STDARG_H
438 # include <sys/types.h> /* for off_t */
442 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
444 # include <stdarg.h> /* for va_list */
450 # include <stddef.h> /* for wchar_t */
454 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
455 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
456 * though the former does not conform to the LFS document), but considering
457 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
458 * equivalently requesting no 64-bit operations
460 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
461 # undef _LARGEFILE64_SOURCE
464 #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
465 # define Z_HAVE_UNISTD_H
468 # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
469 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
471 # include <unixio.h> /* for off_t */
474 # define z_off_t off_t
479 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
483 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
487 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
491 #if !defined(SEEK_SET) && !defined(Z_SOLO)
492 # define SEEK_SET 0 /* Seek from beginning of file. */
493 # define SEEK_CUR 1 /* Seek from current position. */
494 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
498 # define z_off_t long
501 #if !defined(_WIN32) && defined(Z_LARGE64)
502 # define z_off64_t off64_t
504 # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
505 # define z_off64_t __int64
507 # define z_off64_t z_off_t
511 /* MVS linker does not support external names larger than 8 bytes */
513 #pragma map(deflateInit_,"DEIN")
514 #pragma map(deflateInit2_,"DEIN2")
515 #pragma map(deflateEnd,"DEEND")
516 #pragma map(deflateBound,"DEBND")
517 #pragma map(inflateInit_,"ININ")
518 #pragma map(inflateInit2_,"ININ2")
519 #pragma map(inflateEnd,"INEND")
520 #pragma map(inflateSync,"INSY")
521 #pragma map(inflateSetDictionary,"INSEDI")
522 #pragma map(compressBound,"CMBND")
523 #pragma map(inflate_table,"INTABL")
524 #pragma map(inflate_fast,"INFA")
525 #pragma map(inflate_copyright,"INCOPY")