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
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 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(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
57 #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
62 #if defined(__MSDOS__) && !defined(MSDOS)
67 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
68 * than 64k bytes at a time (needed on systems with 16-bit int).
70 #if defined(MSDOS) && !defined(__32BIT__)
77 #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
80 #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
86 #if defined __HOS_AIX__
93 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
94 # define const /* note: need a more gentle solution here */
98 /* Some Mac compilers merge all .h files incorrectly: */
99 #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
100 # define NO_DUMMY_DECL
103 /* Old Borland C incorrectly complains about missing returns: */
104 #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
105 # define NEED_DUMMY_RETURN
109 /* Maximum value for memLevel in deflateInit2 */
110 #ifndef MAX_MEM_LEVEL
112 # define MAX_MEM_LEVEL 8
114 # define MAX_MEM_LEVEL 9
118 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
119 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
120 * created by gzip. (Files created by minigzip can still be extracted by
124 # define MAX_WBITS 15 /* 32K LZ77 window */
127 /* The memory requirements for deflate are (in bytes):
128 (1 << (windowBits+2)) + (1 << (memLevel+9))
129 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
130 plus a few kilobytes for small objects. For example, if you want to reduce
131 the default memory requirements from 256K to 128K, compile with
132 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
133 Of course this will generally degrade compression (there's no free lunch).
135 The memory requirements for inflate are (in bytes) 1 << windowBits
136 that is, 32K for windowBits=15 (default value) plus a few kilobytes
140 /* Type declarations */
142 #ifndef OF /* function prototypes */
144 # define OF(args) args
150 /* The following definitions for FAR are needed only for MSDOS mixed
151 * model programming (small or medium model with some far allocations).
152 * This was tested only with MSC; for other MSDOS compilers you may have
153 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
154 * just define FAR to be empty.
156 #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
157 /* MSC small or medium model */
158 # define SMALL_MEDIUM
165 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
167 # define SMALL_MEDIUM
172 /* Compile with -DZLIB_DLL for Windows DLL support */
173 #if defined(ZLIB_DLL)
174 # if defined(_WINDOWS) || defined(WINDOWS)
178 # include <windows.h>
179 # define ZEXPORT WINAPI
181 # define ZEXPORTVA WINAPIV
183 # define ZEXPORTVA FAR _cdecl _export
186 # if defined (__BORLANDC__)
187 # if (__BORLANDC__ >= 0x0500) && defined (WIN32)
188 # include <windows.h>
189 # define ZEXPORT __declspec(dllexport) WINAPI
190 # define ZEXPORTRVA __declspec(dllexport) WINAPIV
192 # if defined (_Windows) && defined (__DLL__)
193 # define ZEXPORT _export
194 # define ZEXPORTVA _export
200 #if defined (__BEOS__)
201 # if defined (ZLIB_DLL)
202 # define ZEXTERN extern __declspec(dllexport)
204 # define ZEXTERN extern __declspec(dllimport)
215 # define ZEXTERN extern
222 #if !defined(__MACTYPES__)
223 typedef unsigned char Byte; /* 8 bits */
225 typedef unsigned int uInt; /* 16 bits or more */
226 typedef unsigned long uLong; /* 32 bits or more */
229 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
230 # define Bytef Byte FAR
232 typedef Byte FAR Bytef;
234 typedef char FAR charf;
235 typedef int FAR intf;
236 typedef uInt FAR uIntf;
237 typedef uLong FAR uLongf;
240 typedef void const *voidpc;
241 typedef void FAR *voidpf;
244 typedef Byte const *voidpc;
245 typedef Byte FAR *voidpf;
249 #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
250 # include <sys/types.h> /* for off_t */
251 # include <unistd.h> /* for SEEK_* and off_t */
252 # define z_off_t off_t
255 # define SEEK_SET 0 /* Seek from beginning of file. */
256 # define SEEK_CUR 1 /* Seek from current position. */
257 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
260 # define z_off_t long
263 /* MVS linker does not support external names larger than 8 bytes */
265 # pragma map(deflateInit_,"DEIN")
266 # pragma map(deflateInit2_,"DEIN2")
267 # pragma map(deflateEnd,"DEEND")
268 # pragma map(deflateBound,"DEBND")
269 # pragma map(inflateInit_,"ININ")
270 # pragma map(inflateInit2_,"ININ2")
271 # pragma map(inflateEnd,"INEND")
272 # pragma map(inflateSync,"INSY")
273 # pragma map(inflateSetDictionary,"INSEDI")
274 # pragma map(compressBound,"CMBND")
275 # pragma map(inflate_table,"INTABL")
276 # pragma map(inflate_fast,"INFA")
277 # pragma map(inflate_copyright,"INCOPY")
280 #endif /* _ZCONF_H */