7812
|
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
|
|
4 |
*/
|
|
5 |
|
|
6 |
/* @(#) $Id$ */
|
|
7 |
|
|
8 |
#ifndef ZCONF_H
|
|
9 |
#define ZCONF_H
|
|
10 |
|
|
11 |
/*
|
|
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".
|
|
16 |
*/
|
|
17 |
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
|
|
18 |
|
|
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
|
|
107 |
|
|
108 |
/* all zlib typedefs in zlib.h and zconf.h */
|
|
109 |
# define Byte z_Byte
|
|
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
|
|
118 |
# define intf z_intf
|
|
119 |
# define out_func z_out_func
|
|
120 |
# define uInt z_uInt
|
|
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
|
|
127 |
|
|
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
|
|
131 |
|
|
132 |
#endif
|
|
133 |
|
|
134 |
#if defined(__MSDOS__) && !defined(MSDOS)
|
|
135 |
# define MSDOS
|
|
136 |
#endif
|
|
137 |
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
|
|
138 |
# define OS2
|
|
139 |
#endif
|
|
140 |
#if defined(_WINDOWS) && !defined(WINDOWS)
|
|
141 |
# define WINDOWS
|
|
142 |
#endif
|
|
143 |
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
|
|
144 |
# ifndef WIN32
|
|
145 |
# define WIN32
|
|
146 |
# endif
|
|
147 |
#endif
|
|
148 |
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
|
|
149 |
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
|
|
150 |
# ifndef SYS16BIT
|
|
151 |
# define SYS16BIT
|
|
152 |
# endif
|
|
153 |
# endif
|
|
154 |
#endif
|
|
155 |
|
|
156 |
/*
|
|
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).
|
|
159 |
*/
|
|
160 |
#ifdef SYS16BIT
|
|
161 |
# define MAXSEG_64K
|
|
162 |
#endif
|
|
163 |
#ifdef MSDOS
|
|
164 |
# define UNALIGNED_OK
|
|
165 |
#endif
|
|
166 |
|
|
167 |
#ifdef __STDC_VERSION__
|
|
168 |
# ifndef STDC
|
|
169 |
# define STDC
|
|
170 |
# endif
|
|
171 |
# if __STDC_VERSION__ >= 199901L
|
|
172 |
# ifndef STDC99
|
|
173 |
# define STDC99
|
|
174 |
# endif
|
|
175 |
# endif
|
|
176 |
#endif
|
|
177 |
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
|
|
178 |
# define STDC
|
|
179 |
#endif
|
|
180 |
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
|
|
181 |
# define STDC
|
|
182 |
#endif
|
|
183 |
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
|
|
184 |
# define STDC
|
|
185 |
#endif
|
|
186 |
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
|
|
187 |
# define STDC
|
|
188 |
#endif
|
|
189 |
|
|
190 |
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
|
|
191 |
# define STDC
|
|
192 |
#endif
|
|
193 |
|
|
194 |
#ifndef STDC
|
|
195 |
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
|
|
196 |
# define const /* note: need a more gentle solution here */
|
|
197 |
# endif
|
|
198 |
#endif
|
|
199 |
|
|
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
|
|
203 |
#endif
|
|
204 |
|
|
205 |
/* Maximum value for memLevel in deflateInit2 */
|
|
206 |
#ifndef MAX_MEM_LEVEL
|
|
207 |
# ifdef MAXSEG_64K
|
|
208 |
# define MAX_MEM_LEVEL 8
|
|
209 |
# else
|
|
210 |
# define MAX_MEM_LEVEL 9
|
|
211 |
# endif
|
|
212 |
#endif
|
|
213 |
|
|
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
|
|
217 |
* gzip.)
|
|
218 |
*/
|
|
219 |
#ifndef MAX_WBITS
|
|
220 |
# define MAX_WBITS 15 /* 32K LZ77 window */
|
|
221 |
#endif
|
|
222 |
|
|
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).
|
|
230 |
|
|
231 |
The memory requirements for inflate are (in bytes) 1 << windowBits
|
|
232 |
that is, 32K for windowBits=15 (default value) plus a few kilobytes
|
|
233 |
for small objects.
|
|
234 |
*/
|
|
235 |
|
|
236 |
/* Type declarations */
|
|
237 |
|
|
238 |
#ifndef OF /* function prototypes */
|
|
239 |
# ifdef STDC
|
|
240 |
# define OF(args) args
|
|
241 |
# else
|
|
242 |
# define OF(args) ()
|
|
243 |
# endif
|
|
244 |
#endif
|
|
245 |
|
|
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.
|
|
251 |
*/
|
|
252 |
#ifdef SYS16BIT
|
|
253 |
# if defined(M_I86SM) || defined(M_I86MM)
|
|
254 |
/* MSC small or medium model */
|
|
255 |
# define SMALL_MEDIUM
|
|
256 |
# ifdef _MSC_VER
|
|
257 |
# define FAR _far
|
|
258 |
# else
|
|
259 |
# define FAR far
|
|
260 |
# endif
|
|
261 |
# endif
|
|
262 |
# if (defined(__SMALL__) || defined(__MEDIUM__))
|
|
263 |
/* Turbo C small or medium model */
|
|
264 |
# define SMALL_MEDIUM
|
|
265 |
# ifdef __BORLANDC__
|
|
266 |
# define FAR _far
|
|
267 |
# else
|
|
268 |
# define FAR far
|
|
269 |
# endif
|
|
270 |
# endif
|
|
271 |
#endif
|
|
272 |
|
|
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.
|
|
276 |
*/
|
|
277 |
# ifdef ZLIB_DLL
|
|
278 |
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
|
|
279 |
# ifdef ZLIB_INTERNAL
|
|
280 |
# define ZEXTERN extern __declspec(dllexport)
|
|
281 |
# else
|
|
282 |
# define ZEXTERN extern __declspec(dllimport)
|
|
283 |
# endif
|
|
284 |
# endif
|
|
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.
|
|
289 |
*/
|
|
290 |
# ifdef ZLIB_WINAPI
|
|
291 |
# ifdef FAR
|
|
292 |
# undef FAR
|
|
293 |
# endif
|
|
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
|
|
298 |
# ifdef WIN32
|
|
299 |
# define ZEXPORTVA WINAPIV
|
|
300 |
# else
|
|
301 |
# define ZEXPORTVA FAR CDECL
|
|
302 |
# endif
|
|
303 |
# endif
|
|
304 |
#endif
|
|
305 |
|
|
306 |
#if defined (__BEOS__)
|
|
307 |
# ifdef ZLIB_DLL
|
|
308 |
# ifdef ZLIB_INTERNAL
|
|
309 |
# define ZEXPORT __declspec(dllexport)
|
|
310 |
# define ZEXPORTVA __declspec(dllexport)
|
|
311 |
# else
|
|
312 |
# define ZEXPORT __declspec(dllimport)
|
|
313 |
# define ZEXPORTVA __declspec(dllimport)
|
|
314 |
# endif
|
|
315 |
# endif
|
|
316 |
#endif
|
|
317 |
|
|
318 |
#ifndef ZEXTERN
|
|
319 |
# define ZEXTERN extern
|
|
320 |
#endif
|
|
321 |
#ifndef ZEXPORT
|
|
322 |
# define ZEXPORT
|
|
323 |
#endif
|
|
324 |
#ifndef ZEXPORTVA
|
|
325 |
# define ZEXPORTVA
|
|
326 |
#endif
|
|
327 |
|
|
328 |
#ifndef FAR
|
|
329 |
# define FAR
|
|
330 |
#endif
|
|
331 |
|
|
332 |
#if !defined(__MACTYPES__)
|
|
333 |
typedef unsigned char Byte; /* 8 bits */
|
|
334 |
#endif
|
|
335 |
typedef unsigned int uInt; /* 16 bits or more */
|
|
336 |
typedef unsigned long uLong; /* 32 bits or more */
|
|
337 |
|
|
338 |
#ifdef SMALL_MEDIUM
|
|
339 |
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
|
|
340 |
# define Bytef Byte FAR
|
|
341 |
#else
|
|
342 |
typedef Byte FAR Bytef;
|
|
343 |
#endif
|
|
344 |
typedef char FAR charf;
|
|
345 |
typedef int FAR intf;
|
|
346 |
typedef uInt FAR uIntf;
|
|
347 |
typedef uLong FAR uLongf;
|
|
348 |
|
|
349 |
#ifdef STDC
|
|
350 |
typedef void const *voidpc;
|
|
351 |
typedef void FAR *voidpf;
|
|
352 |
typedef void *voidp;
|
|
353 |
#else
|
|
354 |
typedef Byte const *voidpc;
|
|
355 |
typedef Byte FAR *voidpf;
|
|
356 |
typedef Byte *voidp;
|
|
357 |
#endif
|
|
358 |
|
|
359 |
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
|
360 |
# define Z_HAVE_UNISTD_H
|
|
361 |
#endif
|
|
362 |
|
|
363 |
#ifdef STDC
|
|
364 |
# include <sys/types.h> /* for off_t */
|
|
365 |
#endif
|
|
366 |
|
|
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
|
|
372 |
*/
|
|
373 |
#if -_LARGEFILE64_SOURCE - -1 == 1
|
|
374 |
# undef _LARGEFILE64_SOURCE
|
|
375 |
#endif
|
|
376 |
|
|
377 |
#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
|
|
378 |
# include <unistd.h> /* for SEEK_* and off_t */
|
|
379 |
# ifdef VMS
|
|
380 |
# include <unixio.h> /* for off_t */
|
|
381 |
# endif
|
|
382 |
# ifndef z_off_t
|
|
383 |
# define z_off_t off_t
|
|
384 |
# endif
|
|
385 |
#endif
|
|
386 |
|
|
387 |
#ifndef SEEK_SET
|
|
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" */
|
|
391 |
#endif
|
|
392 |
|
|
393 |
#ifndef z_off_t
|
|
394 |
# define z_off_t long
|
|
395 |
#endif
|
|
396 |
|
|
397 |
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
|
|
398 |
# define z_off64_t off64_t
|
|
399 |
#else
|
|
400 |
# define z_off64_t z_off_t
|
|
401 |
#endif
|
|
402 |
|
|
403 |
#if defined(__OS400__)
|
|
404 |
# define NO_vsnprintf
|
|
405 |
#endif
|
|
406 |
|
|
407 |
#if defined(__MVS__)
|
|
408 |
# define NO_vsnprintf
|
|
409 |
#endif
|
|
410 |
|
|
411 |
/* MVS linker does not support external names larger than 8 bytes */
|
|
412 |
#if defined(__MVS__)
|
|
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")
|
|
426 |
#endif
|
|
427 |
|
|
428 |
#endif /* ZCONF_H */
|