1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2010 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
11 /* This include does prefixing as below, but with an updated set of names */
15 * If you *really* need a unique prefix for all types and library functions,
16 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
17 * Even better than compiling with -DZ_PREFIX would be to use configure to set
18 * this permanently in zconf.h using "./configure --zprefix".
20 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
22 /* all linked symbols */
23 # define _dist_code z__dist_code
24 # define _length_code z__length_code
25 # define _tr_align z__tr_align
26 # define _tr_flush_block z__tr_flush_block
27 # define _tr_init z__tr_init
28 # define _tr_stored_block z__tr_stored_block
29 # define _tr_tally z__tr_tally
30 # define adler32 z_adler32
31 # define adler32_combine z_adler32_combine
32 # define adler32_combine64 z_adler32_combine64
33 # define compress z_compress
34 # define compress2 z_compress2
35 # define compressBound z_compressBound
36 # define crc32 z_crc32
37 # define crc32_combine z_crc32_combine
38 # define crc32_combine64 z_crc32_combine64
39 # define deflate z_deflate
40 # define deflateBound z_deflateBound
41 # define deflateCopy z_deflateCopy
42 # define deflateEnd z_deflateEnd
43 # define deflateInit2_ z_deflateInit2_
44 # define deflateInit_ z_deflateInit_
45 # define deflateParams z_deflateParams
46 # define deflatePrime z_deflatePrime
47 # define deflateReset z_deflateReset
48 # define deflateSetDictionary z_deflateSetDictionary
49 # define deflateSetHeader z_deflateSetHeader
50 # define deflateTune z_deflateTune
51 # define deflate_copyright z_deflate_copyright
52 # define get_crc_table z_get_crc_table
53 # define gz_error z_gz_error
54 # define gz_intmax z_gz_intmax
55 # define gz_strwinerror z_gz_strwinerror
56 # define gzbuffer z_gzbuffer
57 # define gzclearerr z_gzclearerr
58 # define gzclose z_gzclose
59 # define gzclose_r z_gzclose_r
60 # define gzclose_w z_gzclose_w
61 # define gzdirect z_gzdirect
62 # define gzdopen z_gzdopen
63 # define gzeof z_gzeof
64 # define gzerror z_gzerror
65 # define gzflush z_gzflush
66 # define gzgetc z_gzgetc
67 # define gzgets z_gzgets
68 # define gzoffset z_gzoffset
69 # define gzoffset64 z_gzoffset64
70 # define gzopen z_gzopen
71 # define gzopen64 z_gzopen64
72 # define gzprintf z_gzprintf
73 # define gzputc z_gzputc
74 # define gzputs z_gzputs
75 # define gzread z_gzread
76 # define gzrewind z_gzrewind
77 # define gzseek z_gzseek
78 # define gzseek64 z_gzseek64
79 # define gzsetparams z_gzsetparams
80 # define gztell z_gztell
81 # define gztell64 z_gztell64
82 # define gzungetc z_gzungetc
83 # define gzwrite z_gzwrite
84 # define inflate z_inflate
85 # define inflateBack z_inflateBack
86 # define inflateBackEnd z_inflateBackEnd
87 # define inflateBackInit_ z_inflateBackInit_
88 # define inflateCopy z_inflateCopy
89 # define inflateEnd z_inflateEnd
90 # define inflateGetHeader z_inflateGetHeader
91 # define inflateInit2_ z_inflateInit2_
92 # define inflateInit_ z_inflateInit_
93 # define inflateMark z_inflateMark
94 # define inflatePrime z_inflatePrime
95 # define inflateReset z_inflateReset
96 # define inflateReset2 z_inflateReset2
97 # define inflateSetDictionary z_inflateSetDictionary
98 # define inflateSync z_inflateSync
99 # define inflateSyncPoint z_inflateSyncPoint
100 # define inflateUndermine z_inflateUndermine
101 # define inflate_copyright z_inflate_copyright
102 # define inflate_fast z_inflate_fast
103 # define inflate_table z_inflate_table
104 # define uncompress z_uncompress
105 # define zError z_zError
106 # define zcalloc z_zcalloc
107 # define zcfree z_zcfree
108 # define zlibCompileFlags z_zlibCompileFlags
109 # define zlibVersion z_zlibVersion
111 /* all zlib typedefs in zlib.h and zconf.h */
113 # define Bytef z_Bytef
114 # define alloc_func z_alloc_func
115 # define charf z_charf
116 # define free_func z_free_func
117 # define gzFile z_gzFile
118 # define gz_header z_gz_header
119 # define gz_headerp z_gz_headerp
120 # define in_func z_in_func
122 # define out_func z_out_func
124 # define uIntf z_uIntf
125 # define uLong z_uLong
126 # define uLongf z_uLongf
127 # define voidp z_voidp
128 # define voidpc z_voidpc
129 # define voidpf z_voidpf
131 /* all zlib structs in zlib.h and zconf.h */
132 # define gz_header_s z_gz_header_s
133 # define internal_state z_internal_state
137 #if defined(__MSDOS__) && !defined(MSDOS)
140 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
143 #if defined(_WINDOWS) && !defined(WINDOWS)
146 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
151 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
152 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
160 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
161 * than 64k bytes at a time (needed on systems with 16-bit int).
167 # define UNALIGNED_OK
170 #ifdef __STDC_VERSION__
174 # if __STDC_VERSION__ >= 199901L
180 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
183 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
186 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
189 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
193 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
198 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
199 # define const /* note: need a more gentle solution here */
203 /* Some Mac compilers merge all .h files incorrectly: */
204 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
205 # define NO_DUMMY_DECL
208 /* Maximum value for memLevel in deflateInit2 */
209 #ifndef MAX_MEM_LEVEL
211 # define MAX_MEM_LEVEL 8
213 # define MAX_MEM_LEVEL 9
217 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
218 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
219 * created by gzip. (Files created by minigzip can still be extracted by
223 # define MAX_WBITS 15 /* 32K LZ77 window */
226 /* The memory requirements for deflate are (in bytes):
227 (1 << (windowBits+2)) + (1 << (memLevel+9))
228 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
229 plus a few kilobytes for small objects. For example, if you want to reduce
230 the default memory requirements from 256K to 128K, compile with
231 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
232 Of course this will generally degrade compression (there's no free lunch).
234 The memory requirements for inflate are (in bytes) 1 << windowBits
235 that is, 32K for windowBits=15 (default value) plus a few kilobytes
239 /* Type declarations */
241 #ifndef OF /* function prototypes */
243 # define OF(args) args
249 /* The following definitions for FAR are needed only for MSDOS mixed
250 * model programming (small or medium model with some far allocations).
251 * This was tested only with MSC; for other MSDOS compilers you may have
252 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
253 * just define FAR to be empty.
256 # if defined(M_I86SM) || defined(M_I86MM)
257 /* MSC small or medium model */
258 # define SMALL_MEDIUM
265 # if (defined(__SMALL__) || defined(__MEDIUM__))
266 /* Turbo C small or medium model */
267 # define SMALL_MEDIUM
276 #if defined(WINDOWS) || defined(WIN32)
277 /* If building or using zlib as a DLL, define ZLIB_DLL.
278 * This is not mandatory, but it offers a little performance increase.
281 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
282 # ifdef ZLIB_INTERNAL
283 # define ZEXTERN extern __declspec(dllexport)
285 # define ZEXTERN extern __declspec(dllimport)
288 # endif /* ZLIB_DLL */
289 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
290 * define ZLIB_WINAPI.
291 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
297 # include <windows.h>
298 /* No need for _export, use ZLIB.DEF instead. */
299 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
300 # define ZEXPORT WINAPI
302 # define ZEXPORTVA WINAPIV
304 # define ZEXPORTVA FAR CDECL
309 #if defined (__BEOS__)
311 # ifdef ZLIB_INTERNAL
312 # define ZEXPORT __declspec(dllexport)
313 # define ZEXPORTVA __declspec(dllexport)
315 # define ZEXPORT __declspec(dllimport)
316 # define ZEXPORTVA __declspec(dllimport)
322 # define ZEXTERN extern
335 #if !defined(__MACTYPES__)
336 typedef unsigned char Byte
; /* 8 bits */
338 typedef unsigned int uInt
; /* 16 bits or more */
339 typedef unsigned long uLong
; /* 32 bits or more */
342 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
343 # define Bytef Byte FAR
345 typedef Byte FAR Bytef
;
347 typedef char FAR charf
;
348 typedef int FAR intf
;
349 typedef uInt FAR uIntf
;
350 typedef uLong FAR uLongf
;
353 typedef void const *voidpc
;
354 typedef void FAR
*voidpf
;
357 typedef Byte
const *voidpc
;
358 typedef Byte FAR
*voidpf
;
363 # define Z_HAVE_UNISTD_H
367 # include <sys/types.h> /* for off_t */
370 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
371 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
372 * though the former does not conform to the LFS document), but considering
373 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
374 * equivalently requesting no 64-bit operations
376 #if -_LARGEFILE64_SOURCE - -1 == 1
377 # undef _LARGEFILE64_SOURCE
380 #if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
381 # include <unistd.h> /* for SEEK_* and off_t */
383 # include <unixio.h> /* for off_t */
386 # define z_off_t off_t
391 # define SEEK_SET 0 /* Seek from beginning of file. */
392 # define SEEK_CUR 1 /* Seek from current position. */
393 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
397 # define z_off_t long
400 #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
401 # define z_off64_t off64_t
403 # define z_off64_t z_off_t
406 #if defined(__OS400__)
407 # define NO_vsnprintf
411 # define NO_vsnprintf
414 /* MVS linker does not support external names larger than 8 bytes */
416 #pragma map(deflateInit_,"DEIN")
417 #pragma map(deflateInit2_,"DEIN2")
418 #pragma map(deflateEnd,"DEEND")
419 #pragma map(deflateBound,"DEBND")
420 #pragma map(inflateInit_,"ININ")
421 #pragma map(inflateInit2_,"ININ2")
422 #pragma map(inflateEnd,"INEND")
423 #pragma map(inflateSync,"INSY")
424 #pragma map(inflateSetDictionary,"INSEDI")
425 #pragma map(compressBound,"CMBND")
426 #pragma map(inflate_table,"INTABL")
427 #pragma map(inflate_fast,"INFA")
428 #pragma map(inflate_copyright,"INCOPY")