1 /* zconf.h -- configuration of the zlib compression library
\r
2 * Copyright (C) 1995-2002 Jean-loup Gailly.
\r
3 * For conditions of distribution and use, see copyright notice in zlib.h
\r
6 /* @(#) $Id: zconf.h,v 1.1 2003/05/23 21:05:30 steveking Exp $ */
\r
12 * If you *really* need a unique prefix for all types and library functions,
\r
13 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
\r
16 # define deflateInit_ z_deflateInit_
\r
17 # define deflate z_deflate
\r
18 # define deflateEnd z_deflateEnd
\r
19 # define inflateInit_ z_inflateInit_
\r
20 # define inflate z_inflate
\r
21 # define inflateEnd z_inflateEnd
\r
22 # define deflateInit2_ z_deflateInit2_
\r
23 # define deflateSetDictionary z_deflateSetDictionary
\r
24 # define deflateCopy z_deflateCopy
\r
25 # define deflateReset z_deflateReset
\r
26 # define deflateParams z_deflateParams
\r
27 # define inflateInit2_ z_inflateInit2_
\r
28 # define inflateSetDictionary z_inflateSetDictionary
\r
29 # define inflateSync z_inflateSync
\r
30 # define inflateSyncPoint z_inflateSyncPoint
\r
31 # define inflateReset z_inflateReset
\r
32 # define compress z_compress
\r
33 # define compress2 z_compress2
\r
34 # define uncompress z_uncompress
\r
35 # define adler32 z_adler32
\r
36 # define crc32 z_crc32
\r
37 # define get_crc_table z_get_crc_table
\r
39 # define Byte z_Byte
\r
40 # define uInt z_uInt
\r
41 # define uLong z_uLong
\r
42 # define Bytef z_Bytef
\r
43 # define charf z_charf
\r
44 # define intf z_intf
\r
45 # define uIntf z_uIntf
\r
46 # define uLongf z_uLongf
\r
47 # define voidpf z_voidpf
\r
48 # define voidp z_voidp
\r
51 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
\r
54 #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
\r
59 #if defined(__MSDOS__) && !defined(MSDOS)
\r
64 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
\r
65 * than 64k bytes at a time (needed on systems with 16-bit int).
\r
67 #if defined(MSDOS) && !defined(__32BIT__)
\r
71 # define UNALIGNED_OK
\r
74 #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
\r
77 #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
\r
84 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
\r
89 /* Some Mac compilers merge all .h files incorrectly: */
\r
90 #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
\r
91 # define NO_DUMMY_DECL
\r
94 /* Old Borland C incorrectly complains about missing returns: */
\r
95 #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
\r
96 # define NEED_DUMMY_RETURN
\r
100 /* Maximum value for memLevel in deflateInit2 */
\r
101 #ifndef MAX_MEM_LEVEL
\r
103 # define MAX_MEM_LEVEL 8
\r
105 # define MAX_MEM_LEVEL 9
\r
109 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
\r
110 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
\r
111 * created by gzip. (Files created by minigzip can still be extracted by
\r
115 # define MAX_WBITS 15 /* 32K LZ77 window */
\r
118 /* The memory requirements for deflate are (in bytes):
\r
119 (1 << (windowBits+2)) + (1 << (memLevel+9))
\r
120 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
\r
121 plus a few kilobytes for small objects. For example, if you want to reduce
\r
122 the default memory requirements from 256K to 128K, compile with
\r
123 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
\r
124 Of course this will generally degrade compression (there's no free lunch).
\r
126 The memory requirements for inflate are (in bytes) 1 << windowBits
\r
127 that is, 32K for windowBits=15 (default value) plus a few kilobytes
\r
131 /* Type declarations */
\r
133 #ifndef OF /* function prototypes */
\r
135 # define OF(args) args
\r
137 # define OF(args) ()
\r
141 /* The following definitions for FAR are needed only for MSDOS mixed
\r
142 * model programming (small or medium model with some far allocations).
\r
143 * This was tested only with MSC; for other MSDOS compilers you may have
\r
144 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
\r
145 * just define FAR to be empty.
\r
147 #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
\r
148 /* MSC small or medium model */
\r
149 # define SMALL_MEDIUM
\r
156 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
\r
158 # define SMALL_MEDIUM
\r
163 /* Compile with -DZLIB_DLL for Windows DLL support */
\r
164 #if defined(ZLIB_DLL)
\r
165 # if defined(_WINDOWS) || defined(WINDOWS)
\r
169 # include <windows.h>
\r
170 # define ZEXPORT WINAPI
\r
172 # define ZEXPORTVA WINAPIV
\r
174 # define ZEXPORTVA FAR _cdecl _export
\r
177 # if defined (__BORLANDC__)
\r
178 # if (__BORLANDC__ >= 0x0500) && defined (WIN32)
\r
179 # include <windows.h>
\r
180 # define ZEXPORT __declspec(dllexport) WINAPI
\r
181 # define ZEXPORTRVA __declspec(dllexport) WINAPIV
\r
183 # if defined (_Windows) && defined (__DLL__)
\r
184 # define ZEXPORT _export
\r
185 # define ZEXPORTVA _export
\r
191 #if defined (__BEOS__)
\r
192 # if defined (ZLIB_DLL)
\r
193 # define ZEXTERN extern __declspec(dllexport)
\r
195 # define ZEXTERN extern __declspec(dllimport)
\r
206 # define ZEXTERN extern
\r
213 #if !defined(MACOS) && !defined(TARGET_OS_MAC)
\r
214 typedef unsigned char Byte; /* 8 bits */
\r
216 typedef unsigned int uInt; /* 16 bits or more */
\r
217 typedef unsigned long uLong; /* 32 bits or more */
\r
219 #ifdef SMALL_MEDIUM
\r
220 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
\r
221 # define Bytef Byte FAR
\r
223 typedef Byte FAR Bytef;
\r
225 typedef char FAR charf;
\r
226 typedef int FAR intf;
\r
227 typedef uInt FAR uIntf;
\r
228 typedef uLong FAR uLongf;
\r
231 typedef void FAR *voidpf;
\r
232 typedef void *voidp;
\r
234 typedef Byte FAR *voidpf;
\r
235 typedef Byte *voidp;
\r
238 #ifdef HAVE_UNISTD_H
\r
239 # include <sys/types.h> /* for off_t */
\r
240 # include <unistd.h> /* for SEEK_* and off_t */
\r
241 # define z_off_t off_t
\r
244 # define SEEK_SET 0 /* Seek from beginning of file. */
\r
245 # define SEEK_CUR 1 /* Seek from current position. */
\r
246 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
\r
249 # define z_off_t long
\r
252 /* MVS linker does not support external names larger than 8 bytes */
\r
253 #if defined(__MVS__)
\r
254 # pragma map(deflateInit_,"DEIN")
\r
255 # pragma map(deflateInit2_,"DEIN2")
\r
256 # pragma map(deflateEnd,"DEEND")
\r
257 # pragma map(inflateInit_,"ININ")
\r
258 # pragma map(inflateInit2_,"ININ2")
\r
259 # pragma map(inflateEnd,"INEND")
\r
260 # pragma map(inflateSync,"INSY")
\r
261 # pragma map(inflateSetDictionary,"INSEDI")
\r
262 # pragma map(inflate_blocks,"INBL")
\r
263 # pragma map(inflate_blocks_new,"INBLNE")
\r
264 # pragma map(inflate_blocks_free,"INBLFR")
\r
265 # pragma map(inflate_blocks_reset,"INBLRE")
\r
266 # pragma map(inflate_codes_free,"INCOFR")
\r
267 # pragma map(inflate_codes,"INCO")
\r
268 # pragma map(inflate_fast,"INFA")
\r
269 # pragma map(inflate_flush,"INFLU")
\r
270 # pragma map(inflate_mask,"INMA")
\r
271 # pragma map(inflate_set_dictionary,"INSEDI2")
\r
272 # pragma map(inflate_copyright,"INCOPY")
\r
273 # pragma map(inflate_trees_bits,"INTRBI")
\r
274 # pragma map(inflate_trees_dynamic,"INTRDY")
\r
275 # pragma map(inflate_trees_fixed,"INTRFI")
\r
276 # pragma map(inflate_trees_free,"INTRFR")
\r
279 #endif /* _ZCONF_H */
\r