1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2006 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.
14 * Even better than compiling with -DZ_PREFIX would be to use configure to set
15 * this permanently in zconf.h using "./configure --zprefix".
17 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
19 /* all linked symbols */
20 # define _dist_code z__dist_code
21 # define _length_code z__length_code
22 # define _tr_align z__tr_align
23 # define _tr_flush_block z__tr_flush_block
24 # define _tr_init z__tr_init
25 # define _tr_stored_block z__tr_stored_block
26 # define _tr_tally z__tr_tally
27 # define adler32 z_adler32
28 # define adler32_combine z_adler32_combine
29 # define compress z_compress
30 # define compress2 z_compress2
31 # define compressBound z_compressBound
32 # define crc32 z_crc32
33 # define crc32_combine z_crc32_combine
34 # define deflate z_deflate
35 # define deflateBound z_deflateBound
36 # define deflateCopy z_deflateCopy
37 # define deflateEnd z_deflateEnd
38 # define deflateInit2_ z_deflateInit2_
39 # define deflateInit_ z_deflateInit_
40 # define deflateParams z_deflateParams
41 # define deflatePrime z_deflatePrime
42 # define deflateReset z_deflateReset
43 # define deflateSetDictionary z_deflateSetDictionary
44 # define deflateSetHeader z_deflateSetHeader
45 # define deflateTune z_deflateTune
46 # define deflate_copyright z_deflate_copyright
47 # define get_crc_table z_get_crc_table
48 # define gzclearerr z_gzclearerr
49 # define gzclose z_gzclose
50 # define gzdirect z_gzdirect
51 # define gzdopen z_gzdopen
52 # define gzeof z_gzeof
53 # define gzerror z_gzerror
54 # define gzflush z_gzflush
55 # define gzgetc z_gzgetc
56 # define gzgets z_gzgets
57 # define gzopen z_gzopen
58 # define gzprintf z_gzprintf
59 # define gzputc z_gzputc
60 # define gzputs z_gzputs
61 # define gzread z_gzread
62 # define gzrewind z_gzrewind
63 # define gzseek z_gzseek
64 # define gzsetparams z_gzsetparams
65 # define gztell z_gztell
66 # define gzungetc z_gzungetc
67 # define gzwrite z_gzwrite
68 # define inflate z_inflate
69 # define inflateBack z_inflateBack
70 # define inflateBackEnd z_inflateBackEnd
71 # define inflateBackInit_ z_inflateBackInit_
72 # define inflateCopy z_inflateCopy
73 # define inflateEnd z_inflateEnd
74 # define inflateGetHeader z_inflateGetHeader
75 # define inflateInit2_ z_inflateInit2_
76 # define inflateInit_ z_inflateInit_
77 # define inflatePrime z_inflatePrime
78 # define inflateReset z_inflateReset
79 # define inflateSetDictionary z_inflateSetDictionary
80 # define inflateSync z_inflateSync
81 # define inflateSyncPoint z_inflateSyncPoint
82 # define inflate_copyright z_inflate_copyright
83 # define inflate_fast z_inflate_fast
84 # define inflate_table z_inflate_table
85 # define uncompress z_uncompress
86 # define zError z_zError
87 # define z_errmsg z_z_errmsg
88 # define zcalloc z_zcalloc
89 # define zcfree z_zcfree
90 # define zlibCompileFlags z_zlibCompileFlags
91 # define zlibVersion z_zlibVersion
93 /* all zlib typedefs in zlib.h and zconf.h */
95 # define Bytef z_Bytef
96 # define alloc_func z_alloc_func
97 # define charf z_charf
98 # define free_func z_free_func
99 # define gzFile z_gzFile
100 # define gz_header z_gz_header
101 # define gz_headerp z_gz_headerp
102 # define in_func z_in_func
104 # define out_func z_out_func
106 # define uIntf z_uIntf
107 # define uLong z_uLong
108 # define uLongf z_uLongf
109 # define voidp z_voidp
110 # define voidp z_voidp
111 # define voidpc z_voidpc
112 # define voidpc z_voidpc
113 # define voidpf z_voidpf
114 # define voidpf z_voidpf
115 # define z_stream z_z_stream
116 # define z_streamp z_z_streamp
118 /* all zlib structs in zlib.h and zconf.h */
119 # define gz_header_s z_gz_header_s
120 # define internal_state z_internal_state
121 # define z_stream_s z_z_stream_s
125 #if defined(__MSDOS__) && !defined(MSDOS)
128 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
131 #if defined(_WINDOWS) && !defined(WINDOWS)
134 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
139 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
140 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
148 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
149 * than 64k bytes at a time (needed on systems with 16-bit int).
155 # define UNALIGNED_OK
158 #ifdef __STDC_VERSION__
162 # if __STDC_VERSION__ >= 199901L
168 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
171 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
174 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
177 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
181 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
186 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
187 # define const /* note: need a more gentle solution here */
191 /* Some Mac compilers merge all .h files incorrectly: */
192 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
193 # define NO_DUMMY_DECL
196 /* Maximum value for memLevel in deflateInit2 */
197 #ifndef MAX_MEM_LEVEL
199 # define MAX_MEM_LEVEL 8
201 # define MAX_MEM_LEVEL 9
205 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
206 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
207 * created by gzip. (Files created by minigzip can still be extracted by
211 # define MAX_WBITS 15 /* 32K LZ77 window */
214 /* The memory requirements for deflate are (in bytes):
215 (1 << (windowBits+2)) + (1 << (memLevel+9))
216 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
217 plus a few kilobytes for small objects. For example, if you want to reduce
218 the default memory requirements from 256K to 128K, compile with
219 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
220 Of course this will generally degrade compression (there's no free lunch).
222 The memory requirements for inflate are (in bytes) 1 << windowBits
223 that is, 32K for windowBits=15 (default value) plus a few kilobytes
227 /* Type declarations */
229 #ifndef OF /* function prototypes */
231 # define OF(args) args
237 /* The following definitions for FAR are needed only for MSDOS mixed
238 * model programming (small or medium model with some far allocations).
239 * This was tested only with MSC; for other MSDOS compilers you may have
240 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
241 * just define FAR to be empty.
244 # if defined(M_I86SM) || defined(M_I86MM)
245 /* MSC small or medium model */
246 # define SMALL_MEDIUM
253 # if (defined(__SMALL__) || defined(__MEDIUM__))
254 /* Turbo C small or medium model */
255 # define SMALL_MEDIUM
264 #if defined(WINDOWS) || defined(WIN32)
265 /* If building or using zlib as a DLL, define ZLIB_DLL.
266 * This is not mandatory, but it offers a little performance increase.
269 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
270 # ifdef ZLIB_INTERNAL
271 # define ZEXTERN extern __declspec(dllexport)
273 # define ZEXTERN extern __declspec(dllimport)
276 # endif /* ZLIB_DLL */
277 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
278 * define ZLIB_WINAPI.
279 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
285 # include <windows.h>
286 /* No need for _export, use ZLIB.DEF instead. */
287 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
288 # define ZEXPORT WINAPI
290 # define ZEXPORTVA WINAPIV
292 # define ZEXPORTVA FAR CDECL
297 #if defined (__BEOS__)
299 # ifdef ZLIB_INTERNAL
300 # define ZEXPORT __declspec(dllexport)
301 # define ZEXPORTVA __declspec(dllexport)
303 # define ZEXPORT __declspec(dllimport)
304 # define ZEXPORTVA __declspec(dllimport)
309 #ifdef HAVE_VISIBILITY_PRAGMA
310 # define ZEXTERN __attribute__((visibility ("default"))) extern
314 # define ZEXTERN extern
327 #if !defined(__MACTYPES__)
328 typedef unsigned char Byte
; /* 8 bits */
330 typedef unsigned int uInt
; /* 16 bits or more */
331 typedef unsigned long uLong
; /* 32 bits or more */
334 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
335 # define Bytef Byte FAR
337 typedef Byte FAR Bytef
;
339 typedef char FAR charf
;
340 typedef int FAR intf
;
341 typedef uInt FAR uIntf
;
342 typedef uLong FAR uLongf
;
345 typedef void const *voidpc
;
346 typedef void FAR
*voidpf
;
349 typedef Byte
const *voidpc
;
350 typedef Byte FAR
*voidpf
;
355 * This is created by zlib's configure script to define off_t
356 #include "zlibdefs.h"
360 # define SEEK_SET 0 /* Seek from beginning of file. */
361 # define SEEK_CUR 1 /* Seek from current position. */
362 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
365 # define z_off_t long
368 #if defined(__OS400__)
369 # define NO_vsnprintf
373 # define NO_vsnprintf
376 /* MVS linker does not support external names larger than 8 bytes */
378 # pragma map(deflateInit_,"DEIN")
379 # pragma map(deflateInit2_,"DEIN2")
380 # pragma map(deflateEnd,"DEEND")
381 # pragma map(deflateBound,"DEBND")
382 # pragma map(inflateInit_,"ININ")
383 # pragma map(inflateInit2_,"ININ2")
384 # pragma map(inflateEnd,"INEND")
385 # pragma map(inflateSync,"INSY")
386 # pragma map(inflateSetDictionary,"INSEDI")
387 # pragma map(compressBound,"CMBND")
388 # pragma map(inflate_table,"INTABL")
389 # pragma map(inflate_fast,"INFA")
390 # pragma map(inflate_copyright,"INCOPY")
395 #define NO_vsnprintf 1