1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2013 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 and init macros */
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_bits z__tr_flush_bits
27 # define _tr_flush_block z__tr_flush_block
28 # define _tr_init z__tr_init
29 # define _tr_stored_block z__tr_stored_block
30 # define _tr_tally z__tr_tally
31 # define adler32 z_adler32
32 # define adler32_combine z_adler32_combine
33 # define adler32_combine64 z_adler32_combine64
35 # define compress z_compress
36 # define compress2 z_compress2
37 # define compressBound z_compressBound
39 # define crc32 z_crc32
40 # define crc32_combine z_crc32_combine
41 # define crc32_combine64 z_crc32_combine64
42 # define deflate z_deflate
43 # define deflateBound z_deflateBound
44 # define deflateCopy z_deflateCopy
45 # define deflateEnd z_deflateEnd
46 # define deflateInit z_deflateInit
47 # define deflateInit2 z_deflateInit2
48 # define deflateInit2_ z_deflateInit2_
49 # define deflateInit_ z_deflateInit_
50 # define deflateParams z_deflateParams
51 # define deflatePending z_deflatePending
52 # define deflatePrime z_deflatePrime
53 # define deflateReset z_deflateReset
54 # define deflateResetKeep z_deflateResetKeep
55 # define deflateSetDictionary z_deflateSetDictionary
56 # define deflateSetHeader z_deflateSetHeader
57 # define deflateTune z_deflateTune
58 # define deflate_copyright z_deflate_copyright
59 # define get_crc_table z_get_crc_table
61 # define gz_error z_gz_error
62 # define gz_intmax z_gz_intmax
63 # define gz_strwinerror z_gz_strwinerror
64 # define gzbuffer z_gzbuffer
65 # define gzclearerr z_gzclearerr
66 # define gzclose z_gzclose
67 # define gzclose_r z_gzclose_r
68 # define gzclose_w z_gzclose_w
69 # define gzdirect z_gzdirect
70 # define gzdopen z_gzdopen
71 # define gzeof z_gzeof
72 # define gzerror z_gzerror
73 # define gzflush z_gzflush
74 # define gzgetc z_gzgetc
75 # define gzgetc_ z_gzgetc_
76 # define gzgets z_gzgets
77 # define gzoffset z_gzoffset
78 # define gzoffset64 z_gzoffset64
79 # define gzopen z_gzopen
80 # define gzopen64 z_gzopen64
82 # define gzopen_w z_gzopen_w
84 # define gzprintf z_gzprintf
85 # define gzvprintf z_gzvprintf
86 # define gzputc z_gzputc
87 # define gzputs z_gzputs
88 # define gzread z_gzread
89 # define gzrewind z_gzrewind
90 # define gzseek z_gzseek
91 # define gzseek64 z_gzseek64
92 # define gzsetparams z_gzsetparams
93 # define gztell z_gztell
94 # define gztell64 z_gztell64
95 # define gzungetc z_gzungetc
96 # define gzwrite z_gzwrite
98 # define inflate z_inflate
99 # define inflateBack z_inflateBack
100 # define inflateBackEnd z_inflateBackEnd
101 # define inflateBackInit z_inflateBackInit
102 # define inflateBackInit_ z_inflateBackInit_
103 # define inflateCopy z_inflateCopy
104 # define inflateEnd z_inflateEnd
105 # define inflateGetHeader z_inflateGetHeader
106 # define inflateInit z_inflateInit
107 # define inflateInit2 z_inflateInit2
108 # define inflateInit2_ z_inflateInit2_
109 # define inflateInit_ z_inflateInit_
110 # define inflateMark z_inflateMark
111 # define inflatePrime z_inflatePrime
112 # define inflateReset z_inflateReset
113 # define inflateReset2 z_inflateReset2
114 # define inflateSetDictionary z_inflateSetDictionary
115 # define inflateGetDictionary z_inflateGetDictionary
116 # define inflateSync z_inflateSync
117 # define inflateSyncPoint z_inflateSyncPoint
118 # define inflateUndermine z_inflateUndermine
119 # define inflateResetKeep z_inflateResetKeep
120 # define inflate_copyright z_inflate_copyright
121 # define inflate_fast z_inflate_fast
122 # define inflate_table z_inflate_table
124 # define uncompress z_uncompress
126 # define zError z_zError
128 # define zcalloc z_zcalloc
129 # define zcfree z_zcfree
131 # define zlibCompileFlags z_zlibCompileFlags
132 # define zlibVersion z_zlibVersion
134 /* all zlib typedefs in zlib.h and zconf.h */
136 # define Bytef z_Bytef
137 # define alloc_func z_alloc_func
138 # define charf z_charf
139 # define free_func z_free_func
141 # define gzFile z_gzFile
143 # define gz_header z_gz_header
144 # define gz_headerp z_gz_headerp
145 # define in_func z_in_func
147 # define out_func z_out_func
149 # define uIntf z_uIntf
150 # define uLong z_uLong
151 # define uLongf z_uLongf
152 # define voidp z_voidp
153 # define voidpc z_voidpc
154 # define voidpf z_voidpf
156 /* all zlib structs in zlib.h and zconf.h */
157 # define gz_header_s z_gz_header_s
158 # define internal_state z_internal_state
162 #if defined(__MSDOS__) && !defined(MSDOS)
165 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
168 #if defined(_WINDOWS) && !defined(WINDOWS)
171 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
176 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
177 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
185 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
186 * than 64k bytes at a time (needed on systems with 16-bit int).
192 # define UNALIGNED_OK
195 #ifdef __STDC_VERSION__
199 # if __STDC_VERSION__ >= 199901L
205 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
208 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
211 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
214 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
218 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
223 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
224 # define const /* note: need a more gentle solution here */
228 #if defined(ZLIB_CONST) && !defined(z_const)
229 # define z_const const
235 # define z_longlong long long
237 typedef unsigned NO_SIZE_T z_size_t;
240 typedef size_t z_size_t;
243 typedef NO_SSIZE_T z_ssize_t;
245 # include <sys/types.h>
246 typedef ssize_t z_ssize_t;
251 /* Maximum value for memLevel in deflateInit2 */
252 #ifndef MAX_MEM_LEVEL
254 # define MAX_MEM_LEVEL 8
256 # define MAX_MEM_LEVEL 9
260 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
261 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
262 * created by gzip. (Files created by minigzip can still be extracted by
266 # define MAX_WBITS 15 /* 32K LZ77 window */
269 /* The memory requirements for deflate are (in bytes):
270 (1 << (windowBits+2)) + (1 << (memLevel+9))
271 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
272 plus a few kilobytes for small objects. For example, if you want to reduce
273 the default memory requirements from 256K to 128K, compile with
274 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
275 Of course this will generally degrade compression (there's no free lunch).
277 The memory requirements for inflate are (in bytes) 1 << windowBits
278 that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
282 /* Type declarations */
284 #ifndef OF /* function prototypes */
286 # define OF(args) args
292 #ifndef Z_ARG /* function prototypes for stdarg */
293 # if defined(STDC) || defined(Z_HAVE_STDARG_H)
294 # define Z_ARG(args) args
296 # define Z_ARG(args) ()
300 /* The following definitions for FAR are needed only for MSDOS mixed
301 * model programming (small or medium model with some far allocations).
302 * This was tested only with MSC; for other MSDOS compilers you may have
303 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
304 * just define FAR to be empty.
307 # if defined(M_I86SM) || defined(M_I86MM)
308 /* MSC small or medium model */
309 # define SMALL_MEDIUM
316 # if (defined(__SMALL__) || defined(__MEDIUM__))
317 /* Turbo C small or medium model */
318 # define SMALL_MEDIUM
327 #if defined(WINDOWS) || defined(WIN32)
328 /* If building or using zlib as a DLL, define ZLIB_DLL.
329 * This is not mandatory, but it offers a little performance increase.
332 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
333 # ifdef ZLIB_INTERNAL
334 # define ZEXTERN extern __declspec(dllexport)
336 # define ZEXTERN extern __declspec(dllimport)
339 # endif /* ZLIB_DLL */
340 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
341 * define ZLIB_WINAPI.
342 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
348 # include <windows.h>
349 /* No need for _export, use ZLIB.DEF instead. */
350 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
351 # define ZEXPORT WINAPI
353 # define ZEXPORTVA WINAPIV
355 # define ZEXPORTVA FAR CDECL
360 #if defined (__BEOS__)
362 # ifdef ZLIB_INTERNAL
363 # define ZEXPORT __declspec(dllexport)
364 # define ZEXPORTVA __declspec(dllexport)
366 # define ZEXPORT __declspec(dllimport)
367 # define ZEXPORTVA __declspec(dllimport)
373 # define ZEXTERN extern
386 #if !defined(__MACTYPES__)
387 typedef unsigned char Byte; /* 8 bits */
389 typedef unsigned int uInt; /* 16 bits or more */
390 typedef unsigned long uLong; /* 32 bits or more */
393 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
394 # define Bytef Byte FAR
396 typedef Byte FAR Bytef;
398 typedef char FAR charf;
399 typedef int FAR intf;
400 typedef uInt FAR uIntf;
401 typedef uLong FAR uLongf;
404 typedef void const *voidpc;
405 typedef void FAR *voidpf;
408 typedef Byte const *voidpc;
409 typedef Byte FAR *voidpf;
413 #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
415 # if (UINT_MAX == 0xffffffffUL)
416 # define Z_U4 unsigned
417 # elif (ULONG_MAX == 0xffffffffUL)
418 # define Z_U4 unsigned long
419 # elif (USHRT_MAX == 0xffffffffUL)
420 # define Z_U4 unsigned short
425 typedef Z_U4 z_crc_t;
427 typedef unsigned long z_crc_t;
430 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
431 # define Z_HAVE_UNISTD_H
434 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
435 # define Z_HAVE_STDARG_H
440 # include <sys/types.h> /* for off_t */
444 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
446 # include <stdarg.h> /* for va_list */
452 # include <stddef.h> /* for wchar_t */
456 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
457 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
458 * though the former does not conform to the LFS document), but considering
459 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
460 * equivalently requesting no 64-bit operations
462 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
463 # undef _LARGEFILE64_SOURCE
466 #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
467 # define Z_HAVE_UNISTD_H
470 # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
471 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
473 # include <unixio.h> /* for off_t */
476 # define z_off_t off_t
481 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
485 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
489 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
493 #if !defined(SEEK_SET) && !defined(Z_SOLO)
494 # define SEEK_SET 0 /* Seek from beginning of file. */
495 # define SEEK_CUR 1 /* Seek from current position. */
496 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
500 # define z_off_t long
503 #if !defined(_WIN32) && defined(Z_LARGE64)
504 # define z_off64_t off64_t
506 # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
507 # define z_off64_t __int64
509 # define z_off64_t z_off_t
513 /* MVS linker does not support external names larger than 8 bytes */
515 #pragma map(deflateInit_,"DEIN")
516 #pragma map(deflateInit2_,"DEIN2")
517 #pragma map(deflateEnd,"DEEND")
518 #pragma map(deflateBound,"DEBND")
519 #pragma map(inflateInit_,"ININ")
520 #pragma map(inflateInit2_,"ININ2")
521 #pragma map(inflateEnd,"INEND")
522 #pragma map(inflateSync,"INSY")
523 #pragma map(inflateSetDictionary,"INSEDI")
524 #pragma map(compressBound,"CMBND")
525 #pragma map(inflate_table,"INTABL")
526 #pragma map(inflate_fast,"INFA")
527 #pragma map(inflate_copyright,"INCOPY")