1*3aa7d58aSMatthew Dillon /* zconf.h -- configuration of the zlib compression library
2*3aa7d58aSMatthew Dillon  * Copyright (C) 1995-2013 Jean-loup Gailly.
3*3aa7d58aSMatthew Dillon  * For conditions of distribution and use, see copyright notice in zlib.h
4*3aa7d58aSMatthew Dillon  */
5*3aa7d58aSMatthew Dillon 
6*3aa7d58aSMatthew Dillon /* @(#) $Id$ */
7*3aa7d58aSMatthew Dillon 
8*3aa7d58aSMatthew Dillon #ifndef ZCONF_H
9*3aa7d58aSMatthew Dillon #define ZCONF_H
10*3aa7d58aSMatthew Dillon 
11*3aa7d58aSMatthew Dillon /* DRAGONFLY ADDITION - Allows inclusion in conf/files */
12*3aa7d58aSMatthew Dillon #define Z_PREFIX
13*3aa7d58aSMatthew Dillon 
14*3aa7d58aSMatthew Dillon /*
15*3aa7d58aSMatthew Dillon  * If you *really* need a unique prefix for all types and library functions,
16*3aa7d58aSMatthew Dillon  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
17*3aa7d58aSMatthew Dillon  * Even better than compiling with -DZ_PREFIX would be to use configure to set
18*3aa7d58aSMatthew Dillon  * this permanently in zconf.h using "./configure --zprefix".
19*3aa7d58aSMatthew Dillon  */
20*3aa7d58aSMatthew Dillon #ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
21*3aa7d58aSMatthew Dillon #  define Z_PREFIX_SET
22*3aa7d58aSMatthew Dillon 
23*3aa7d58aSMatthew Dillon /* all linked symbols */
24*3aa7d58aSMatthew Dillon #  define _dist_code            z__dist_code
25*3aa7d58aSMatthew Dillon #  define _length_code          z__length_code
26*3aa7d58aSMatthew Dillon #  define _tr_align             z__tr_align
27*3aa7d58aSMatthew Dillon #  define _tr_flush_bits        z__tr_flush_bits
28*3aa7d58aSMatthew Dillon #  define _tr_flush_block       z__tr_flush_block
29*3aa7d58aSMatthew Dillon #  define _tr_init              z__tr_init
30*3aa7d58aSMatthew Dillon #  define _tr_stored_block      z__tr_stored_block
31*3aa7d58aSMatthew Dillon #  define _tr_tally             z__tr_tally
32*3aa7d58aSMatthew Dillon #  define adler32               z_adler32
33*3aa7d58aSMatthew Dillon #  define adler32_combine       z_adler32_combine
34*3aa7d58aSMatthew Dillon #  define adler32_combine64     z_adler32_combine64
35*3aa7d58aSMatthew Dillon #  define deflate               z_deflate
36*3aa7d58aSMatthew Dillon #  define deflateBound          z_deflateBound
37*3aa7d58aSMatthew Dillon #  define deflateCopy           z_deflateCopy
38*3aa7d58aSMatthew Dillon #  define deflateEnd            z_deflateEnd
39*3aa7d58aSMatthew Dillon #  define deflateInit2_         z_deflateInit2_
40*3aa7d58aSMatthew Dillon #  define deflateInit_          z_deflateInit_
41*3aa7d58aSMatthew Dillon #  define deflateParams         z_deflateParams
42*3aa7d58aSMatthew Dillon #  define deflatePending        z_deflatePending
43*3aa7d58aSMatthew Dillon #  define deflatePrime          z_deflatePrime
44*3aa7d58aSMatthew Dillon #  define deflateReset          z_deflateReset
45*3aa7d58aSMatthew Dillon #  define deflateResetKeep      z_deflateResetKeep
46*3aa7d58aSMatthew Dillon #  define deflateSetDictionary  z_deflateSetDictionary
47*3aa7d58aSMatthew Dillon #  define deflateSetHeader      z_deflateSetHeader
48*3aa7d58aSMatthew Dillon #  define deflateTune           z_deflateTune
49*3aa7d58aSMatthew Dillon #  define deflate_copyright     z_deflate_copyright
50*3aa7d58aSMatthew Dillon #  define inflate               z_inflate
51*3aa7d58aSMatthew Dillon #  define inflateCopy           z_inflateCopy
52*3aa7d58aSMatthew Dillon #  define inflateEnd            z_inflateEnd
53*3aa7d58aSMatthew Dillon #  define inflateGetHeader      z_inflateGetHeader
54*3aa7d58aSMatthew Dillon #  define inflateInit2_         z_inflateInit2_
55*3aa7d58aSMatthew Dillon #  define inflateInit_          z_inflateInit_
56*3aa7d58aSMatthew Dillon #  define inflateMark           z_inflateMark
57*3aa7d58aSMatthew Dillon #  define inflatePrime          z_inflatePrime
58*3aa7d58aSMatthew Dillon #  define inflateReset          z_inflateReset
59*3aa7d58aSMatthew Dillon #  define inflateReset2         z_inflateReset2
60*3aa7d58aSMatthew Dillon #  define inflateSetDictionary  z_inflateSetDictionary
61*3aa7d58aSMatthew Dillon #  define inflateGetDictionary  z_inflateGetDictionary
62*3aa7d58aSMatthew Dillon #  define inflateSync           z_inflateSync
63*3aa7d58aSMatthew Dillon #  define inflateSyncPoint      z_inflateSyncPoint
64*3aa7d58aSMatthew Dillon #  define inflateUndermine      z_inflateUndermine
65*3aa7d58aSMatthew Dillon #  define inflateResetKeep      z_inflateResetKeep
66*3aa7d58aSMatthew Dillon #  define inflate_copyright     z_inflate_copyright
67*3aa7d58aSMatthew Dillon #  define inflate_fast          z_inflate_fast
68*3aa7d58aSMatthew Dillon #  define inflate_table         z_inflate_table
69*3aa7d58aSMatthew Dillon #  define zError                z_zError
70*3aa7d58aSMatthew Dillon #  define zlibCompileFlags      z_zlibCompileFlags
71*3aa7d58aSMatthew Dillon #  define zlibVersion           z_zlibVersion
72*3aa7d58aSMatthew Dillon 
73*3aa7d58aSMatthew Dillon /* all zlib typedefs in zlib.h and zconf.h */
74*3aa7d58aSMatthew Dillon #  define Byte                  z_Byte
75*3aa7d58aSMatthew Dillon #  define Bytef                 z_Bytef
76*3aa7d58aSMatthew Dillon #  define alloc_func            z_alloc_func
77*3aa7d58aSMatthew Dillon #  define charf                 z_charf
78*3aa7d58aSMatthew Dillon #  define free_func             z_free_func
79*3aa7d58aSMatthew Dillon #  define in_func               z_in_func
80*3aa7d58aSMatthew Dillon #  define intf                  z_intf
81*3aa7d58aSMatthew Dillon #  define out_func              z_out_func
82*3aa7d58aSMatthew Dillon #  define uInt                  z_uInt
83*3aa7d58aSMatthew Dillon #  define uIntf                 z_uIntf
84*3aa7d58aSMatthew Dillon #  define uLong                 z_uLong
85*3aa7d58aSMatthew Dillon #  define uLongf                z_uLongf
86*3aa7d58aSMatthew Dillon #  define voidp                 z_voidp
87*3aa7d58aSMatthew Dillon #  define voidpc                z_voidpc
88*3aa7d58aSMatthew Dillon #  define voidpf                z_voidpf
89*3aa7d58aSMatthew Dillon 
90*3aa7d58aSMatthew Dillon /* all zlib structs in zlib.h and zconf.h */
91*3aa7d58aSMatthew Dillon #  define internal_state        z_internal_state
92*3aa7d58aSMatthew Dillon 
93*3aa7d58aSMatthew Dillon #endif
94*3aa7d58aSMatthew Dillon 
95*3aa7d58aSMatthew Dillon #ifdef __STDC_VERSION__
96*3aa7d58aSMatthew Dillon #  ifndef STDC
97*3aa7d58aSMatthew Dillon #    define STDC
98*3aa7d58aSMatthew Dillon #  endif
99*3aa7d58aSMatthew Dillon #  if __STDC_VERSION__ >= 199901L
100*3aa7d58aSMatthew Dillon #    ifndef STDC99
101*3aa7d58aSMatthew Dillon #      define STDC99
102*3aa7d58aSMatthew Dillon #    endif
103*3aa7d58aSMatthew Dillon #  endif
104*3aa7d58aSMatthew Dillon #endif
105*3aa7d58aSMatthew Dillon #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
106*3aa7d58aSMatthew Dillon #  define STDC
107*3aa7d58aSMatthew Dillon #endif
108*3aa7d58aSMatthew Dillon #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
109*3aa7d58aSMatthew Dillon #  define STDC
110*3aa7d58aSMatthew Dillon #endif
111*3aa7d58aSMatthew Dillon 
112*3aa7d58aSMatthew Dillon #if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
113*3aa7d58aSMatthew Dillon #  define STDC
114*3aa7d58aSMatthew Dillon #endif
115*3aa7d58aSMatthew Dillon 
116*3aa7d58aSMatthew Dillon #ifndef STDC
117*3aa7d58aSMatthew Dillon #  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
118*3aa7d58aSMatthew Dillon #    define const       /* note: need a more gentle solution here */
119*3aa7d58aSMatthew Dillon #  endif
120*3aa7d58aSMatthew Dillon #endif
121*3aa7d58aSMatthew Dillon 
122*3aa7d58aSMatthew Dillon #if defined(ZLIB_CONST) && !defined(z_const)
123*3aa7d58aSMatthew Dillon #  define z_const const
124*3aa7d58aSMatthew Dillon #else
125*3aa7d58aSMatthew Dillon #  define z_const
126*3aa7d58aSMatthew Dillon #endif
127*3aa7d58aSMatthew Dillon 
128*3aa7d58aSMatthew Dillon /* Maximum value for memLevel in deflateInit2 */
129*3aa7d58aSMatthew Dillon #ifndef MAX_MEM_LEVEL
130*3aa7d58aSMatthew Dillon #  ifdef MAXSEG_64K
131*3aa7d58aSMatthew Dillon #    define MAX_MEM_LEVEL 8
132*3aa7d58aSMatthew Dillon #  else
133*3aa7d58aSMatthew Dillon #    define MAX_MEM_LEVEL 9
134*3aa7d58aSMatthew Dillon #  endif
135*3aa7d58aSMatthew Dillon #endif
136*3aa7d58aSMatthew Dillon 
137*3aa7d58aSMatthew Dillon /* Maximum value for windowBits in deflateInit2 and inflateInit2.
138*3aa7d58aSMatthew Dillon  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
139*3aa7d58aSMatthew Dillon  * created by gzip. (Files created by minigzip can still be extracted by
140*3aa7d58aSMatthew Dillon  * gzip.)
141*3aa7d58aSMatthew Dillon  */
142*3aa7d58aSMatthew Dillon #ifndef MAX_WBITS
143*3aa7d58aSMatthew Dillon #  define MAX_WBITS   15 /* 32K LZ77 window */
144*3aa7d58aSMatthew Dillon #endif
145*3aa7d58aSMatthew Dillon 
146*3aa7d58aSMatthew Dillon /* The memory requirements for deflate are (in bytes):
147*3aa7d58aSMatthew Dillon             (1 << (windowBits+2)) +  (1 << (memLevel+9))
148*3aa7d58aSMatthew Dillon  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
149*3aa7d58aSMatthew Dillon  plus a few kilobytes for small objects. For example, if you want to reduce
150*3aa7d58aSMatthew Dillon  the default memory requirements from 256K to 128K, compile with
151*3aa7d58aSMatthew Dillon      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
152*3aa7d58aSMatthew Dillon  Of course this will generally degrade compression (there's no free lunch).
153*3aa7d58aSMatthew Dillon 
154*3aa7d58aSMatthew Dillon    The memory requirements for inflate are (in bytes) 1 << windowBits
155*3aa7d58aSMatthew Dillon  that is, 32K for windowBits=15 (default value) plus a few kilobytes
156*3aa7d58aSMatthew Dillon  for small objects.
157*3aa7d58aSMatthew Dillon */
158*3aa7d58aSMatthew Dillon 
159*3aa7d58aSMatthew Dillon                         /* Type declarations */
160*3aa7d58aSMatthew Dillon 
161*3aa7d58aSMatthew Dillon #ifndef Z_ARG /* function prototypes for stdarg */
162*3aa7d58aSMatthew Dillon #  if defined(STDC) || defined(Z_HAVE_STDARG_H)
163*3aa7d58aSMatthew Dillon #    define Z_ARG(args)  args
164*3aa7d58aSMatthew Dillon #  else
165*3aa7d58aSMatthew Dillon #    define Z_ARG(args)  ()
166*3aa7d58aSMatthew Dillon #  endif
167*3aa7d58aSMatthew Dillon #endif
168*3aa7d58aSMatthew Dillon 
169*3aa7d58aSMatthew Dillon #ifndef ZEXTERN
170*3aa7d58aSMatthew Dillon #  define ZEXTERN extern
171*3aa7d58aSMatthew Dillon #endif
172*3aa7d58aSMatthew Dillon #ifndef ZEXPORT
173*3aa7d58aSMatthew Dillon #  define ZEXPORT
174*3aa7d58aSMatthew Dillon #endif
175*3aa7d58aSMatthew Dillon #ifndef ZEXPORTVA
176*3aa7d58aSMatthew Dillon #  define ZEXPORTVA
177*3aa7d58aSMatthew Dillon #endif
178*3aa7d58aSMatthew Dillon 
179*3aa7d58aSMatthew Dillon #ifndef FAR
180*3aa7d58aSMatthew Dillon #  define FAR
181*3aa7d58aSMatthew Dillon #endif
182*3aa7d58aSMatthew Dillon 
183*3aa7d58aSMatthew Dillon #if !defined(__MACTYPES__)
184*3aa7d58aSMatthew Dillon typedef unsigned char  Byte;  /* 8 bits */
185*3aa7d58aSMatthew Dillon #endif
186*3aa7d58aSMatthew Dillon typedef unsigned int   uInt;  /* 16 bits or more */
187*3aa7d58aSMatthew Dillon typedef unsigned long  uLong; /* 32 bits or more */
188*3aa7d58aSMatthew Dillon 
189*3aa7d58aSMatthew Dillon #ifdef SMALL_MEDIUM
190*3aa7d58aSMatthew Dillon    /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
191*3aa7d58aSMatthew Dillon #  define Bytef Byte FAR
192*3aa7d58aSMatthew Dillon #else
193*3aa7d58aSMatthew Dillon    typedef Byte  FAR Bytef;
194*3aa7d58aSMatthew Dillon #endif
195*3aa7d58aSMatthew Dillon typedef char  FAR charf;
196*3aa7d58aSMatthew Dillon typedef int   FAR intf;
197*3aa7d58aSMatthew Dillon typedef uInt  FAR uIntf;
198*3aa7d58aSMatthew Dillon typedef uLong FAR uLongf;
199*3aa7d58aSMatthew Dillon 
200*3aa7d58aSMatthew Dillon #ifdef STDC
201*3aa7d58aSMatthew Dillon    typedef void const *voidpc;
202*3aa7d58aSMatthew Dillon    typedef void FAR   *voidpf;
203*3aa7d58aSMatthew Dillon    typedef void       *voidp;
204*3aa7d58aSMatthew Dillon #else
205*3aa7d58aSMatthew Dillon    typedef Byte const *voidpc;
206*3aa7d58aSMatthew Dillon    typedef Byte FAR   *voidpf;
207*3aa7d58aSMatthew Dillon    typedef Byte       *voidp;
208*3aa7d58aSMatthew Dillon #endif
209*3aa7d58aSMatthew Dillon 
210*3aa7d58aSMatthew Dillon #if !defined(Z_U4) && defined(STDC)
211*3aa7d58aSMatthew Dillon #  include <sys/limits.h>
212*3aa7d58aSMatthew Dillon #  if (UINT_MAX == 0xffffffffUL)
213*3aa7d58aSMatthew Dillon #    define Z_U4 unsigned
214*3aa7d58aSMatthew Dillon #  elif (ULONG_MAX == 0xffffffffUL)
215*3aa7d58aSMatthew Dillon #    define Z_U4 unsigned long
216*3aa7d58aSMatthew Dillon #  elif (USHRT_MAX == 0xffffffffUL)
217*3aa7d58aSMatthew Dillon #    define Z_U4 unsigned short
218*3aa7d58aSMatthew Dillon #  endif
219*3aa7d58aSMatthew Dillon #endif
220*3aa7d58aSMatthew Dillon 
221*3aa7d58aSMatthew Dillon #ifdef Z_U4
222*3aa7d58aSMatthew Dillon    typedef Z_U4 z_crc_t;
223*3aa7d58aSMatthew Dillon #else
224*3aa7d58aSMatthew Dillon    typedef unsigned long z_crc_t;
225*3aa7d58aSMatthew Dillon #endif
226*3aa7d58aSMatthew Dillon 
227*3aa7d58aSMatthew Dillon #if 1    /* was set to #if 1 by ./configure */
228*3aa7d58aSMatthew Dillon #  define Z_HAVE_UNISTD_H
229*3aa7d58aSMatthew Dillon #endif
230*3aa7d58aSMatthew Dillon 
231*3aa7d58aSMatthew Dillon #if 1    /* was set to #if 1 by ./configure */
232*3aa7d58aSMatthew Dillon #  define Z_HAVE_STDARG_H
233*3aa7d58aSMatthew Dillon #endif
234*3aa7d58aSMatthew Dillon 
235*3aa7d58aSMatthew Dillon #if defined(STDC) || defined(Z_HAVE_STDARG_H)
236*3aa7d58aSMatthew Dillon #    include <sys/stdarg.h>     /* for va_list */
237*3aa7d58aSMatthew Dillon #endif
238*3aa7d58aSMatthew Dillon 
239*3aa7d58aSMatthew Dillon /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
240*3aa7d58aSMatthew Dillon  * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
241*3aa7d58aSMatthew Dillon  * though the former does not conform to the LFS document), but considering
242*3aa7d58aSMatthew Dillon  * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
243*3aa7d58aSMatthew Dillon  * equivalently requesting no 64-bit operations
244*3aa7d58aSMatthew Dillon  */
245*3aa7d58aSMatthew Dillon #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
246*3aa7d58aSMatthew Dillon #  undef _LARGEFILE64_SOURCE
247*3aa7d58aSMatthew Dillon #endif
248*3aa7d58aSMatthew Dillon 
249*3aa7d58aSMatthew Dillon #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
250*3aa7d58aSMatthew Dillon #  define Z_HAVE_UNISTD_H
251*3aa7d58aSMatthew Dillon #endif
252*3aa7d58aSMatthew Dillon 
253*3aa7d58aSMatthew Dillon #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
254*3aa7d58aSMatthew Dillon #  define Z_LFS64
255*3aa7d58aSMatthew Dillon #endif
256*3aa7d58aSMatthew Dillon 
257*3aa7d58aSMatthew Dillon #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
258*3aa7d58aSMatthew Dillon #  define Z_LARGE64
259*3aa7d58aSMatthew Dillon #endif
260*3aa7d58aSMatthew Dillon 
261*3aa7d58aSMatthew Dillon #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
262*3aa7d58aSMatthew Dillon #  define Z_WANT64
263*3aa7d58aSMatthew Dillon #endif
264*3aa7d58aSMatthew Dillon 
265*3aa7d58aSMatthew Dillon #ifndef z_off_t
266*3aa7d58aSMatthew Dillon #  define z_off_t long
267*3aa7d58aSMatthew Dillon #endif
268*3aa7d58aSMatthew Dillon 
269*3aa7d58aSMatthew Dillon #if !defined(_WIN32) && defined(Z_LARGE64)
270*3aa7d58aSMatthew Dillon #  define z_off64_t off64_t
271*3aa7d58aSMatthew Dillon #else
272*3aa7d58aSMatthew Dillon #    define z_off64_t z_off_t
273*3aa7d58aSMatthew Dillon #endif
274*3aa7d58aSMatthew Dillon 
275*3aa7d58aSMatthew Dillon /* MVS linker does not support external names larger than 8 bytes */
276*3aa7d58aSMatthew Dillon #if defined(__MVS__)
277*3aa7d58aSMatthew Dillon   #pragma map(deflateInit_,"DEIN")
278*3aa7d58aSMatthew Dillon   #pragma map(deflateInit2_,"DEIN2")
279*3aa7d58aSMatthew Dillon   #pragma map(deflateEnd,"DEEND")
280*3aa7d58aSMatthew Dillon   #pragma map(deflateBound,"DEBND")
281*3aa7d58aSMatthew Dillon   #pragma map(inflateInit_,"ININ")
282*3aa7d58aSMatthew Dillon   #pragma map(inflateInit2_,"ININ2")
283*3aa7d58aSMatthew Dillon   #pragma map(inflateEnd,"INEND")
284*3aa7d58aSMatthew Dillon   #pragma map(inflateSync,"INSY")
285*3aa7d58aSMatthew Dillon   #pragma map(inflateSetDictionary,"INSEDI")
286*3aa7d58aSMatthew Dillon   //#pragma map(compressBound,"CMBND")
287*3aa7d58aSMatthew Dillon   #pragma map(inflate_table,"INTABL")
288*3aa7d58aSMatthew Dillon   #pragma map(inflate_fast,"INFA")
289*3aa7d58aSMatthew Dillon   #pragma map(inflate_copyright,"INCOPY")
290*3aa7d58aSMatthew Dillon #endif
291*3aa7d58aSMatthew Dillon 
292*3aa7d58aSMatthew Dillon #endif /* ZCONF_H */
293