1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2003 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
11 * If you *really* need a unique prefix for all types and library functions,
12 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
15 # define deflateInit_ z_deflateInit_
16 # define deflate z_deflate
17 # define deflateEnd z_deflateEnd
18 # define inflateInit_ z_inflateInit_
19 # define inflate z_inflate
20 # define inflateEnd z_inflateEnd
21 # define deflateInit2_ z_deflateInit2_
22 # define deflateSetDictionary z_deflateSetDictionary
23 # define deflateCopy z_deflateCopy
24 # define deflateReset z_deflateReset
25 # define deflatePrime z_deflatePrime
26 # define deflateParams z_deflateParams
27 # define deflateBound z_deflateBound
28 # define inflateInit2_ z_inflateInit2_
29 # define inflateSetDictionary z_inflateSetDictionary
30 # define inflateSync z_inflateSync
31 # define inflateSyncPoint z_inflateSyncPoint
32 # define inflateCopy z_inflateCopy
33 # define inflateReset z_inflateReset
34 # define compress z_compress
35 # define compress2 z_compress2
36 # define compressBound z_compressBound
37 # define uncompress z_uncompress
38 # define adler32 z_adler32
39 # define crc32 z_crc32
40 # define get_crc_table z_get_crc_table
44 # define uLong z_uLong
45 # define Bytef z_Bytef
46 # define charf z_charf
48 # define uIntf z_uIntf
49 # define uLongf z_uLongf
50 # define voidpf z_voidpf
51 # define voidp z_voidp
54 #if defined(__MSDOS__) && !defined(MSDOS)
57 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
60 #if defined(_WINDOWS) && !defined(WINDOWS)
63 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
66 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
67 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
75 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
76 * than 64k bytes at a time (needed on systems with 16-bit int).
85 #ifdef __STDC_VERSION__
89 # if __STDC_VERSION__ >= 199901L
95 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
98 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
101 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
104 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
108 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
113 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
114 # define const /* note: need a more gentle solution here */
118 /* Some Mac compilers merge all .h files incorrectly: */
119 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
120 # define NO_DUMMY_DECL
123 /* Maximum value for memLevel in deflateInit2 */
124 #ifndef MAX_MEM_LEVEL
126 # define MAX_MEM_LEVEL 8
128 # define MAX_MEM_LEVEL 9
132 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
133 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
134 * created by gzip. (Files created by minigzip can still be extracted by
138 # define MAX_WBITS 15 /* 32K LZ77 window */
141 /* The memory requirements for deflate are (in bytes):
142 (1 << (windowBits+2)) + (1 << (memLevel+9))
143 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
144 plus a few kilobytes for small objects. For example, if you want to reduce
145 the default memory requirements from 256K to 128K, compile with
146 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
147 Of course this will generally degrade compression (there's no free lunch).
149 The memory requirements for inflate are (in bytes) 1 << windowBits
150 that is, 32K for windowBits=15 (default value) plus a few kilobytes
154 /* Type declarations */
156 #ifndef OF /* function prototypes */
158 # define OF(args) args
164 /* The following definitions for FAR are needed only for MSDOS mixed
165 * model programming (small or medium model with some far allocations).
166 * This was tested only with MSC; for other MSDOS compilers you may have
167 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
168 * just define FAR to be empty.
171 # if defined(M_I86SM) || defined(M_I86MM)
172 /* MSC small or medium model */
173 # define SMALL_MEDIUM
180 # if (defined(__SMALL__) || defined(__MEDIUM__))
181 /* Turbo C small or medium model */
182 # define SMALL_MEDIUM
191 #if defined(WINDOWS) || defined(WIN32)
192 /* If building or using zlib as a DLL, define ZLIB_DLL.
193 * This is not mandatory, but it offers a little performance increase.
196 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
197 # ifdef ZLIB_INTERNAL
198 # define ZEXTERN extern __declspec(dllexport)
200 # define ZEXTERN extern __declspec(dllimport)
203 # endif /* ZLIB_DLL */
204 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
205 * define ZLIB_WINAPI.
206 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
212 # include <windows.h>
213 /* No need for _export, use ZLIB.DEF instead. */
214 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
215 # define ZEXPORT WINAPI
217 # define ZEXPORTVA WINAPIV
219 # define ZEXPORTVA FAR CDECL
224 #if defined (__BEOS__)
226 # ifdef ZLIB_INTERNAL
227 # define ZEXPORT __declspec(dllexport)
228 # define ZEXPORTVA __declspec(dllexport)
230 # define ZEXPORT __declspec(dllimport)
231 # define ZEXPORTVA __declspec(dllimport)
237 # define ZEXTERN extern
250 #if !defined(__MACTYPES__)
251 typedef unsigned char Byte
; /* 8 bits */
253 typedef unsigned int uInt
; /* 16 bits or more */
254 typedef unsigned long uLong
; /* 32 bits or more */
257 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
258 # define Bytef Byte FAR
260 typedef Byte FAR Bytef
;
262 typedef char FAR charf
;
263 typedef int FAR intf
;
264 typedef uInt FAR uIntf
;
265 typedef uLong FAR uLongf
;
268 typedef void const *voidpc
;
269 typedef void FAR
*voidpf
;
272 typedef Byte
const *voidpc
;
273 typedef Byte FAR
*voidpf
;
277 #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
278 # include <sys/types.h> /* for off_t */
279 # include <unistd.h> /* for SEEK_* and off_t */
281 # include <unixio.h> /* for off_t */
283 # define z_off_t off_t
286 # define SEEK_SET 0 /* Seek from beginning of file. */
287 # define SEEK_CUR 1 /* Seek from current position. */
288 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
291 # define z_off_t long
294 #if defined(__OS400__)
299 # define NO_vsnprintf
305 /* MVS linker does not support external names larger than 8 bytes */
307 # pragma map(deflateInit_,"DEIN")
308 # pragma map(deflateInit2_,"DEIN2")
309 # pragma map(deflateEnd,"DEEND")
310 # pragma map(deflateBound,"DEBND")
311 # pragma map(inflateInit_,"ININ")
312 # pragma map(inflateInit2_,"ININ2")
313 # pragma map(inflateEnd,"INEND")
314 # pragma map(inflateSync,"INSY")
315 # pragma map(inflateSetDictionary,"INSEDI")
316 # pragma map(compressBound,"CMBND")
317 # pragma map(inflate_table,"INTABL")
318 # pragma map(inflate_fast,"INFA")
319 # pragma map(inflate_copyright,"INCOPY")