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_strwinerror z_gz_strwinerror
52 # define gzbuffer z_gzbuffer
53 # define gzclearerr z_gzclearerr
54 # define gzclose z_gzclose
55 # define gzclose_r z_gzclose_r
56 # define gzclose_w z_gzclose_w
57 # define gzdirect z_gzdirect
58 # define gzdopen z_gzdopen
59 # define gzeof z_gzeof
60 # define gzerror z_gzerror
61 # define gzflush z_gzflush
62 # define gzgetc z_gzgetc
63 # define gzgets z_gzgets
64 # define gzoffset z_gzoffset
65 # define gzoffset64 z_gzoffset64
66 # define gzopen z_gzopen
67 # define gzopen64 z_gzopen64
68 # define gzprintf z_gzprintf
69 # define gzputc z_gzputc
70 # define gzputs z_gzputs
71 # define gzread z_gzread
72 # define gzrewind z_gzrewind
73 # define gzseek z_gzseek
74 # define gzseek64 z_gzseek64
75 # define gzsetparams z_gzsetparams
76 # define gztell z_gztell
77 # define gztell64 z_gztell64
78 # define gzungetc z_gzungetc
79 # define gzwrite z_gzwrite
80 # define inflate z_inflate
81 # define inflateBack z_inflateBack
82 # define inflateBackEnd z_inflateBackEnd
83 # define inflateBackInit_ z_inflateBackInit_
84 # define inflateCopy z_inflateCopy
85 # define inflateEnd z_inflateEnd
86 # define inflateGetHeader z_inflateGetHeader
87 # define inflateInit2_ z_inflateInit2_
88 # define inflateInit_ z_inflateInit_
89 # define inflateMark z_inflateMark
90 # define inflatePrime z_inflatePrime
91 # define inflateReset z_inflateReset
92 # define inflateReset2 z_inflateReset2
93 # define inflateSetDictionary z_inflateSetDictionary
94 # define inflateSync z_inflateSync
95 # define inflateSyncPoint z_inflateSyncPoint
96 # define inflateUndermine z_inflateUndermine
97 # define inflate_copyright z_inflate_copyright
98 # define inflate_fast z_inflate_fast
99 # define inflate_table z_inflate_table
100 # define uncompress z_uncompress
101 # define zError z_zError
102 # define zcalloc z_zcalloc
103 # define zcfree z_zcfree
104 # define zlibCompileFlags z_zlibCompileFlags
105 # define zlibVersion z_zlibVersion
107 /* all zlib typedefs in zlib.h and zconf.h */
109 # define Bytef z_Bytef
110 # define alloc_func z_alloc_func
111 # define charf z_charf
112 # define free_func z_free_func
113 # define gzFile z_gzFile
114 # define gz_header z_gz_header
115 # define gz_headerp z_gz_headerp
116 # define in_func z_in_func
118 # define out_func z_out_func
120 # define uIntf z_uIntf
121 # define uLong z_uLong
122 # define uLongf z_uLongf
123 # define voidp z_voidp
124 # define voidpc z_voidpc
125 # define voidpf z_voidpf
127 /* all zlib structs in zlib.h and zconf.h */
128 # define gz_header_s z_gz_header_s
129 # define internal_state z_internal_state
133 #if defined(__MSDOS__) && !defined(MSDOS)
136 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
139 #if defined(_WINDOWS) && !defined(WINDOWS)
142 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
147 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
148 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
156 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
157 * than 64k bytes at a time (needed on systems with 16-bit int).
163 # define UNALIGNED_OK
166 #ifdef __STDC_VERSION__
170 # if __STDC_VERSION__ >= 199901L
176 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
179 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
182 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
185 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
189 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
194 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
195 # define const /* note: need a more gentle solution here */
199 /* Some Mac compilers merge all .h files incorrectly: */
200 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
201 # define NO_DUMMY_DECL
204 /* Maximum value for memLevel in deflateInit2 */
205 #ifndef MAX_MEM_LEVEL
207 # define MAX_MEM_LEVEL 8
209 # define MAX_MEM_LEVEL 9
213 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
214 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
215 * created by gzip. (Files created by minigzip can still be extracted by
219 # define MAX_WBITS 15 /* 32K LZ77 window */
222 /* The memory requirements for deflate are (in bytes):
223 (1 << (windowBits+2)) + (1 << (memLevel+9))
224 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
225 plus a few kilobytes for small objects. For example, if you want to reduce
226 the default memory requirements from 256K to 128K, compile with
227 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
228 Of course this will generally degrade compression (there's no free lunch).
230 The memory requirements for inflate are (in bytes) 1 << windowBits
231 that is, 32K for windowBits=15 (default value) plus a few kilobytes
235 /* Type declarations */
237 #ifndef OF /* function prototypes */
239 # define OF(args) args
245 /* The following definitions for FAR are needed only for MSDOS mixed
246 * model programming (small or medium model with some far allocations).
247 * This was tested only with MSC; for other MSDOS compilers you may have
248 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
249 * just define FAR to be empty.
252 # if defined(M_I86SM) || defined(M_I86MM)
253 /* MSC small or medium model */
254 # define SMALL_MEDIUM
261 # if (defined(__SMALL__) || defined(__MEDIUM__))
262 /* Turbo C small or medium model */
263 # define SMALL_MEDIUM
272 #if defined(WINDOWS) || defined(WIN32)
273 /* If building or using zlib as a DLL, define ZLIB_DLL.
274 * This is not mandatory, but it offers a little performance increase.
277 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
278 # ifdef ZLIB_INTERNAL
279 # define ZEXTERN extern __declspec(dllexport)
281 # define ZEXTERN extern __declspec(dllimport)
284 # endif /* ZLIB_DLL */
285 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
286 * define ZLIB_WINAPI.
287 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
293 # include <windows.h>
294 /* No need for _export, use ZLIB.DEF instead. */
295 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
296 # define ZEXPORT WINAPI
298 # define ZEXPORTVA WINAPIV
300 # define ZEXPORTVA FAR CDECL
305 #if defined (__BEOS__)
307 # ifdef ZLIB_INTERNAL
308 # define ZEXPORT __declspec(dllexport)
309 # define ZEXPORTVA __declspec(dllexport)
311 # define ZEXPORT __declspec(dllimport)
312 # define ZEXPORTVA __declspec(dllimport)
317 #ifdef HAVE_VISIBILITY_PRAGMA
318 # define ZEXTERN __attribute__((visibility ("default"))) extern
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;
362 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
363 # include <sys/types.h> /* for off_t */
364 # include <unistd.h> /* for SEEK_* and off_t */
366 # include <unixio.h> /* for off_t */
369 # define z_off_t off_t
373 #ifdef _LARGEFILE64_SOURCE
374 # include <sys/types.h>
378 # define SEEK_SET 0 /* Seek from beginning of file. */
379 # define SEEK_CUR 1 /* Seek from current position. */
380 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
383 # define z_off_t long
386 #if defined(__OS400__)
387 # define NO_vsnprintf
391 # define NO_vsnprintf
394 /* MVS linker does not support external names larger than 8 bytes */
396 #pragma map(deflateInit_,"DEIN")
397 #pragma map(deflateInit2_,"DEIN2")
398 #pragma map(deflateEnd,"DEEND")
399 #pragma map(deflateBound,"DEBND")
400 #pragma map(inflateInit_,"ININ")
401 #pragma map(inflateInit2_,"ININ2")
402 #pragma map(inflateEnd,"INEND")
403 #pragma map(inflateSync,"INSY")
404 #pragma map(inflateSetDictionary,"INSEDI")
405 #pragma map(compressBound,"CMBND")
406 #pragma map(inflate_table,"INTABL")
407 #pragma map(inflate_fast,"INFA")
408 #pragma map(inflate_copyright,"INCOPY")