1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2011 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 */
20 /* all linked symbols */
21 # define _dist_code z__dist_code
22 # define _length_code z__length_code
23 # define _tr_align z__tr_align
24 # define _tr_flush_block z__tr_flush_block
25 # define _tr_init z__tr_init
26 # define _tr_stored_block z__tr_stored_block
27 # define _tr_tally z__tr_tally
28 # define adler32 z_adler32
29 # define adler32_combine z_adler32_combine
30 # define adler32_combine64 z_adler32_combine64
31 # define compress z_compress
32 # define compress2 z_compress2
33 # define compressBound z_compressBound
34 # define crc32 z_crc32
35 # define crc32_combine z_crc32_combine
36 # define crc32_combine64 z_crc32_combine64
37 # define deflate z_deflate
38 # define deflateBound z_deflateBound
39 # define deflateCopy z_deflateCopy
40 # define deflateEnd z_deflateEnd
41 # define deflateInit2_ z_deflateInit2_
42 # define deflateInit_ z_deflateInit_
43 # define deflateParams z_deflateParams
44 # define deflatePending z_deflatePending
45 # define deflatePrime z_deflatePrime
46 # define deflateReset z_deflateReset
47 # define deflateSetDictionary z_deflateSetDictionary
48 # define deflateSetHeader z_deflateSetHeader
49 # define deflateTune z_deflateTune
50 # define deflate_copyright z_deflate_copyright
51 # define get_crc_table z_get_crc_table
52 # define gz_error z_gz_error
53 # define gz_intmax z_gz_intmax
54 # define gz_strwinerror z_gz_strwinerror
55 # define gzbuffer z_gzbuffer
56 # define gzclearerr z_gzclearerr
57 # define gzclose z_gzclose
58 # define gzclose_r z_gzclose_r
59 # define gzclose_w z_gzclose_w
60 # define gzdirect z_gzdirect
61 # define gzdopen z_gzdopen
62 # define gzeof z_gzeof
63 # define gzerror z_gzerror
64 # define gzflush z_gzflush
65 # define gzgetc z_gzgetc
66 # define gzgets z_gzgets
67 # define gzoffset z_gzoffset
68 # define gzoffset64 z_gzoffset64
69 # define gzopen z_gzopen
70 # define gzopen64 z_gzopen64
71 # define gzprintf z_gzprintf
72 # define gzputc z_gzputc
73 # define gzputs z_gzputs
74 # define gzread z_gzread
75 # define gzrewind z_gzrewind
76 # define gzseek z_gzseek
77 # define gzseek64 z_gzseek64
78 # define gzsetparams z_gzsetparams
79 # define gztell z_gztell
80 # define gztell64 z_gztell64
81 # define gzungetc z_gzungetc
82 # define gzwrite z_gzwrite
83 # define inflate z_inflate
84 # define inflateBack z_inflateBack
85 # define inflateBackEnd z_inflateBackEnd
86 # define inflateBackInit_ z_inflateBackInit_
87 # define inflateCopy z_inflateCopy
88 # define inflateEnd z_inflateEnd
89 # define inflateGetHeader z_inflateGetHeader
90 # define inflateInit2_ z_inflateInit2_
91 # define inflateInit_ z_inflateInit_
92 # define inflateMark z_inflateMark
93 # define inflatePrime z_inflatePrime
94 # define inflateReset z_inflateReset
95 # define inflateReset2 z_inflateReset2
96 # define inflateSetDictionary z_inflateSetDictionary
97 # define inflateSync z_inflateSync
98 # define inflateSyncPoint z_inflateSyncPoint
99 # define inflateUndermine z_inflateUndermine
100 # define inflate_copyright z_inflate_copyright
101 # define inflate_fast z_inflate_fast
102 # define inflate_table z_inflate_table
103 # define uncompress z_uncompress
104 # define zError z_zError
105 # define zcalloc z_zcalloc
106 # define zcfree z_zcfree
107 # define zlibCompileFlags z_zlibCompileFlags
108 # define zlibVersion z_zlibVersion
110 /* all zlib typedefs in zlib.h and zconf.h */
112 # define Bytef z_Bytef
113 # define alloc_func z_alloc_func
114 # define charf z_charf
115 # define free_func z_free_func
116 # define gzFile z_gzFile
117 # define gz_header z_gz_header
118 # define gz_headerp z_gz_headerp
119 # define in_func z_in_func
121 # define out_func z_out_func
123 # define uIntf z_uIntf
124 # define uLong z_uLong
125 # define uLongf z_uLongf
126 # define voidp z_voidp
127 # define voidpc z_voidpc
128 # define voidpf z_voidpf
130 /* all zlib structs in zlib.h and zconf.h */
131 # define gz_header_s z_gz_header_s
132 # define internal_state z_internal_state
136 #if defined(__MSDOS__) && !defined(MSDOS)
139 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
142 #if defined(_WINDOWS) && !defined(WINDOWS)
145 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
150 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
151 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
159 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
160 * than 64k bytes at a time (needed on systems with 16-bit int).
166 # define UNALIGNED_OK
169 #ifdef __STDC_VERSION__
173 # if __STDC_VERSION__ >= 199901L
179 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
182 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
185 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
188 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
192 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
197 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
198 # define const /* note: need a more gentle solution here */
202 /* Some Mac compilers merge all .h files incorrectly: */
203 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
204 # define NO_DUMMY_DECL
207 /* Maximum value for memLevel in deflateInit2 */
208 #ifndef MAX_MEM_LEVEL
210 # define MAX_MEM_LEVEL 8
212 # define MAX_MEM_LEVEL 9
216 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
217 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
218 * created by gzip. (Files created by minigzip can still be extracted by
222 # define MAX_WBITS 15 /* 32K LZ77 window */
225 /* The memory requirements for deflate are (in bytes):
226 (1 << (windowBits+2)) + (1 << (memLevel+9))
227 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
228 plus a few kilobytes for small objects. For example, if you want to reduce
229 the default memory requirements from 256K to 128K, compile with
230 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
231 Of course this will generally degrade compression (there's no free lunch).
233 The memory requirements for inflate are (in bytes) 1 << windowBits
234 that is, 32K for windowBits=15 (default value) plus a few kilobytes
238 /* Type declarations */
240 #ifndef OF /* function prototypes */
242 # define OF(args) args
248 #ifndef ON /* function prototypes for stdarg */
249 # if defined(STDC) || defined(Z_HAVE_STDARG_H)
250 # define ON(args) args
256 /* The following definitions for FAR are needed only for MSDOS mixed
257 * model programming (small or medium model with some far allocations).
258 * This was tested only with MSC; for other MSDOS compilers you may have
259 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
260 * just define FAR to be empty.
263 # if defined(M_I86SM) || defined(M_I86MM)
264 /* MSC small or medium model */
265 # define SMALL_MEDIUM
272 # if (defined(__SMALL__) || defined(__MEDIUM__))
273 /* Turbo C small or medium model */
274 # define SMALL_MEDIUM
283 #if defined(WINDOWS) || defined(WIN32)
284 /* If building or using zlib as a DLL, define ZLIB_DLL.
285 * This is not mandatory, but it offers a little performance increase.
288 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
289 # ifdef ZLIB_INTERNAL
290 # define ZEXTERN extern __declspec(dllexport)
292 # define ZEXTERN extern __declspec(dllimport)
295 # endif /* ZLIB_DLL */
296 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
297 * define ZLIB_WINAPI.
298 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
304 # include <windows.h>
305 /* No need for _export, use ZLIB.DEF instead. */
306 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
307 # define ZEXPORT WINAPI
309 # define ZEXPORTVA WINAPIV
311 # define ZEXPORTVA FAR CDECL
316 #if defined (__BEOS__)
318 # ifdef ZLIB_INTERNAL
319 # define ZEXPORT __declspec(dllexport)
320 # define ZEXPORTVA __declspec(dllexport)
322 # define ZEXPORT __declspec(dllimport)
323 # define ZEXPORTVA __declspec(dllimport)
329 # define ZEXTERN extern
342 #if !defined(__MACTYPES__)
343 typedef unsigned char Byte; /* 8 bits */
345 typedef unsigned int uInt; /* 16 bits or more */
346 typedef unsigned long uLong; /* 32 bits or more */
349 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
350 # define Bytef Byte FAR
352 typedef Byte FAR Bytef;
354 typedef char FAR charf;
355 typedef int FAR intf;
356 typedef uInt FAR uIntf;
357 typedef uLong FAR uLongf;
360 typedef void const *voidpc;
361 typedef void FAR *voidpf;
364 typedef Byte const *voidpc;
365 typedef Byte FAR *voidpf;
369 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
370 # define Z_HAVE_UNISTD_H
373 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
374 # define Z_HAVE_STDARG_H
378 # include <sys/types.h> /* for off_t */
381 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
382 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
383 * though the former does not conform to the LFS document), but considering
384 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
385 * equivalently requesting no 64-bit operations
387 #if -_LARGEFILE64_SOURCE - -1 == 1
388 # undef _LARGEFILE64_SOURCE
391 #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
395 #if defined(Z_HAVE_UNISTD_H) || defined(Z_LARGE)
396 # include <unistd.h> /* for SEEK_* and off_t */
398 # include <unixio.h> /* for off_t */
401 # define z_off_t off_t
406 # define SEEK_SET 0 /* Seek from beginning of file. */
407 # define SEEK_CUR 1 /* Seek from current position. */
408 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
412 # define z_off_t long
415 #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
416 # define z_off64_t off64_t
418 # define z_off64_t z_off_t
421 #if defined(__OS400__)
422 # define NO_vsnprintf
426 # define NO_vsnprintf
429 /* MVS linker does not support external names larger than 8 bytes */
431 #pragma map(deflateInit_,"DEIN")
432 #pragma map(deflateInit2_,"DEIN2")
433 #pragma map(deflateEnd,"DEEND")
434 #pragma map(deflateBound,"DEBND")
435 #pragma map(inflateInit_,"ININ")
436 #pragma map(inflateInit2_,"ININ2")
437 #pragma map(inflateEnd,"INEND")
438 #pragma map(inflateSync,"INSY")
439 #pragma map(inflateSetDictionary,"INSEDI")
440 #pragma map(compressBound,"CMBND")
441 #pragma map(inflate_table,"INTABL")
442 #pragma map(inflate_fast,"INFA")
443 #pragma map(inflate_copyright,"INCOPY")