1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2005 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
6 /* @(#) $Id: zconf.h 147 2004-01-04 23:55:18Z gabest $ */
13 * If you *really* need a unique prefix for all types and library functions,
14 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
17 # define deflateInit_ z_deflateInit_
18 # define deflate z_deflate
19 # define deflateEnd z_deflateEnd
20 # define inflateInit_ z_inflateInit_
21 # define inflate z_inflate
22 # define inflateEnd z_inflateEnd
23 # define deflateInit2_ z_deflateInit2_
24 # define deflateSetDictionary z_deflateSetDictionary
25 # define deflateCopy z_deflateCopy
26 # define deflateReset z_deflateReset
27 # define deflateParams z_deflateParams
28 # define deflateBound z_deflateBound
29 # define deflatePrime z_deflatePrime
30 # define inflateInit2_ z_inflateInit2_
31 # define inflateSetDictionary z_inflateSetDictionary
32 # define inflateSync z_inflateSync
33 # define inflateSyncPoint z_inflateSyncPoint
34 # define inflateCopy z_inflateCopy
35 # define inflateReset z_inflateReset
36 # define inflateBack z_inflateBack
37 # define inflateBackEnd z_inflateBackEnd
38 # define compress z_compress
39 # define compress2 z_compress2
40 # define compressBound z_compressBound
41 # define uncompress z_uncompress
42 # define adler32 z_adler32
43 # define crc32 z_crc32
44 # define get_crc_table z_get_crc_table
45 # define zError z_zError
47 # define alloc_func z_alloc_func
48 # define free_func z_free_func
49 # define in_func z_in_func
50 # define out_func z_out_func
53 # define uLong z_uLong
54 # define Bytef z_Bytef
55 # define charf z_charf
57 # define uIntf z_uIntf
58 # define uLongf z_uLongf
59 # define voidpf z_voidpf
60 # define voidp z_voidp
63 #if defined(__MSDOS__) && !defined(MSDOS)
66 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
69 #if defined(_WINDOWS) && !defined(WINDOWS)
72 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
77 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
78 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
86 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
87 * than 64k bytes at a time (needed on systems with 16-bit int).
96 #ifdef __STDC_VERSION__
100 # if __STDC_VERSION__ >= 199901L
106 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
109 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
112 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
115 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
119 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
124 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
125 # define const /* note: need a more gentle solution here */
129 /* Some Mac compilers merge all .h files incorrectly: */
130 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
131 # define NO_DUMMY_DECL
134 /* Maximum value for memLevel in deflateInit2 */
135 #ifndef MAX_MEM_LEVEL
137 # define MAX_MEM_LEVEL 8
139 # define MAX_MEM_LEVEL 9
143 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
144 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
145 * created by gzip. (Files created by minigzip can still be extracted by
149 # define MAX_WBITS 15 /* 32K LZ77 window */
152 /* The memory requirements for deflate are (in bytes):
153 (1 << (windowBits+2)) + (1 << (memLevel+9))
154 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
155 plus a few kilobytes for small objects. For example, if you want to reduce
156 the default memory requirements from 256K to 128K, compile with
157 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
158 Of course this will generally degrade compression (there's no free lunch).
160 The memory requirements for inflate are (in bytes) 1 << windowBits
161 that is, 32K for windowBits=15 (default value) plus a few kilobytes
165 /* Type declarations */
167 #ifndef OF /* function prototypes */
169 # define OF(args) args
175 /* The following definitions for FAR are needed only for MSDOS mixed
176 * model programming (small or medium model with some far allocations).
177 * This was tested only with MSC; for other MSDOS compilers you may have
178 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
179 * just define FAR to be empty.
182 # if defined(M_I86SM) || defined(M_I86MM)
183 /* MSC small or medium model */
184 # define SMALL_MEDIUM
191 # if (defined(__SMALL__) || defined(__MEDIUM__))
192 /* Turbo C small or medium model */
193 # define SMALL_MEDIUM
202 #if defined(WINDOWS) || defined(WIN32)
203 /* If building or using zlib as a DLL, define ZLIB_DLL.
204 * This is not mandatory, but it offers a little performance increase.
207 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
208 # ifdef ZLIB_INTERNAL
209 # define ZEXTERN extern __declspec(dllexport)
211 # define ZEXTERN extern __declspec(dllimport)
214 # endif /* ZLIB_DLL */
215 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
216 * define ZLIB_WINAPI.
217 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
223 # include <windows.h>
224 /* No need for _export, use ZLIB.DEF instead. */
225 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
226 # define ZEXPORT WINAPI
228 # define ZEXPORTVA WINAPIV
230 # define ZEXPORTVA FAR CDECL
235 #if defined (__BEOS__)
237 # ifdef ZLIB_INTERNAL
238 # define ZEXPORT __declspec(dllexport)
239 # define ZEXPORTVA __declspec(dllexport)
241 # define ZEXPORT __declspec(dllimport)
242 # define ZEXPORTVA __declspec(dllimport)
248 # define ZEXTERN extern
261 #if !defined(__MACTYPES__)
262 typedef unsigned char Byte
; /* 8 bits */
264 typedef unsigned int uInt
; /* 16 bits or more */
265 typedef unsigned long uLong
; /* 32 bits or more */
268 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
269 # define Bytef Byte FAR
271 typedef Byte FAR Bytef
;
273 typedef char FAR charf
;
274 typedef int FAR intf
;
275 typedef uInt FAR uIntf
;
276 typedef uLong FAR uLongf
;
279 typedef void const *voidpc
;
280 typedef void FAR
*voidpf
;
283 typedef Byte
const *voidpc
;
284 typedef Byte FAR
*voidpf
;
288 #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
289 # include <sys/types.h> /* for off_t */
290 # include <unistd.h> /* for SEEK_* and off_t */
292 # include <unixio.h> /* for off_t */
294 # define z_off_t off_t
297 # define SEEK_SET 0 /* Seek from beginning of file. */
298 # define SEEK_CUR 1 /* Seek from current position. */
299 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
302 # define z_off_t long
305 #if defined(__OS400__)
306 # define NO_vsnprintf
310 # define NO_vsnprintf
316 /* MVS linker does not support external names larger than 8 bytes */
318 # pragma map(deflateInit_,"DEIN")
319 # pragma map(deflateInit2_,"DEIN2")
320 # pragma map(deflateEnd,"DEEND")
321 # pragma map(deflateBound,"DEBND")
322 # pragma map(inflateInit_,"ININ")
323 # pragma map(inflateInit2_,"ININ2")
324 # pragma map(inflateEnd,"INEND")
325 # pragma map(inflateSync,"INSY")
326 # pragma map(inflateSetDictionary,"INSEDI")
327 # pragma map(compressBound,"CMBND")
328 # pragma map(inflate_table,"INTABL")
329 # pragma map(inflate_fast,"INFA")
330 # pragma map(inflate_copyright,"INCOPY")