1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2002 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
6 /* @(#) $Id: zconf.h,v 1.2 2002/03/16 18:22:46 henry Exp $ */
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_ ipcomp_deflateInit_
17 # define deflate ipcomp_deflate
18 # define deflateEnd ipcomp_deflateEnd
19 # define inflateInit_ ipcomp_inflateInit_
20 # define inflate ipcomp_inflate
21 # define inflateEnd ipcomp_inflateEnd
22 # define deflateInit2_ ipcomp_deflateInit2_
23 # define deflateSetDictionary ipcomp_deflateSetDictionary
24 # define deflateCopy ipcomp_deflateCopy
25 # define deflateReset ipcomp_deflateReset
26 # define deflateParams ipcomp_deflateParams
27 # define inflateInit2_ ipcomp_inflateInit2_
28 # define inflateSetDictionary ipcomp_inflateSetDictionary
29 # define inflateSync ipcomp_inflateSync
30 # define inflateSyncPoint ipcomp_inflateSyncPoint
31 # define inflateReset ipcomp_inflateReset
32 # define compress ipcomp_compress
33 # define compress2 ipcomp_compress2
34 # define uncompress ipcomp_uncompress
35 # define adler32 ipcomp_adler32
36 # define crc32 ipcomp_crc32
37 # define get_crc_table ipcomp_get_crc_table
38 /* SSS: these also need to be prefixed to avoid clash with ppp_deflate and ext2compression */
39 # define inflate_blocks ipcomp_deflate_blocks
40 # define inflate_blocks_free ipcomp_deflate_blocks_free
41 # define inflate_blocks_new ipcomp_inflate_blocks_new
42 # define inflate_blocks_reset ipcomp_inflate_blocks_reset
43 # define inflate_blocks_sync_point ipcomp_inflate_blocks_sync_point
44 # define inflate_set_dictionary ipcomp_inflate_set_dictionary
45 # define inflate_codes ipcomp_inflate_codes
46 # define inflate_codes_free ipcomp_inflate_codes_free
47 # define inflate_codes_new ipcomp_inflate_codes_new
48 # define inflate_fast ipcomp_inflate_fast
49 # define inflate_trees_bits ipcomp_inflate_trees_bits
50 # define inflate_trees_dynamic ipcomp_inflate_trees_dynamic
51 # define inflate_trees_fixed ipcomp_inflate_trees_fixed
52 # define inflate_flush ipcomp_inflate_flush
53 # define inflate_mask ipcomp_inflate_mask
54 # define _dist_code _ipcomp_dist_code
55 # define _length_code _ipcomp_length_code
56 # define _tr_align _ipcomp_tr_align
57 # define _tr_flush_block _ipcomp_tr_flush_block
58 # define _tr_init _ipcomp_tr_init
59 # define _tr_stored_block _ipcomp_tr_stored_block
60 # define _tr_tally _ipcomp_tr_tally
61 # define zError ipcomp_zError
62 # define z_errmsg ipcomp_z_errmsg
63 # define zlibVersion ipcomp_zlibVersion
64 # define match_init ipcomp_match_init
65 # define longest_match ipcomp_longest_match
71 # define uLong z_uLong
72 # define Bytef z_Bytef
73 # define charf z_charf
75 # define uIntf z_uIntf
76 # define uLongf z_uLongf
77 # define voidpf z_voidpf
78 # define voidp z_voidp
81 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
84 #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
89 #if defined(__MSDOS__) && !defined(MSDOS)
94 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
95 * than 64k bytes at a time (needed on systems with 16-bit int).
97 #if defined(MSDOS) && !defined(__32BIT__)
101 # define UNALIGNED_OK
104 #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
107 #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
114 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
119 /* Some Mac compilers merge all .h files incorrectly: */
120 #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
121 # define NO_DUMMY_DECL
124 /* Old Borland C incorrectly complains about missing returns: */
125 #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
126 # define NEED_DUMMY_RETURN
130 /* Maximum value for memLevel in deflateInit2 */
131 #ifndef MAX_MEM_LEVEL
133 # define MAX_MEM_LEVEL 8
135 # define MAX_MEM_LEVEL 9
139 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
140 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
141 * created by gzip. (Files created by minigzip can still be extracted by
145 # define MAX_WBITS 15 /* 32K LZ77 window */
148 /* The memory requirements for deflate are (in bytes):
149 (1 << (windowBits+2)) + (1 << (memLevel+9))
150 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
151 plus a few kilobytes for small objects. For example, if you want to reduce
152 the default memory requirements from 256K to 128K, compile with
153 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
154 Of course this will generally degrade compression (there's no free lunch).
156 The memory requirements for inflate are (in bytes) 1 << windowBits
157 that is, 32K for windowBits=15 (default value) plus a few kilobytes
161 /* Type declarations */
163 #ifndef OF /* function prototypes */
165 # define OF(args) args
171 /* The following definitions for FAR are needed only for MSDOS mixed
172 * model programming (small or medium model with some far allocations).
173 * This was tested only with MSC; for other MSDOS compilers you may have
174 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
175 * just define FAR to be empty.
177 #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
178 /* MSC small or medium model */
179 # define SMALL_MEDIUM
186 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
188 # define SMALL_MEDIUM
193 /* Compile with -DZLIB_DLL for Windows DLL support */
194 #if defined(ZLIB_DLL)
195 # if defined(_WINDOWS) || defined(WINDOWS)
199 # include <windows.h>
200 # define ZEXPORT WINAPI
202 # define ZEXPORTVA WINAPIV
204 # define ZEXPORTVA FAR _cdecl _export
207 # if defined (__BORLANDC__)
208 # if (__BORLANDC__ >= 0x0500) && defined (WIN32)
209 # include <windows.h>
210 # define ZEXPORT __declspec(dllexport) WINAPI
211 # define ZEXPORTRVA __declspec(dllexport) WINAPIV
213 # if defined (_Windows) && defined (__DLL__)
214 # define ZEXPORT _export
215 # define ZEXPORTVA _export
221 #if defined (__BEOS__)
222 # if defined (ZLIB_DLL)
223 # define ZEXTERN extern __declspec(dllexport)
225 # define ZEXTERN extern __declspec(dllimport)
236 # define ZEXTERN extern
243 #if !defined(MACOS) && !defined(TARGET_OS_MAC)
244 typedef unsigned char Byte; /* 8 bits */
246 typedef unsigned int uInt; /* 16 bits or more */
247 typedef unsigned long uLong; /* 32 bits or more */
250 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
251 # define Bytef Byte FAR
253 typedef Byte FAR Bytef;
255 typedef char FAR charf;
256 typedef int FAR intf;
257 typedef uInt FAR uIntf;
258 typedef uLong FAR uLongf;
261 typedef void FAR *voidpf;
264 typedef Byte FAR *voidpf;
269 # include <sys/types.h> /* for off_t */
270 # include <unistd.h> /* for SEEK_* and off_t */
271 # define z_off_t off_t
274 # define SEEK_SET 0 /* Seek from beginning of file. */
275 # define SEEK_CUR 1 /* Seek from current position. */
276 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
279 # define z_off_t long
282 /* MVS linker does not support external names larger than 8 bytes */
284 # pragma map(deflateInit_,"DEIN")
285 # pragma map(deflateInit2_,"DEIN2")
286 # pragma map(deflateEnd,"DEEND")
287 # pragma map(inflateInit_,"ININ")
288 # pragma map(inflateInit2_,"ININ2")
289 # pragma map(inflateEnd,"INEND")
290 # pragma map(inflateSync,"INSY")
291 # pragma map(inflateSetDictionary,"INSEDI")
292 # pragma map(inflate_blocks,"INBL")
293 # pragma map(inflate_blocks_new,"INBLNE")
294 # pragma map(inflate_blocks_free,"INBLFR")
295 # pragma map(inflate_blocks_reset,"INBLRE")
296 # pragma map(inflate_codes_free,"INCOFR")
297 # pragma map(inflate_codes,"INCO")
298 # pragma map(inflate_fast,"INFA")
299 # pragma map(inflate_flush,"INFLU")
300 # pragma map(inflate_mask,"INMA")
301 # pragma map(inflate_set_dictionary,"INSEDI2")
302 # pragma map(ipcomp_inflate_copyright,"INCOPY")
303 # pragma map(inflate_trees_bits,"INTRBI")
304 # pragma map(inflate_trees_dynamic,"INTRDY")
305 # pragma map(inflate_trees_fixed,"INTRFI")
306 # pragma map(inflate_trees_free,"INTRFR")
309 #endif /* _ZCONF_H */