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 /* @(#) $FreeBSD: src/lib/libz/zconf.h,v 1.6.2.1 2003/02/01 13:33:12 sobomax Exp $ */
7 /* @(#) $DragonFly: src/lib/libz/Attic/zconf.h,v 1.2 2003/06/17 04:26:52 dillon Exp $ */
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 inflateInit2_ z_inflateInit2_
29 # define inflateSetDictionary z_inflateSetDictionary
30 # define inflateSync z_inflateSync
31 # define inflateSyncPoint z_inflateSyncPoint
32 # define inflateReset z_inflateReset
33 # define compress z_compress
34 # define compress2 z_compress2
35 # define uncompress z_uncompress
36 # define adler32 z_adler32
37 # define crc32 z_crc32
38 # define get_crc_table z_get_crc_table
42 # define uLong z_uLong
43 # define Bytef z_Bytef
44 # define charf z_charf
46 # define uIntf z_uIntf
47 # define uLongf z_uLongf
48 # define voidpf z_voidpf
49 # define voidp z_voidp
52 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
55 #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
60 #if defined(__MSDOS__) && !defined(MSDOS)
65 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
66 * than 64k bytes at a time (needed on systems with 16-bit int).
68 #if defined(MSDOS) && !defined(__32BIT__)
75 #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
78 #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
85 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
90 /* Some Mac compilers merge all .h files incorrectly: */
91 #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
92 # define NO_DUMMY_DECL
95 /* Old Borland C incorrectly complains about missing returns: */
96 #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
97 # define NEED_DUMMY_RETURN
101 /* Maximum value for memLevel in deflateInit2 */
102 #ifndef MAX_MEM_LEVEL
104 # define MAX_MEM_LEVEL 8
106 # define MAX_MEM_LEVEL 9
110 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
111 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
112 * created by gzip. (Files created by minigzip can still be extracted by
116 # define MAX_WBITS 15 /* 32K LZ77 window */
119 /* The memory requirements for deflate are (in bytes):
120 (1 << (windowBits+2)) + (1 << (memLevel+9))
121 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
122 plus a few kilobytes for small objects. For example, if you want to reduce
123 the default memory requirements from 256K to 128K, compile with
124 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
125 Of course this will generally degrade compression (there's no free lunch).
127 The memory requirements for inflate are (in bytes) 1 << windowBits
128 that is, 32K for windowBits=15 (default value) plus a few kilobytes
132 /* Type declarations */
134 #ifndef OF /* function prototypes */
136 # define OF(args) args
142 /* The following definitions for FAR are needed only for MSDOS mixed
143 * model programming (small or medium model with some far allocations).
144 * This was tested only with MSC; for other MSDOS compilers you may have
145 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
146 * just define FAR to be empty.
148 #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
149 /* MSC small or medium model */
150 # define SMALL_MEDIUM
157 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
159 # define SMALL_MEDIUM
164 /* Compile with -DZLIB_DLL for Windows DLL support */
165 #if defined(ZLIB_DLL)
166 # if defined(_WINDOWS) || defined(WINDOWS)
170 # include <windows.h>
171 # define ZEXPORT WINAPI
173 # define ZEXPORTVA WINAPIV
175 # define ZEXPORTVA FAR _cdecl _export
178 # if defined (__BORLANDC__)
179 # if (__BORLANDC__ >= 0x0500) && defined (WIN32)
180 # include <windows.h>
181 # define ZEXPORT __declspec(dllexport) WINAPI
182 # define ZEXPORTRVA __declspec(dllexport) WINAPIV
184 # if defined (_Windows) && defined (__DLL__)
185 # define ZEXPORT _export
186 # define ZEXPORTVA _export
192 #if defined (__BEOS__)
193 # if defined (ZLIB_DLL)
194 # define ZEXTERN extern __declspec(dllexport)
196 # define ZEXTERN extern __declspec(dllimport)
207 # define ZEXTERN extern
214 #if !defined(MACOS) && !defined(TARGET_OS_MAC)
215 typedef unsigned char Byte; /* 8 bits */
217 typedef unsigned int uInt; /* 16 bits or more */
218 typedef unsigned long uLong; /* 32 bits or more */
221 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
222 # define Bytef Byte FAR
224 typedef Byte FAR Bytef;
226 typedef char FAR charf;
227 typedef int FAR intf;
228 typedef uInt FAR uIntf;
229 typedef uLong FAR uLongf;
232 typedef void FAR *voidpf;
235 typedef Byte FAR *voidpf;
240 # include <sys/types.h> /* for off_t */
241 # include <unistd.h> /* for SEEK_* and off_t */
244 # define SEEK_SET 0 /* Seek from beginning of file. */
245 # define SEEK_CUR 1 /* Seek from current position. */
246 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
250 * This is hard-configured for FreeBSD, since zlib doesn't actually support
251 * using the system off_t for offsets unless off_t is no longer than long.
255 /* MVS linker does not support external names larger than 8 bytes */
257 # pragma map(deflateInit_,"DEIN")
258 # pragma map(deflateInit2_,"DEIN2")
259 # pragma map(deflateEnd,"DEEND")
260 # pragma map(inflateInit_,"ININ")
261 # pragma map(inflateInit2_,"ININ2")
262 # pragma map(inflateEnd,"INEND")
263 # pragma map(inflateSync,"INSY")
264 # pragma map(inflateSetDictionary,"INSEDI")
265 # pragma map(inflate_blocks,"INBL")
266 # pragma map(inflate_blocks_new,"INBLNE")
267 # pragma map(inflate_blocks_free,"INBLFR")
268 # pragma map(inflate_blocks_reset,"INBLRE")
269 # pragma map(inflate_codes_free,"INCOFR")
270 # pragma map(inflate_codes,"INCO")
271 # pragma map(inflate_fast,"INFA")
272 # pragma map(inflate_flush,"INFLU")
273 # pragma map(inflate_mask,"INMA")
274 # pragma map(inflate_set_dictionary,"INSEDI2")
275 # pragma map(inflate_copyright,"INCOPY")
276 # pragma map(inflate_trees_bits,"INTRBI")
277 # pragma map(inflate_trees_dynamic,"INTRDY")
278 # pragma map(inflate_trees_fixed,"INTRFI")
279 # pragma map(inflate_trees_free,"INTRFR")
282 #endif /* _ZCONF_H */