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
11 /* The following four defines are enabled by sudo's configure script. */
15 #undef _FILE_OFFSET_BITS
20 * If you *really* need a unique prefix for all types and library functions,
21 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
22 * Even better than compiling with -DZ_PREFIX would be to use configure to set
23 * this permanently in zconf.h using "./configure --zprefix".
25 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
28 /* all linked symbols */
29 # define _dist_code z__dist_code
30 # define _length_code z__length_code
31 # define _tr_align z__tr_align
32 # define _tr_flush_block z__tr_flush_block
33 # define _tr_init z__tr_init
34 # define _tr_stored_block z__tr_stored_block
35 # define _tr_tally z__tr_tally
36 # define adler32 z_adler32
37 # define adler32_combine z_adler32_combine
38 # define adler32_combine64 z_adler32_combine64
40 # define compress z_compress
41 # define compress2 z_compress2
42 # define compressBound z_compressBound
44 # define crc32 z_crc32
45 # define crc32_combine z_crc32_combine
46 # define crc32_combine64 z_crc32_combine64
47 # define deflate z_deflate
48 # define deflateBound z_deflateBound
49 # define deflateCopy z_deflateCopy
50 # define deflateEnd z_deflateEnd
51 # define deflateInit2_ z_deflateInit2_
52 # define deflateInit_ z_deflateInit_
53 # define deflateParams z_deflateParams
54 # define deflatePending z_deflatePending
55 # define deflatePrime z_deflatePrime
56 # define deflateReset z_deflateReset
57 # define deflateResetKeep z_deflateResetKeep
58 # define deflateSetDictionary z_deflateSetDictionary
59 # define deflateSetHeader z_deflateSetHeader
60 # define deflateTune z_deflateTune
61 # define deflate_copyright z_deflate_copyright
62 # define get_crc_table z_get_crc_table
64 # define gz_error z_gz_error
65 # define gz_intmax z_gz_intmax
66 # define gz_strwinerror z_gz_strwinerror
67 # define gzbuffer z_gzbuffer
68 # define gzclearerr z_gzclearerr
69 # define gzclose z_gzclose
70 # define gzclose_r z_gzclose_r
71 # define gzclose_w z_gzclose_w
72 # define gzdirect z_gzdirect
73 # define gzdopen z_gzdopen
74 # define gzeof z_gzeof
75 # define gzerror z_gzerror
76 # define gzflags z_gzflags
77 # define gzflush z_gzflush
78 # define gzgetc z_gzgetc
79 # define gzgetc_ z_gzgetc_
80 # define gzgets z_gzgets
81 # define gzoffset z_gzoffset
82 # define gzoffset64 z_gzoffset64
83 # define gzopen z_gzopen
84 # define gzopen64 z_gzopen64
85 # define gzprintf z_gzprintf
86 # define gzputc z_gzputc
87 # define gzputs z_gzputs
88 # define gzread z_gzread
89 # define gzrewind z_gzrewind
90 # define gzseek z_gzseek
91 # define gzseek64 z_gzseek64
92 # define gzsetparams z_gzsetparams
93 # define gztell z_gztell
94 # define gztell64 z_gztell64
95 # define gzungetc z_gzungetc
96 # define gzwrite z_gzwrite
98 # define inflate z_inflate
99 # define inflateBack z_inflateBack
100 # define inflateBackEnd z_inflateBackEnd
101 # define inflateBackInit_ z_inflateBackInit_
102 # define inflateCopy z_inflateCopy
103 # define inflateEnd z_inflateEnd
104 # define inflateGetHeader z_inflateGetHeader
105 # define inflateInit2_ z_inflateInit2_
106 # define inflateInit_ z_inflateInit_
107 # define inflateMark z_inflateMark
108 # define inflatePrime z_inflatePrime
109 # define inflateReset z_inflateReset
110 # define inflateReset2 z_inflateReset2
111 # define inflateSetDictionary z_inflateSetDictionary
112 # define inflateSync z_inflateSync
113 # define inflateSyncPoint z_inflateSyncPoint
114 # define inflateUndermine z_inflateUndermine
115 # define inflateResetKeep z_inflateResetKeep
116 # define inflate_copyright z_inflate_copyright
117 # define inflate_fast z_inflate_fast
118 # define inflate_table z_inflate_table
120 # define uncompress z_uncompress
122 # define zError z_zError
124 # define zcalloc z_zcalloc
125 # define zcfree z_zcfree
127 # define zlibCompileFlags z_zlibCompileFlags
128 # define zlibVersion z_zlibVersion
130 /* all zlib typedefs in zlib.h and zconf.h */
132 # define Bytef z_Bytef
133 # define alloc_func z_alloc_func
134 # define charf z_charf
135 # define free_func z_free_func
137 # define gzFile z_gzFile
138 # define gz_header z_gz_header
139 # define gz_headerp z_gz_headerp
141 # define in_func z_in_func
143 # define out_func z_out_func
145 # define uIntf z_uIntf
146 # define uLong z_uLong
147 # define uLongf z_uLongf
148 # define voidp z_voidp
149 # define voidpc z_voidpc
150 # define voidpf z_voidpf
152 /* all zlib structs in zlib.h and zconf.h */
154 # define gz_header_s z_gz_header_s
156 # define internal_state z_internal_state
160 #if defined(__MSDOS__) && !defined(MSDOS)
163 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
166 #if defined(_WINDOWS) && !defined(WINDOWS)
169 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
174 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
175 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
183 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
184 * than 64k bytes at a time (needed on systems with 16-bit int).
190 # define UNALIGNED_OK
193 #ifdef __STDC_VERSION__
197 # if __STDC_VERSION__ >= 199901L
203 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
206 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
209 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
212 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
216 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
221 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
222 # define const /* note: need a more gentle solution here */
226 #if defined(ZLIB_CONST) && !defined(z_const)
227 # define z_const const
232 /* Some Mac compilers merge all .h files incorrectly: */
233 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
234 # define NO_DUMMY_DECL
237 /* Maximum value for memLevel in deflateInit2 */
238 #ifndef MAX_MEM_LEVEL
240 # define MAX_MEM_LEVEL 8
242 # define MAX_MEM_LEVEL 9
246 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
247 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
248 * created by gzip. (Files created by minigzip can still be extracted by
252 # define MAX_WBITS 15 /* 32K LZ77 window */
255 /* The memory requirements for deflate are (in bytes):
256 (1 << (windowBits+2)) + (1 << (memLevel+9))
257 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
258 plus a few kilobytes for small objects. For example, if you want to reduce
259 the default memory requirements from 256K to 128K, compile with
260 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
261 Of course this will generally degrade compression (there's no free lunch).
263 The memory requirements for inflate are (in bytes) 1 << windowBits
264 that is, 32K for windowBits=15 (default value) plus a few kilobytes
268 /* Type declarations */
270 #ifndef OF /* function prototypes */
272 # define OF(args) args
278 #ifndef Z_ARG /* function prototypes for stdarg */
279 # if defined(STDC) || defined(Z_HAVE_STDARG_H)
280 # define Z_ARG(args) args
282 # define Z_ARG(args) ()
286 /* The following definitions for FAR are needed only for MSDOS mixed
287 * model programming (small or medium model with some far allocations).
288 * This was tested only with MSC; for other MSDOS compilers you may have
289 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
290 * just define FAR to be empty.
293 # if defined(M_I86SM) || defined(M_I86MM)
294 /* MSC small or medium model */
295 # define SMALL_MEDIUM
302 # if (defined(__SMALL__) || defined(__MEDIUM__))
303 /* Turbo C small or medium model */
304 # define SMALL_MEDIUM
313 #if defined(WINDOWS) || defined(WIN32)
314 /* If building or using zlib as a DLL, define ZLIB_DLL.
315 * This is not mandatory, but it offers a little performance increase.
318 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
319 # ifdef ZLIB_INTERNAL
320 # define ZEXTERN extern __declspec(dllexport)
322 # define ZEXTERN extern __declspec(dllimport)
325 # endif /* ZLIB_DLL */
326 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
327 * define ZLIB_WINAPI.
328 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
334 # include <windows.h>
335 /* No need for _export, use ZLIB.DEF instead. */
336 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
337 # define ZEXPORT WINAPI
339 # define ZEXPORTVA WINAPIV
341 # define ZEXPORTVA FAR CDECL
346 #if defined (__BEOS__)
348 # ifdef ZLIB_INTERNAL
349 # define ZEXPORT __declspec(dllexport)
350 # define ZEXPORTVA __declspec(dllexport)
352 # define ZEXPORT __declspec(dllimport)
353 # define ZEXPORTVA __declspec(dllimport)
359 # define ZEXTERN extern
372 #if !defined(__MACTYPES__)
373 typedef unsigned char Byte; /* 8 bits */
375 typedef unsigned int uInt; /* 16 bits or more */
376 typedef unsigned long uLong; /* 32 bits or more */
379 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
380 # define Bytef Byte FAR
382 typedef Byte FAR Bytef;
384 typedef char FAR charf;
385 typedef int FAR intf;
386 typedef uInt FAR uIntf;
387 typedef uLong FAR uLongf;
390 typedef void const *voidpc;
391 typedef void FAR *voidpf;
394 typedef Byte const *voidpc;
395 typedef Byte FAR *voidpf;
399 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
400 # define Z_HAVE_UNISTD_H
403 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
404 # define Z_HAVE_STDARG_H
409 # include <sys/types.h> /* for off_t */
413 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
414 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
415 * though the former does not conform to the LFS document), but considering
416 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
417 * equivalently requesting no 64-bit operations
419 #if -_LARGEFILE64_SOURCE - -1 == 1
420 # undef _LARGEFILE64_SOURCE
423 #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
427 #if (defined(Z_HAVE_UNISTD_H) || defined(Z_LARGE)) && !defined(Z_SOLO)
428 # include <unistd.h> /* for SEEK_* and off_t */
430 # include <unixio.h> /* for off_t */
433 # define z_off_t off_t
437 #if !defined(SEEK_SET) && !defined(Z_SOLO)
438 # define SEEK_SET 0 /* Seek from beginning of file. */
439 # define SEEK_CUR 1 /* Seek from current position. */
440 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
444 # define z_off_t long
447 #if !defined(_WIN32) && (defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0)
448 # define z_off64_t off64_t
451 # define z_off64_t __int64
453 # define z_off64_t z_off_t
457 /* MVS linker does not support external names larger than 8 bytes */
459 #pragma map(deflateInit_,"DEIN")
460 #pragma map(deflateInit2_,"DEIN2")
461 #pragma map(deflateEnd,"DEEND")
462 #pragma map(deflateBound,"DEBND")
463 #pragma map(inflateInit_,"ININ")
464 #pragma map(inflateInit2_,"ININ2")
465 #pragma map(inflateEnd,"INEND")
466 #pragma map(inflateSync,"INSY")
467 #pragma map(inflateSetDictionary,"INSEDI")
468 #pragma map(compressBound,"CMBND")
469 #pragma map(inflate_table,"INTABL")
470 #pragma map(inflate_fast,"INFA")
471 #pragma map(inflate_copyright,"INCOPY")