1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2007 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 gzbuffer z_gzbuffer
49 # define gzclearerr z_gzclearerr
50 # define gzclose z_gzclose
51 # define gzclose_r z_gzclose_r
52 # define gzclose_w z_gzclose_w
53 # define gzdirect z_gzdirect
54 # define gzdopen z_gzdopen
55 # define gzeof z_gzeof
56 # define gzerror z_gzerror
57 # define gzflush z_gzflush
58 # define gzgetc z_gzgetc
59 # define gzgets z_gzgets
60 # define gzoffset z_gzoffset
61 # define gzopen z_gzopen
62 # define gzprintf z_gzprintf
63 # define gzputc z_gzputc
64 # define gzputs z_gzputs
65 # define gzread z_gzread
66 # define gzrewind z_gzrewind
67 # define gzseek z_gzseek
68 # define gzsetparams z_gzsetparams
69 # define gztell z_gztell
70 # define gzungetc z_gzungetc
71 # define gzwrite z_gzwrite
72 # define inflate z_inflate
73 # define inflateBack z_inflateBack
74 # define inflateBackEnd z_inflateBackEnd
75 # define inflateBackInit_ z_inflateBackInit_
76 # define inflateCopy z_inflateCopy
77 # define inflateEnd z_inflateEnd
78 # define inflateGetHeader z_inflateGetHeader
79 # define inflateInit2_ z_inflateInit2_
80 # define inflateInit_ z_inflateInit_
81 # define inflateMark z_inflateMark
82 # define inflatePrime z_inflatePrime
83 # define inflateReset z_inflateReset
84 # define inflateReset2 z_inflateReset2
85 # define inflateSetDictionary z_inflateSetDictionary
86 # define inflateSync z_inflateSync
87 # define inflateSyncPoint z_inflateSyncPoint
88 # define inflate_copyright z_inflate_copyright
89 # define inflate_fast z_inflate_fast
90 # define inflate_table z_inflate_table
91 # define uncompress z_uncompress
92 # define zError z_zError
93 # define z_errmsg z_z_errmsg
94 # define zcalloc z_zcalloc
95 # define zcfree z_zcfree
96 # define zlibCompileFlags z_zlibCompileFlags
97 # define zlibVersion z_zlibVersion
99 /* all zlib typedefs in zlib.h and zconf.h */
101 # define Bytef z_Bytef
102 # define alloc_func z_alloc_func
103 # define charf z_charf
104 # define free_func z_free_func
105 # define gzFile z_gzFile
106 # define gz_header z_gz_header
107 # define gz_headerp z_gz_headerp
108 # define in_func z_in_func
110 # define out_func z_out_func
112 # define uIntf z_uIntf
113 # define uLong z_uLong
114 # define uLongf z_uLongf
115 # define voidp z_voidp
116 # define voidp z_voidp
117 # define voidpc z_voidpc
118 # define voidpc z_voidpc
119 # define voidpf z_voidpf
120 # define voidpf z_voidpf
121 # define z_stream z_z_stream
122 # define z_streamp z_z_streamp
124 /* all zlib structs in zlib.h and zconf.h */
125 # define gz_header_s z_gz_header_s
126 # define internal_state z_internal_state
127 # define z_stream_s z_z_stream_s
131 #if defined(__MSDOS__) && !defined(MSDOS)
134 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
137 #if defined(_WINDOWS) && !defined(WINDOWS)
140 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
145 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
146 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
154 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
155 * than 64k bytes at a time (needed on systems with 16-bit int).
161 # define UNALIGNED_OK
164 #ifdef __STDC_VERSION__
168 # if __STDC_VERSION__ >= 199901L
174 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
177 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
180 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
183 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
187 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
192 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
193 # define const /* note: need a more gentle solution here */
197 /* Some Mac compilers merge all .h files incorrectly: */
198 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
199 # define NO_DUMMY_DECL
202 /* Maximum value for memLevel in deflateInit2 */
203 #ifndef MAX_MEM_LEVEL
205 # define MAX_MEM_LEVEL 8
207 # define MAX_MEM_LEVEL 9
211 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
212 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
213 * created by gzip. (Files created by minigzip can still be extracted by
217 # define MAX_WBITS 15 /* 32K LZ77 window */
220 /* The memory requirements for deflate are (in bytes):
221 (1 << (windowBits+2)) + (1 << (memLevel+9))
222 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
223 plus a few kilobytes for small objects. For example, if you want to reduce
224 the default memory requirements from 256K to 128K, compile with
225 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
226 Of course this will generally degrade compression (there's no free lunch).
228 The memory requirements for inflate are (in bytes) 1 << windowBits
229 that is, 32K for windowBits=15 (default value) plus a few kilobytes
233 /* Type declarations */
235 #ifndef OF /* function prototypes */
237 # define OF(args) args
243 /* The following definitions for FAR are needed only for MSDOS mixed
244 * model programming (small or medium model with some far allocations).
245 * This was tested only with MSC; for other MSDOS compilers you may have
246 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
247 * just define FAR to be empty.
250 # if defined(M_I86SM) || defined(M_I86MM)
251 /* MSC small or medium model */
252 # define SMALL_MEDIUM
259 # if (defined(__SMALL__) || defined(__MEDIUM__))
260 /* Turbo C small or medium model */
261 # define SMALL_MEDIUM
270 #if defined(WINDOWS) || defined(WIN32)
271 /* If building or using zlib as a DLL, define ZLIB_DLL.
272 * This is not mandatory, but it offers a little performance increase.
275 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
276 # ifdef ZLIB_INTERNAL
277 # define ZEXTERN extern __declspec(dllexport)
279 # define ZEXTERN extern __declspec(dllimport)
282 # endif /* ZLIB_DLL */
283 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
284 * define ZLIB_WINAPI.
285 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
291 # include <windows.h>
292 /* No need for _export, use ZLIB.DEF instead. */
293 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
294 # define ZEXPORT WINAPI
296 # define ZEXPORTVA WINAPIV
298 # define ZEXPORTVA FAR CDECL
303 #if defined (__BEOS__)
305 # ifdef ZLIB_INTERNAL
306 # define ZEXPORT __declspec(dllexport)
307 # define ZEXPORTVA __declspec(dllexport)
309 # define ZEXPORT __declspec(dllimport)
310 # define ZEXPORTVA __declspec(dllimport)
315 #ifdef HAVE_VISIBILITY_PRAGMA
316 # define ZEXTERN __attribute__((visibility ("default"))) extern
320 # define ZEXTERN extern
333 #if !defined(__MACTYPES__)
334 typedef unsigned char Byte; /* 8 bits */
336 typedef unsigned int uInt; /* 16 bits or more */
337 typedef unsigned long uLong; /* 32 bits or more */
340 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
341 # define Bytef Byte FAR
343 typedef Byte FAR Bytef;
345 typedef char FAR charf;
346 typedef int FAR intf;
347 typedef uInt FAR uIntf;
348 typedef uLong FAR uLongf;
351 typedef void const *voidpc;
352 typedef void FAR *voidpf;
355 typedef Byte const *voidpc;
356 typedef Byte FAR *voidpf;
360 #include "zlibdefs.h" /* created by configure */
362 #ifdef _LARGEFILE64_SOURCE
363 # include <sys/types.h>
367 # define SEEK_SET 0 /* Seek from beginning of file. */
368 # define SEEK_CUR 1 /* Seek from current position. */
369 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
372 # define z_off_t long
375 #if defined(__OS400__)
376 # define NO_vsnprintf
380 # define NO_vsnprintf
383 /* MVS linker does not support external names larger than 8 bytes */
385 # pragma map(deflateInit_,"DEIN")
386 # pragma map(deflateInit2_,"DEIN2")
387 # pragma map(deflateEnd,"DEEND")
388 # pragma map(deflateBound,"DEBND")
389 # pragma map(inflateInit_,"ININ")
390 # pragma map(inflateInit2_,"ININ2")
391 # pragma map(inflateEnd,"INEND")
392 # pragma map(inflateSync,"INSY")
393 # pragma map(inflateSetDictionary,"INSEDI")
394 # pragma map(compressBound,"CMBND")
395 # pragma map(inflate_table,"INTABL")
396 # pragma map(inflate_fast,"INFA")
397 # pragma map(inflate_copyright,"INCOPY")