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
12 * If you *really* need a unique prefix for all types and library functions,
13 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
16 # define deflateInit_ z_deflateInit_
17 # define deflate z_deflate
18 # define deflateEnd z_deflateEnd
19 # define inflateInit_ z_inflateInit_
20 # define inflate z_inflate
21 # define inflateEnd z_inflateEnd
22 # define deflateInit2_ z_deflateInit2_
23 # define deflateSetDictionary z_deflateSetDictionary
24 # define deflateCopy z_deflateCopy
25 # define deflateReset z_deflateReset
26 # define deflateParams z_deflateParams
27 # define deflateBound z_deflateBound
28 # define deflatePrime z_deflatePrime
29 # define inflateInit2_ z_inflateInit2_
30 # define inflateSetDictionary z_inflateSetDictionary
31 # define inflateSync z_inflateSync
32 # define inflateSyncPoint z_inflateSyncPoint
33 # define inflateCopy z_inflateCopy
34 # define inflateReset z_inflateReset
35 # define inflateBack z_inflateBack
36 # define inflateBackEnd z_inflateBackEnd
37 # define compress z_compress
38 # define compress2 z_compress2
39 # define compressBound z_compressBound
40 # define uncompress z_uncompress
41 # define adler32 z_adler32
42 # define crc32 z_crc32
43 # define get_crc_table z_get_crc_table
44 # define zError z_zError
46 // Added to prevent clash with MacOS system zlib (which is 1.1.3 and thus
47 // has a security hole...we're using 1.1.4, which doesn't). --ryan.
48 # define inflate_blocks z_inflate_blocks
49 # define inflate_blocks_reset z_inflate_blocks_reset
50 # define inflate_blocks_new z_inflate_blocks_new
51 # define inflate_blocks_free z_inflate_blocks_free
52 # define inflate_blocks_sync_point z_inflate_blocks_sync_point
53 # define inflate_set_dictionary z_inflate_set_dictionary
54 # define inflate_sync_dictionary z_inflate_sync_dictionary
55 # define inflate_mask z_inflate_mask
56 # define inflate_flush z_inflate_flush
57 # define inflate_fast z_inflate_fast
58 # define inflate_codes z_inflate_codes
59 # define inflate_codes_new z_inflate_codes_new
60 # define inflate_codes_free z_inflate_codes_free
61 # define inflate_copyright z_inflate_copyright
62 # define deflate_copyright z_deflate_copyright
63 # define inflate_trees_fixed z_inflate_trees_fixed
64 # define inflate_trees_dynamic z_inflate_trees_dynamic
65 # define inflate_trees_bits z_inflate_trees_bits
66 # define _dist_code z__dist_code
67 # define _length_code z__length_code
68 # define _tr_stored_block z__tr_stored_block
69 # define _tr_align z__tr_align
70 # define _tr_flush_block z__tr_flush_block
71 # define _tr_init z__tr_init
72 # define _tr_tally z__tr_tally
73 # define zcfree z_zcfree
74 # define z_errmsg z_z_errmsg
75 # define zlibVersion z_zlibVersion
76 # define zcalloc z_zcalloc
78 # define alloc_func z_alloc_func
79 # define free_func z_free_func
80 # define in_func z_in_func
81 # define out_func z_out_func
84 # define uLong z_uLong
85 # define Bytef z_Bytef
86 # define charf z_charf
88 # define uIntf z_uIntf
89 # define uLongf z_uLongf
90 # define voidpf z_voidpf
91 # define voidp z_voidp
94 #if defined(__MSDOS__) && !defined(MSDOS)
97 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
100 #if defined(_WINDOWS) && !defined(WINDOWS)
103 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
108 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
109 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
117 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
118 * than 64k bytes at a time (needed on systems with 16-bit int).
124 # define UNALIGNED_OK
127 #ifdef __STDC_VERSION__
131 # if __STDC_VERSION__ >= 199901L
137 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
140 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
143 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
146 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
150 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
155 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
156 # define const /* note: need a more gentle solution here */
160 /* Some Mac compilers merge all .h files incorrectly: */
161 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
162 # define NO_DUMMY_DECL
165 /* Maximum value for memLevel in deflateInit2 */
166 #ifndef MAX_MEM_LEVEL
168 # define MAX_MEM_LEVEL 8
170 # define MAX_MEM_LEVEL 9
174 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
175 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
176 * created by gzip. (Files created by minigzip can still be extracted by
180 # define MAX_WBITS 15 /* 32K LZ77 window */
183 /* The memory requirements for deflate are (in bytes):
184 (1 << (windowBits+2)) + (1 << (memLevel+9))
185 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
186 plus a few kilobytes for small objects. For example, if you want to reduce
187 the default memory requirements from 256K to 128K, compile with
188 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
189 Of course this will generally degrade compression (there's no free lunch).
191 The memory requirements for inflate are (in bytes) 1 << windowBits
192 that is, 32K for windowBits=15 (default value) plus a few kilobytes
196 /* Type declarations */
198 #ifndef OF /* function prototypes */
200 # define OF(args) args
206 /* The following definitions for FAR are needed only for MSDOS mixed
207 * model programming (small or medium model with some far allocations).
208 * This was tested only with MSC; for other MSDOS compilers you may have
209 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
210 * just define FAR to be empty.
213 # if defined(M_I86SM) || defined(M_I86MM)
214 /* MSC small or medium model */
215 # define SMALL_MEDIUM
222 # if (defined(__SMALL__) || defined(__MEDIUM__))
223 /* Turbo C small or medium model */
224 # define SMALL_MEDIUM
233 #if defined(WINDOWS) || defined(WIN32)
234 /* If building or using zlib as a DLL, define ZLIB_DLL.
235 * This is not mandatory, but it offers a little performance increase.
238 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
239 # ifdef ZLIB_INTERNAL
240 # define ZEXTERN extern __declspec(dllexport)
242 # define ZEXTERN extern __declspec(dllimport)
245 # endif /* ZLIB_DLL */
246 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
247 * define ZLIB_WINAPI.
248 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
254 # include <windows.h>
255 /* No need for _export, use ZLIB.DEF instead. */
256 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
257 # define ZEXPORT WINAPI
259 # define ZEXPORTVA WINAPIV
261 # define ZEXPORTVA FAR CDECL
266 #if defined (__BEOS__)
268 # ifdef ZLIB_INTERNAL
269 # define ZEXPORT __declspec(dllexport)
270 # define ZEXPORTVA __declspec(dllexport)
272 # define ZEXPORT __declspec(dllimport)
273 # define ZEXPORTVA __declspec(dllimport)
279 # define ZEXTERN extern
292 #if !defined(__MACTYPES__)
293 typedef unsigned char Byte; /* 8 bits */
295 typedef unsigned int uInt; /* 16 bits or more */
296 typedef unsigned long uLong; /* 32 bits or more */
299 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
300 # define Bytef Byte FAR
302 typedef Byte FAR Bytef;
304 typedef char FAR charf;
305 typedef int FAR intf;
306 typedef uInt FAR uIntf;
307 typedef uLong FAR uLongf;
310 typedef void const *voidpc;
311 typedef void FAR *voidpf;
314 typedef Byte const *voidpc;
315 typedef Byte FAR *voidpf;
319 #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
320 # include <sys/types.h> /* for off_t */
321 # include <unistd.h> /* for SEEK_* and off_t */
323 # include <unixio.h> /* for off_t */
325 # define z_off_t off_t
328 # define SEEK_SET 0 /* Seek from beginning of file. */
329 # define SEEK_CUR 1 /* Seek from current position. */
330 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
333 # define z_off_t long
336 #if defined(__OS400__)
337 # define NO_vsnprintf
341 # define NO_vsnprintf
347 /* MVS linker does not support external names larger than 8 bytes */
349 # pragma map(deflateInit_,"DEIN")
350 # pragma map(deflateInit2_,"DEIN2")
351 # pragma map(deflateEnd,"DEEND")
352 # pragma map(deflateBound,"DEBND")
353 # pragma map(inflateInit_,"ININ")
354 # pragma map(inflateInit2_,"ININ2")
355 # pragma map(inflateEnd,"INEND")
356 # pragma map(inflateSync,"INSY")
357 # pragma map(inflateSetDictionary,"INSEDI")
358 # pragma map(compressBound,"CMBND")
359 # pragma map(inflate_table,"INTABL")
360 # pragma map(inflate_fast,"INFA")
361 # pragma map(inflate_copyright,"INCOPY")