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
10 * If you *really* need a unique prefix for all types and library functions,
11 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
14 # define deflateInit_ z_deflateInit_
15 # define deflate z_deflate
16 # define deflateEnd z_deflateEnd
17 # define inflateInit_ z_inflateInit_
18 # define inflate z_inflate
19 # define inflateEnd z_inflateEnd
20 # define deflateInit2_ z_deflateInit2_
21 # define deflateSetDictionary z_deflateSetDictionary
22 # define deflateCopy z_deflateCopy
23 # define deflateReset z_deflateReset
24 # define deflatePrime z_deflatePrime
25 # define deflateParams z_deflateParams
26 # define deflateBound z_deflateBound
27 # define inflateInit2_ z_inflateInit2_
28 # define inflateSetDictionary z_inflateSetDictionary
29 # define inflateSync z_inflateSync
30 # define inflateSyncPoint z_inflateSyncPoint
31 # define inflateCopy z_inflateCopy
32 # define inflateReset z_inflateReset
33 # define compress z_compress
34 # define compress2 z_compress2
35 # define compressBound z_compressBound
36 # define uncompress z_uncompress
37 # define adler32 z_adler32
38 # define crc32 z_crc32
39 # define get_crc_table z_get_crc_table
43 # define uLong z_uLong
44 # define Bytef z_Bytef
45 # define charf z_charf
47 # define uIntf z_uIntf
48 # define uLongf z_uLongf
49 # define voidpf z_voidpf
50 # define voidp z_voidp
53 #if defined(__MSDOS__) && !defined(MSDOS)
56 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
59 #if defined(_WINDOWS) && !defined(WINDOWS)
62 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
65 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
66 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
74 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
75 * than 64k bytes at a time (needed on systems with 16-bit int).
84 #ifdef __STDC_VERSION__
88 # if __STDC_VERSION__ >= 199901L
94 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
97 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
100 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
103 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
107 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
112 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
113 # define const /* note: need a more gentle solution here */
117 /* Some Mac compilers merge all .h files incorrectly: */
118 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
119 # define NO_DUMMY_DECL
122 /* Maximum value for memLevel in deflateInit2 */
123 #ifndef MAX_MEM_LEVEL
125 # define MAX_MEM_LEVEL 8
127 # define MAX_MEM_LEVEL 9
131 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
132 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
133 * created by gzip. (Files created by minigzip can still be extracted by
137 # define MAX_WBITS 15 /* 32K LZ77 window */
140 /* The memory requirements for deflate are (in bytes):
141 (1 << (windowBits+2)) + (1 << (memLevel+9))
142 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
143 plus a few kilobytes for small objects. For example, if you want to reduce
144 the default memory requirements from 256K to 128K, compile with
145 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
146 Of course this will generally degrade compression (there's no free lunch).
148 The memory requirements for inflate are (in bytes) 1 << windowBits
149 that is, 32K for windowBits=15 (default value) plus a few kilobytes
153 /* Type declarations */
155 #ifndef OF /* function prototypes */
157 # define OF(args) args
163 /* The following definitions for FAR are needed only for MSDOS mixed
164 * model programming (small or medium model with some far allocations).
165 * This was tested only with MSC; for other MSDOS compilers you may have
166 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
167 * just define FAR to be empty.
170 # if defined(M_I86SM) || defined(M_I86MM)
171 /* MSC small or medium model */
172 # define SMALL_MEDIUM
179 # if (defined(__SMALL__) || defined(__MEDIUM__))
180 /* Turbo C small or medium model */
181 # define SMALL_MEDIUM
190 #if defined(WINDOWS) || defined(WIN32)
191 /* If building or using zlib as a DLL, define ZLIB_DLL.
192 * This is not mandatory, but it offers a little performance increase.
195 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
196 # ifdef ZLIB_INTERNAL
197 # define ZEXTERN extern __declspec(dllexport)
199 # define ZEXTERN extern __declspec(dllimport)
202 # endif /* ZLIB_DLL */
203 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
204 * define ZLIB_WINAPI.
205 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
211 # include <windows.h>
212 /* No need for _export, use ZLIB.DEF instead. */
213 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
214 # define ZEXPORT WINAPI
216 # define ZEXPORTVA WINAPIV
218 # define ZEXPORTVA FAR CDECL
223 #if defined (__BEOS__)
225 # ifdef ZLIB_INTERNAL
226 # define ZEXPORT __declspec(dllexport)
227 # define ZEXPORTVA __declspec(dllexport)
229 # define ZEXPORT __declspec(dllimport)
230 # define ZEXPORTVA __declspec(dllimport)
236 # define ZEXTERN extern
249 #if !defined(__MACTYPES__)
250 typedef unsigned char Byte
; /* 8 bits */
252 typedef unsigned int uInt
; /* 16 bits or more */
253 typedef unsigned long uLong
; /* 32 bits or more */
256 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
257 # define Bytef Byte FAR
259 typedef Byte FAR Bytef
;
261 typedef char FAR charf
;
262 typedef int FAR intf
;
263 typedef uInt FAR uIntf
;
264 typedef uLong FAR uLongf
;
267 typedef void const *voidpc
;
268 typedef void FAR
*voidpf
;
271 typedef Byte
const *voidpc
;
272 typedef Byte FAR
*voidpf
;
276 #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
277 # include <sys/types.h> /* for off_t */
278 # include <unistd.h> /* for SEEK_* and off_t */
280 # include <unixio.h> /* for off_t */
282 # define z_off_t off_t
285 # define SEEK_SET 0 /* Seek from beginning of file. */
286 # define SEEK_CUR 1 /* Seek from current position. */
287 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
290 # define z_off_t long
293 #if defined(__OS400__)
298 # define NO_vsnprintf
304 /* MVS linker does not support external names larger than 8 bytes */
306 # pragma map(deflateInit_,"DEIN")
307 # pragma map(deflateInit2_,"DEIN2")
308 # pragma map(deflateEnd,"DEEND")
309 # pragma map(deflateBound,"DEBND")
310 # pragma map(inflateInit_,"ININ")
311 # pragma map(inflateInit2_,"ININ2")
312 # pragma map(inflateEnd,"INEND")
313 # pragma map(inflateSync,"INSY")
314 # pragma map(inflateSetDictionary,"INSEDI")
315 # pragma map(compressBound,"CMBND")
316 # pragma map(inflate_table,"INTABL")
317 # pragma map(inflate_fast,"INFA")
318 # pragma map(inflate_copyright,"INCOPY")