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
32 # define compress z_compress
33 # define compress2 z_compress2
34 # 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 deflatePending z_deflatePending
47 # define deflatePrime z_deflatePrime
48 # define deflateReset z_deflateReset
49 # define deflateSetDictionary z_deflateSetDictionary
50 # define deflateSetHeader z_deflateSetHeader
51 # define deflateTune z_deflateTune
52 # define deflate_copyright z_deflate_copyright
53 # define get_crc_table z_get_crc_table
55 # define gz_error z_gz_error
56 # define gz_intmax z_gz_intmax
57 # define gz_strwinerror z_gz_strwinerror
58 # define gzbuffer z_gzbuffer
59 # define gzclearerr z_gzclearerr
60 # define gzclose z_gzclose
61 # define gzclose_r z_gzclose_r
62 # define gzclose_w z_gzclose_w
63 # define gzdirect z_gzdirect
64 # define gzdopen z_gzdopen
65 # define gzeof z_gzeof
66 # define gzerror z_gzerror
67 # define gzflags z_gzflags
68 # define gzflush z_gzflush
69 # define gzgetc z_gzgetc
70 # define gzgetc_ z_gzgetc_
71 # define gzgets z_gzgets
72 # define gzoffset z_gzoffset
73 # define gzoffset64 z_gzoffset64
74 # define gzopen z_gzopen
75 # define gzopen64 z_gzopen64
76 # define gzprintf z_gzprintf
77 # define gzputc z_gzputc
78 # define gzputs z_gzputs
79 # define gzread z_gzread
80 # define gzrewind z_gzrewind
81 # define gzseek z_gzseek
82 # define gzseek64 z_gzseek64
83 # define gzsetparams z_gzsetparams
84 # define gztell z_gztell
85 # define gztell64 z_gztell64
86 # define gzungetc z_gzungetc
87 # define gzwrite z_gzwrite
89 # define inflate z_inflate
90 # define inflateBack z_inflateBack
91 # define inflateBackEnd z_inflateBackEnd
92 # define inflateBackInit_ z_inflateBackInit_
93 # define inflateCopy z_inflateCopy
94 # define inflateEnd z_inflateEnd
95 # define inflateGetHeader z_inflateGetHeader
96 # define inflateInit2_ z_inflateInit2_
97 # define inflateInit_ z_inflateInit_
98 # define inflateMark z_inflateMark
99 # define inflatePrime z_inflatePrime
100 # define inflateReset z_inflateReset
101 # define inflateReset2 z_inflateReset2
102 # define inflateSetDictionary z_inflateSetDictionary
103 # define inflateSync z_inflateSync
104 # define inflateSyncPoint z_inflateSyncPoint
105 # define inflateUndermine z_inflateUndermine
106 # define inflateResetKeep z_inflateResetKeep
107 # define inflate_copyright z_inflate_copyright
108 # define inflate_fast z_inflate_fast
109 # define inflate_table z_inflate_table
111 # define uncompress z_uncompress
113 # define zError z_zError
115 # define zcalloc z_zcalloc
116 # define zcfree z_zcfree
118 # define zlibCompileFlags z_zlibCompileFlags
119 # define zlibVersion z_zlibVersion
121 /* all zlib typedefs in zlib.h and zconf.h */
123 # define Bytef z_Bytef
124 # define alloc_func z_alloc_func
125 # define charf z_charf
126 # define free_func z_free_func
128 # define gzFile z_gzFile
129 # define gz_header z_gz_header
130 # define gz_headerp z_gz_headerp
132 # define in_func z_in_func
134 # define out_func z_out_func
136 # define uIntf z_uIntf
137 # define uLong z_uLong
138 # define uLongf z_uLongf
139 # define voidp z_voidp
140 # define voidpc z_voidpc
141 # define voidpf z_voidpf
143 /* all zlib structs in zlib.h and zconf.h */
145 # define gz_header_s z_gz_header_s
147 # define internal_state z_internal_state
151 #if defined(__MSDOS__) && !defined(MSDOS)
154 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
157 #if defined(_WINDOWS) && !defined(WINDOWS)
160 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
165 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
166 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
174 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
175 * than 64k bytes at a time (needed on systems with 16-bit int).
181 # define UNALIGNED_OK
184 #ifdef __STDC_VERSION__
188 # if __STDC_VERSION__ >= 199901L
194 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
197 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
200 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
203 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
207 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
212 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
213 # define const /* note: need a more gentle solution here */
217 /* Some Mac compilers merge all .h files incorrectly: */
218 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
219 # define NO_DUMMY_DECL
222 /* Maximum value for memLevel in deflateInit2 */
223 #ifndef MAX_MEM_LEVEL
225 # define MAX_MEM_LEVEL 8
227 # define MAX_MEM_LEVEL 9
231 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
232 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
233 * created by gzip. (Files created by minigzip can still be extracted by
237 # define MAX_WBITS 15 /* 32K LZ77 window */
240 /* The memory requirements for deflate are (in bytes):
241 (1 << (windowBits+2)) + (1 << (memLevel+9))
242 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
243 plus a few kilobytes for small objects. For example, if you want to reduce
244 the default memory requirements from 256K to 128K, compile with
245 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
246 Of course this will generally degrade compression (there's no free lunch).
248 The memory requirements for inflate are (in bytes) 1 << windowBits
249 that is, 32K for windowBits=15 (default value) plus a few kilobytes
253 /* Type declarations */
255 #ifndef OF /* function prototypes */
257 # define OF(args) args
263 #ifndef ON /* function prototypes for stdarg */
264 # if defined(STDC) || defined(Z_HAVE_STDARG_H)
265 # define ON(args) args
271 /* The following definitions for FAR are needed only for MSDOS mixed
272 * model programming (small or medium model with some far allocations).
273 * This was tested only with MSC; for other MSDOS compilers you may have
274 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
275 * just define FAR to be empty.
278 # if defined(M_I86SM) || defined(M_I86MM)
279 /* MSC small or medium model */
280 # define SMALL_MEDIUM
287 # if (defined(__SMALL__) || defined(__MEDIUM__))
288 /* Turbo C small or medium model */
289 # define SMALL_MEDIUM
298 #if defined(WINDOWS) || defined(WIN32)
299 /* If building or using zlib as a DLL, define ZLIB_DLL.
300 * This is not mandatory, but it offers a little performance increase.
303 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
304 # ifdef ZLIB_INTERNAL
305 # define ZEXTERN extern __declspec(dllexport)
307 # define ZEXTERN extern __declspec(dllimport)
310 # endif /* ZLIB_DLL */
311 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
312 * define ZLIB_WINAPI.
313 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
319 # include <windows.h>
320 /* No need for _export, use ZLIB.DEF instead. */
321 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
322 # define ZEXPORT WINAPI
324 # define ZEXPORTVA WINAPIV
326 # define ZEXPORTVA FAR CDECL
331 #if defined (__BEOS__)
333 # ifdef ZLIB_INTERNAL
334 # define ZEXPORT __declspec(dllexport)
335 # define ZEXPORTVA __declspec(dllexport)
337 # define ZEXPORT __declspec(dllimport)
338 # define ZEXPORTVA __declspec(dllimport)
344 # define ZEXTERN extern
357 #if !defined(__MACTYPES__)
358 typedef unsigned char Byte; /* 8 bits */
360 typedef unsigned int uInt; /* 16 bits or more */
361 typedef unsigned long uLong; /* 32 bits or more */
364 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
365 # define Bytef Byte FAR
367 typedef Byte FAR Bytef;
369 typedef char FAR charf;
370 typedef int FAR intf;
371 typedef uInt FAR uIntf;
372 typedef uLong FAR uLongf;
375 typedef void const *voidpc;
376 typedef void FAR *voidpf;
379 typedef Byte const *voidpc;
380 typedef Byte FAR *voidpf;
384 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
385 # define Z_HAVE_UNISTD_H
388 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
389 # define Z_HAVE_STDARG_H
394 # include <sys/types.h> /* for off_t */
398 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
399 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
400 * though the former does not conform to the LFS document), but considering
401 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
402 * equivalently requesting no 64-bit operations
404 #if -_LARGEFILE64_SOURCE - -1 == 1
405 # undef _LARGEFILE64_SOURCE
408 #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
412 #if (defined(Z_HAVE_UNISTD_H) || defined(Z_LARGE)) && !defined(Z_SOLO)
413 # include <unistd.h> /* for SEEK_* and off_t */
415 # include <unixio.h> /* for off_t */
418 # define z_off_t off_t
422 #if !defined(SEEK_SET) && !defined(Z_SOLO)
423 # define SEEK_SET 0 /* Seek from beginning of file. */
424 # define SEEK_CUR 1 /* Seek from current position. */
425 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
429 # define z_off_t long
432 #if !defined(_WIN32) && (defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0)
433 # define z_off64_t off64_t
436 # define z_off64_t __int64
438 # define z_off64_t z_off_t
442 /* MVS linker does not support external names larger than 8 bytes */
444 #pragma map(deflateInit_,"DEIN")
445 #pragma map(deflateInit2_,"DEIN2")
446 #pragma map(deflateEnd,"DEEND")
447 #pragma map(deflateBound,"DEBND")
448 #pragma map(inflateInit_,"ININ")
449 #pragma map(inflateInit2_,"ININ2")
450 #pragma map(inflateEnd,"INEND")
451 #pragma map(inflateSync,"INSY")
452 #pragma map(inflateSetDictionary,"INSEDI")
453 #pragma map(compressBound,"CMBND")
454 #pragma map(inflate_table,"INTABL")
455 #pragma map(inflate_fast,"INFA")
456 #pragma map(inflate_copyright,"INCOPY")