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
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 adler32_combine64 z_adler32_combine64
30 # define compress z_compress
31 # define compress2 z_compress2
32 # define compressBound z_compressBound
33 # define crc32 z_crc32
34 # define crc32_combine z_crc32_combine
35 # define crc32_combine64 z_crc32_combine64
36 # define deflate z_deflate
37 # define deflateBound z_deflateBound
38 # define deflateCopy z_deflateCopy
39 # define deflateEnd z_deflateEnd
40 # define deflateInit2_ z_deflateInit2_
41 # define deflateInit_ z_deflateInit_
42 # define deflateParams z_deflateParams
43 # define deflatePrime z_deflatePrime
44 # define deflateReset z_deflateReset
45 # define deflateSetDictionary z_deflateSetDictionary
46 # define deflateSetHeader z_deflateSetHeader
47 # define deflateTune z_deflateTune
48 # define deflate_copyright z_deflate_copyright
49 # define get_crc_table z_get_crc_table
50 # define gz_error z_gz_error
51 # define gz_intmax z_gz_intmax
52 # define gz_strwinerror z_gz_strwinerror
53 # define gzbuffer z_gzbuffer
54 # define gzclearerr z_gzclearerr
55 # define gzclose z_gzclose
56 # define gzclose_r z_gzclose_r
57 # define gzclose_w z_gzclose_w
58 # define gzdirect z_gzdirect
59 # define gzdopen z_gzdopen
60 # define gzeof z_gzeof
61 # define gzerror z_gzerror
62 # define gzflush z_gzflush
63 # define gzgetc z_gzgetc
64 # define gzgets z_gzgets
65 # define gzoffset z_gzoffset
66 # define gzoffset64 z_gzoffset64
67 # define gzopen z_gzopen
68 # define gzopen64 z_gzopen64
69 # define gzprintf z_gzprintf
70 # define gzputc z_gzputc
71 # define gzputs z_gzputs
72 # define gzread z_gzread
73 # define gzrewind z_gzrewind
74 # define gzseek z_gzseek
75 # define gzseek64 z_gzseek64
76 # define gzsetparams z_gzsetparams
77 # define gztell z_gztell
78 # define gztell64 z_gztell64
79 # define gzungetc z_gzungetc
80 # define gzwrite z_gzwrite
81 # define inflate z_inflate
82 # define inflateBack z_inflateBack
83 # define inflateBackEnd z_inflateBackEnd
84 # define inflateBackInit_ z_inflateBackInit_
85 # define inflateCopy z_inflateCopy
86 # define inflateEnd z_inflateEnd
87 # define inflateGetHeader z_inflateGetHeader
88 # define inflateInit2_ z_inflateInit2_
89 # define inflateInit_ z_inflateInit_
90 # define inflateMark z_inflateMark
91 # define inflatePrime z_inflatePrime
92 # define inflateReset z_inflateReset
93 # define inflateReset2 z_inflateReset2
94 # define inflateSetDictionary z_inflateSetDictionary
95 # define inflateSync z_inflateSync
96 # define inflateSyncPoint z_inflateSyncPoint
97 # define inflateUndermine z_inflateUndermine
98 # define inflate_copyright z_inflate_copyright
99 # define inflate_fast z_inflate_fast
100 # define inflate_table z_inflate_table
101 # define uncompress z_uncompress
102 # define zError z_zError
103 # define zcalloc z_zcalloc
104 # define zcfree z_zcfree
105 # define zlibCompileFlags z_zlibCompileFlags
106 # define zlibVersion z_zlibVersion
108 /* all zlib typedefs in zlib.h and zconf.h */
110 # define Bytef z_Bytef
111 # define alloc_func z_alloc_func
112 # define charf z_charf
113 # define free_func z_free_func
114 # define gzFile z_gzFile
115 # define gz_header z_gz_header
116 # define gz_headerp z_gz_headerp
117 # define in_func z_in_func
119 # define out_func z_out_func
121 # define uIntf z_uIntf
122 # define uLong z_uLong
123 # define uLongf z_uLongf
124 # define voidp z_voidp
125 # define voidpc z_voidpc
126 # define voidpf z_voidpf
128 /* all zlib structs in zlib.h and zconf.h */
129 # define gz_header_s z_gz_header_s
130 # define internal_state z_internal_state
134 #if defined(__MSDOS__) && !defined(MSDOS)
137 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
140 #if defined(_WINDOWS) && !defined(WINDOWS)
143 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
148 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
149 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
157 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
158 * than 64k bytes at a time (needed on systems with 16-bit int).
164 # define UNALIGNED_OK
167 #ifdef __STDC_VERSION__
171 # if __STDC_VERSION__ >= 199901L
177 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
180 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
183 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
186 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
190 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
195 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
196 # define const /* note: need a more gentle solution here */
200 /* Some Mac compilers merge all .h files incorrectly: */
201 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
202 # define NO_DUMMY_DECL
205 /* Maximum value for memLevel in deflateInit2 */
206 #ifndef MAX_MEM_LEVEL
208 # define MAX_MEM_LEVEL 8
210 # define MAX_MEM_LEVEL 9
214 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
215 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
216 * created by gzip. (Files created by minigzip can still be extracted by
220 # define MAX_WBITS 15 /* 32K LZ77 window */
223 /* The memory requirements for deflate are (in bytes):
224 (1 << (windowBits+2)) + (1 << (memLevel+9))
225 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
226 plus a few kilobytes for small objects. For example, if you want to reduce
227 the default memory requirements from 256K to 128K, compile with
228 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
229 Of course this will generally degrade compression (there's no free lunch).
231 The memory requirements for inflate are (in bytes) 1 << windowBits
232 that is, 32K for windowBits=15 (default value) plus a few kilobytes
236 /* Type declarations */
238 #ifndef OF /* function prototypes */
240 # define OF(args) args
246 /* The following definitions for FAR are needed only for MSDOS mixed
247 * model programming (small or medium model with some far allocations).
248 * This was tested only with MSC; for other MSDOS compilers you may have
249 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
250 * just define FAR to be empty.
253 # if defined(M_I86SM) || defined(M_I86MM)
254 /* MSC small or medium model */
255 # define SMALL_MEDIUM
262 # if (defined(__SMALL__) || defined(__MEDIUM__))
263 /* Turbo C small or medium model */
264 # define SMALL_MEDIUM
273 #if defined(WINDOWS) || defined(WIN32)
274 /* If building or using zlib as a DLL, define ZLIB_DLL.
275 * This is not mandatory, but it offers a little performance increase.
278 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
279 # ifdef ZLIB_INTERNAL
280 # define ZEXTERN extern __declspec(dllexport)
282 # define ZEXTERN extern __declspec(dllimport)
285 # endif /* ZLIB_DLL */
286 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
287 * define ZLIB_WINAPI.
288 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
294 # include <windows.h>
295 /* No need for _export, use ZLIB.DEF instead. */
296 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
297 # define ZEXPORT WINAPI
299 # define ZEXPORTVA WINAPIV
301 # define ZEXPORTVA FAR CDECL
306 #if defined (__BEOS__)
308 # ifdef ZLIB_INTERNAL
309 # define ZEXPORT __declspec(dllexport)
310 # define ZEXPORTVA __declspec(dllexport)
312 # define ZEXPORT __declspec(dllimport)
313 # define ZEXPORTVA __declspec(dllimport)
319 # define ZEXTERN extern
332 #if !defined(__MACTYPES__)
333 typedef unsigned char Byte
; /* 8 bits */
335 typedef unsigned int uInt
; /* 16 bits or more */
336 typedef unsigned long uLong
; /* 32 bits or more */
339 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
340 # define Bytef Byte FAR
342 typedef Byte FAR Bytef
;
344 typedef char FAR charf
;
345 typedef int FAR intf
;
346 typedef uInt FAR uIntf
;
347 typedef uLong FAR uLongf
;
350 typedef void const *voidpc
;
351 typedef void FAR
*voidpf
;
354 typedef Byte
const *voidpc
;
355 typedef Byte FAR
*voidpf
;
359 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
360 # define Z_HAVE_UNISTD_H
364 # include <sys/types.h> /* for off_t */
367 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
368 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
369 * though the former does not conform to the LFS document), but considering
370 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
371 * equivalently requesting no 64-bit operations
373 #if -_LARGEFILE64_SOURCE - -1 == 1
374 # undef _LARGEFILE64_SOURCE
377 #if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
378 # include <unistd.h> /* for SEEK_* and off_t */
380 # include <unixio.h> /* for off_t */
383 # define z_off_t off_t
388 # define SEEK_SET 0 /* Seek from beginning of file. */
389 # define SEEK_CUR 1 /* Seek from current position. */
390 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
394 # define z_off_t long
397 #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
398 # define z_off64_t off64_t
400 # define z_off64_t z_off_t
403 #if defined(__OS400__)
404 # define NO_vsnprintf
408 # define NO_vsnprintf
411 /* MVS linker does not support external names larger than 8 bytes */
413 #pragma map(deflateInit_,"DEIN")
414 #pragma map(deflateInit2_,"DEIN2")
415 #pragma map(deflateEnd,"DEEND")
416 #pragma map(deflateBound,"DEBND")
417 #pragma map(inflateInit_,"ININ")
418 #pragma map(inflateInit2_,"ININ2")
419 #pragma map(inflateEnd,"INEND")
420 #pragma map(inflateSync,"INSY")
421 #pragma map(inflateSetDictionary,"INSEDI")
422 #pragma map(compressBound,"CMBND")
423 #pragma map(inflate_table,"INTABL")
424 #pragma map(inflate_fast,"INFA")
425 #pragma map(inflate_copyright,"INCOPY")