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
11 /* DRAGONFLY ADDITION - Allows inclusion in conf/files */
15 * If you *really* need a unique prefix for all types and library functions,
16 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
17 * Even better than compiling with -DZ_PREFIX would be to use configure to set
18 * this permanently in zconf.h using "./configure --zprefix".
20 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
23 /* all linked symbols */
24 # define _dist_code z__dist_code
25 # define _length_code z__length_code
26 # define _tr_align z__tr_align
27 # define _tr_flush_bits z__tr_flush_bits
28 # define _tr_flush_block z__tr_flush_block
29 # define _tr_init z__tr_init
30 # define _tr_stored_block z__tr_stored_block
31 # define _tr_tally z__tr_tally
32 # define adler32 z_adler32
33 # define adler32_combine z_adler32_combine
34 # define adler32_combine64 z_adler32_combine64
35 # define deflate z_deflate
36 # define deflateBound z_deflateBound
37 # define deflateCopy z_deflateCopy
38 # define deflateEnd z_deflateEnd
39 # define deflateInit2_ z_deflateInit2_
40 # define deflateInit_ z_deflateInit_
41 # define deflateParams z_deflateParams
42 # define deflatePending z_deflatePending
43 # define deflatePrime z_deflatePrime
44 # define deflateReset z_deflateReset
45 # define deflateResetKeep z_deflateResetKeep
46 # define deflateSetDictionary z_deflateSetDictionary
47 # define deflateSetHeader z_deflateSetHeader
48 # define deflateTune z_deflateTune
49 # define deflate_copyright z_deflate_copyright
50 # define inflate z_inflate
51 # define inflateCopy z_inflateCopy
52 # define inflateEnd z_inflateEnd
53 # define inflateGetHeader z_inflateGetHeader
54 # define inflateInit2_ z_inflateInit2_
55 # define inflateInit_ z_inflateInit_
56 # define inflateMark z_inflateMark
57 # define inflatePrime z_inflatePrime
58 # define inflateReset z_inflateReset
59 # define inflateReset2 z_inflateReset2
60 # define inflateSetDictionary z_inflateSetDictionary
61 # define inflateGetDictionary z_inflateGetDictionary
62 # define inflateSync z_inflateSync
63 # define inflateSyncPoint z_inflateSyncPoint
64 # define inflateUndermine z_inflateUndermine
65 # define inflateResetKeep z_inflateResetKeep
66 # define inflate_copyright z_inflate_copyright
67 # define inflate_fast z_inflate_fast
68 # define inflate_table z_inflate_table
69 # define zError z_zError
70 # define zlibCompileFlags z_zlibCompileFlags
71 # define zlibVersion z_zlibVersion
73 /* all zlib typedefs in zlib.h and zconf.h */
75 # define Bytef z_Bytef
76 # define alloc_func z_alloc_func
77 # define charf z_charf
78 # define free_func z_free_func
79 # define in_func z_in_func
81 # define out_func z_out_func
83 # define uIntf z_uIntf
84 # define uLong z_uLong
85 # define uLongf z_uLongf
86 # define voidp z_voidp
87 # define voidpc z_voidpc
88 # define voidpf z_voidpf
90 /* all zlib structs in zlib.h and zconf.h */
91 # define internal_state z_internal_state
95 #ifdef __STDC_VERSION__
99 # if __STDC_VERSION__ >= 199901L
105 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
108 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
112 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
117 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
118 # define const /* note: need a more gentle solution here */
122 #if defined(ZLIB_CONST) && !defined(z_const)
123 # define z_const const
128 /* Maximum value for memLevel in deflateInit2 */
129 #ifndef MAX_MEM_LEVEL
131 # define MAX_MEM_LEVEL 8
133 # define MAX_MEM_LEVEL 9
137 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
138 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
139 * created by gzip. (Files created by minigzip can still be extracted by
143 # define MAX_WBITS 15 /* 32K LZ77 window */
146 /* The memory requirements for deflate are (in bytes):
147 (1 << (windowBits+2)) + (1 << (memLevel+9))
148 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
149 plus a few kilobytes for small objects. For example, if you want to reduce
150 the default memory requirements from 256K to 128K, compile with
151 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
152 Of course this will generally degrade compression (there's no free lunch).
154 The memory requirements for inflate are (in bytes) 1 << windowBits
155 that is, 32K for windowBits=15 (default value) plus a few kilobytes
159 /* Type declarations */
161 #ifndef Z_ARG /* function prototypes for stdarg */
162 # if defined(STDC) || defined(Z_HAVE_STDARG_H)
163 # define Z_ARG(args) args
165 # define Z_ARG(args) ()
170 # define ZEXTERN extern
183 #if !defined(__MACTYPES__)
184 typedef unsigned char Byte; /* 8 bits */
186 typedef unsigned int uInt; /* 16 bits or more */
187 typedef unsigned long uLong; /* 32 bits or more */
190 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
191 # define Bytef Byte FAR
193 typedef Byte FAR Bytef;
195 typedef char FAR charf;
196 typedef int FAR intf;
197 typedef uInt FAR uIntf;
198 typedef uLong FAR uLongf;
201 typedef void const *voidpc;
202 typedef void FAR *voidpf;
205 typedef Byte const *voidpc;
206 typedef Byte FAR *voidpf;
210 #if !defined(Z_U4) && defined(STDC)
212 # if (UINT_MAX == 0xffffffffUL)
213 # define Z_U4 unsigned
214 # elif (ULONG_MAX == 0xffffffffUL)
215 # define Z_U4 unsigned long
216 # elif (USHRT_MAX == 0xffffffffUL)
217 # define Z_U4 unsigned short
222 typedef Z_U4 z_crc_t;
224 typedef unsigned long z_crc_t;
227 #if 1 /* was set to #if 1 by ./configure */
228 # define Z_HAVE_UNISTD_H
231 #if 1 /* was set to #if 1 by ./configure */
232 # define Z_HAVE_STDARG_H
235 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
236 # include <stdarg.h> /* for va_list */
239 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
240 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
241 * though the former does not conform to the LFS document), but considering
242 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
243 * equivalently requesting no 64-bit operations
245 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
246 # undef _LARGEFILE64_SOURCE
249 #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
250 # define Z_HAVE_UNISTD_H
253 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
257 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
261 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
266 # define z_off_t long
269 #if !defined(_WIN32) && defined(Z_LARGE64)
270 # define z_off64_t off64_t
272 # define z_off64_t z_off_t
275 /* MVS linker does not support external names larger than 8 bytes */
277 #pragma map(deflateInit_,"DEIN")
278 #pragma map(deflateInit2_,"DEIN2")
279 #pragma map(deflateEnd,"DEEND")
280 #pragma map(deflateBound,"DEBND")
281 #pragma map(inflateInit_,"ININ")
282 #pragma map(inflateInit2_,"ININ2")
283 #pragma map(inflateEnd,"INEND")
284 #pragma map(inflateSync,"INSY")
285 #pragma map(inflateSetDictionary,"INSEDI")
286 //#pragma map(compressBound,"CMBND")
287 #pragma map(inflate_table,"INTABL")
288 #pragma map(inflate_fast,"INFA")
289 #pragma map(inflate_copyright,"INCOPY")