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 #cmakedefine Z_HAVE_UNISTD_H
14 * If you *really* need a unique prefix for all types and library functions,
15 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
16 * Even better than compiling with -DZ_PREFIX would be to use configure to set
17 * this permanently in zconf.h using "./configure --zprefix".
19 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
22 /* all linked symbols */
23 # define _dist_code z__dist_code
24 # define _length_code z__length_code
25 # define _tr_align z__tr_align
26 # define _tr_flush_block z__tr_flush_block
27 # define _tr_init z__tr_init
28 # define _tr_stored_block z__tr_stored_block
29 # define _tr_tally z__tr_tally
30 # define adler32 z_adler32
31 # define adler32_combine z_adler32_combine
32 # define adler32_combine64 z_adler32_combine64
34 # define compress z_compress
35 # define compress2 z_compress2
36 # define compressBound z_compressBound
38 # define crc32 z_crc32
39 # define crc32_combine z_crc32_combine
40 # define crc32_combine64 z_crc32_combine64
41 # define deflate z_deflate
42 # define deflateBound z_deflateBound
43 # define deflateCopy z_deflateCopy
44 # define deflateEnd z_deflateEnd
45 # define deflateInit2_ z_deflateInit2_
46 # define deflateInit_ z_deflateInit_
47 # define deflateParams z_deflateParams
48 # define deflatePending z_deflatePending
49 # define deflatePrime z_deflatePrime
50 # define deflateReset z_deflateReset
51 # define deflateSetDictionary z_deflateSetDictionary
52 # define deflateSetHeader z_deflateSetHeader
53 # define deflateTune z_deflateTune
54 # define deflate_copyright z_deflate_copyright
55 # define get_crc_table z_get_crc_table
57 # define gz_error z_gz_error
58 # define gz_intmax z_gz_intmax
59 # define gz_strwinerror z_gz_strwinerror
60 # define gzbuffer z_gzbuffer
61 # define gzclearerr z_gzclearerr
62 # define gzclose z_gzclose
63 # define gzclose_r z_gzclose_r
64 # define gzclose_w z_gzclose_w
65 # define gzdirect z_gzdirect
66 # define gzdopen z_gzdopen
67 # define gzeof z_gzeof
68 # define gzerror z_gzerror
69 # define gzflags z_gzflags
70 # define gzflush z_gzflush
71 # define gzgetc z_gzgetc
72 # define gzgetc_ z_gzgetc_
73 # define gzgets z_gzgets
74 # define gzoffset z_gzoffset
75 # define gzoffset64 z_gzoffset64
76 # define gzopen z_gzopen
77 # define gzopen64 z_gzopen64
78 # define gzprintf z_gzprintf
79 # define gzputc z_gzputc
80 # define gzputs z_gzputs
81 # define gzread z_gzread
82 # define gzrewind z_gzrewind
83 # define gzseek z_gzseek
84 # define gzseek64 z_gzseek64
85 # define gzsetparams z_gzsetparams
86 # define gztell z_gztell
87 # define gztell64 z_gztell64
88 # define gzungetc z_gzungetc
89 # define gzwrite z_gzwrite
91 # define inflate z_inflate
92 # define inflateBack z_inflateBack
93 # define inflateBackEnd z_inflateBackEnd
94 # define inflateBackInit_ z_inflateBackInit_
95 # define inflateCopy z_inflateCopy
96 # define inflateEnd z_inflateEnd
97 # define inflateGetHeader z_inflateGetHeader
98 # define inflateInit2_ z_inflateInit2_
99 # define inflateInit_ z_inflateInit_
100 # define inflateMark z_inflateMark
101 # define inflatePrime z_inflatePrime
102 # define inflateReset z_inflateReset
103 # define inflateReset2 z_inflateReset2
104 # define inflateSetDictionary z_inflateSetDictionary
105 # define inflateSync z_inflateSync
106 # define inflateSyncPoint z_inflateSyncPoint
107 # define inflateUndermine z_inflateUndermine
108 # define inflateResetKeep z_inflateResetKeep
109 # define inflate_copyright z_inflate_copyright
110 # define inflate_fast z_inflate_fast
111 # define inflate_table z_inflate_table
113 # define uncompress z_uncompress
115 # define zError z_zError
117 # define zcalloc z_zcalloc
118 # define zcfree z_zcfree
120 # define zlibCompileFlags z_zlibCompileFlags
121 # define zlibVersion z_zlibVersion
123 /* all zlib typedefs in zlib.h and zconf.h */
125 # define Bytef z_Bytef
126 # define alloc_func z_alloc_func
127 # define charf z_charf
128 # define free_func z_free_func
130 # define gzFile z_gzFile
131 # define gz_header z_gz_header
132 # define gz_headerp z_gz_headerp
134 # define in_func z_in_func
136 # define out_func z_out_func
138 # define uIntf z_uIntf
139 # define uLong z_uLong
140 # define uLongf z_uLongf
141 # define voidp z_voidp
142 # define voidpc z_voidpc
143 # define voidpf z_voidpf
145 /* all zlib structs in zlib.h and zconf.h */
147 # define gz_header_s z_gz_header_s
149 # define internal_state z_internal_state
153 #if defined(__MSDOS__) && !defined(MSDOS)
156 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
159 #if defined(_WINDOWS) && !defined(WINDOWS)
162 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
167 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
168 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
176 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
177 * than 64k bytes at a time (needed on systems with 16-bit int).
183 # define UNALIGNED_OK
186 #ifdef __STDC_VERSION__
190 # if __STDC_VERSION__ >= 199901L
196 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
199 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
202 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
205 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
209 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
214 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
215 # define const /* note: need a more gentle solution here */
219 #if defined(ZLIB_CONST) && !defined(z_const)
220 # define z_const const
225 /* Some Mac compilers merge all .h files incorrectly: */
226 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
227 # define NO_DUMMY_DECL
230 /* Maximum value for memLevel in deflateInit2 */
231 #ifndef MAX_MEM_LEVEL
233 # define MAX_MEM_LEVEL 8
235 # define MAX_MEM_LEVEL 9
239 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
240 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
241 * created by gzip. (Files created by minigzip can still be extracted by
245 # define MAX_WBITS 15 /* 32K LZ77 window */
248 /* The memory requirements for deflate are (in bytes):
249 (1 << (windowBits+2)) + (1 << (memLevel+9))
250 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
251 plus a few kilobytes for small objects. For example, if you want to reduce
252 the default memory requirements from 256K to 128K, compile with
253 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
254 Of course this will generally degrade compression (there's no free lunch).
256 The memory requirements for inflate are (in bytes) 1 << windowBits
257 that is, 32K for windowBits=15 (default value) plus a few kilobytes
261 /* Type declarations */
263 #ifndef OF /* function prototypes */
265 # define OF(args) args
271 #ifndef Z_ARG /* function prototypes for stdarg */
272 # if defined(STDC) || defined(Z_HAVE_STDARG_H)
273 # define Z_ARG(args) args
275 # define Z_ARG(args) ()
279 /* The following definitions for FAR are needed only for MSDOS mixed
280 * model programming (small or medium model with some far allocations).
281 * This was tested only with MSC; for other MSDOS compilers you may have
282 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
283 * just define FAR to be empty.
286 # if defined(M_I86SM) || defined(M_I86MM)
287 /* MSC small or medium model */
288 # define SMALL_MEDIUM
295 # if (defined(__SMALL__) || defined(__MEDIUM__))
296 /* Turbo C small or medium model */
297 # define SMALL_MEDIUM
306 #if defined(WINDOWS) || defined(WIN32)
307 /* If building or using zlib as a DLL, define ZLIB_DLL.
308 * This is not mandatory, but it offers a little performance increase.
311 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
312 # ifdef ZLIB_INTERNAL
313 # define ZEXTERN extern __declspec(dllexport)
315 # define ZEXTERN extern __declspec(dllimport)
318 # endif /* ZLIB_DLL */
319 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
320 * define ZLIB_WINAPI.
321 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
327 # include <windows.h>
328 /* No need for _export, use ZLIB.DEF instead. */
329 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
330 # define ZEXPORT WINAPI
332 # define ZEXPORTVA WINAPIV
334 # define ZEXPORTVA FAR CDECL
339 #if defined (__BEOS__)
341 # ifdef ZLIB_INTERNAL
342 # define ZEXPORT __declspec(dllexport)
343 # define ZEXPORTVA __declspec(dllexport)
345 # define ZEXPORT __declspec(dllimport)
346 # define ZEXPORTVA __declspec(dllimport)
352 # define ZEXTERN extern
365 #if !defined(__MACTYPES__)
366 typedef unsigned char Byte; /* 8 bits */
368 typedef unsigned int uInt; /* 16 bits or more */
369 typedef unsigned long uLong; /* 32 bits or more */
372 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
373 # define Bytef Byte FAR
375 typedef Byte FAR Bytef;
377 typedef char FAR charf;
378 typedef int FAR intf;
379 typedef uInt FAR uIntf;
380 typedef uLong FAR uLongf;
383 typedef void const *voidpc;
384 typedef void FAR *voidpf;
387 typedef Byte const *voidpc;
388 typedef Byte FAR *voidpf;
392 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
393 # define Z_HAVE_UNISTD_H
396 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
397 # define Z_HAVE_STDARG_H
402 # include <sys/types.h> /* for off_t */
406 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
407 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
408 * though the former does not conform to the LFS document), but considering
409 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
410 * equivalently requesting no 64-bit operations
412 #if -_LARGEFILE64_SOURCE - -1 == 1
413 # undef _LARGEFILE64_SOURCE
416 #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
420 #if (defined(Z_HAVE_UNISTD_H) || defined(Z_LARGE)) && !defined(Z_SOLO)
421 # include <unistd.h> /* for SEEK_* and off_t */
423 # include <unixio.h> /* for off_t */
426 # define z_off_t off_t
430 #if !defined(SEEK_SET) && !defined(Z_SOLO)
431 # define SEEK_SET 0 /* Seek from beginning of file. */
432 # define SEEK_CUR 1 /* Seek from current position. */
433 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
437 # define z_off_t long
440 #if !defined(_WIN32) && (defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0)
441 # define z_off64_t off64_t
444 # define z_off64_t __int64
446 # define z_off64_t z_off_t
450 /* MVS linker does not support external names larger than 8 bytes */
452 #pragma map(deflateInit_,"DEIN")
453 #pragma map(deflateInit2_,"DEIN2")
454 #pragma map(deflateEnd,"DEEND")
455 #pragma map(deflateBound,"DEBND")
456 #pragma map(inflateInit_,"ININ")
457 #pragma map(inflateInit2_,"ININ2")
458 #pragma map(inflateEnd,"INEND")
459 #pragma map(inflateSync,"INSY")
460 #pragma map(inflateSetDictionary,"INSEDI")
461 #pragma map(compressBound,"CMBND")
462 #pragma map(inflate_table,"INTABL")
463 #pragma map(inflate_fast,"INFA")
464 #pragma map(inflate_copyright,"INCOPY")