1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
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
34 # define adler32_z z_adler32_z
36 # define compress z_compress
37 # define compress2 z_compress2
38 # define compressBound z_compressBound
40 # define crc32 z_crc32
41 # define crc32_combine z_crc32_combine
42 # define crc32_combine64 z_crc32_combine64
43 # define crc32_z z_crc32_z
44 # define deflate z_deflate
45 # define deflateBound z_deflateBound
46 # define deflateCopy z_deflateCopy
47 # define deflateEnd z_deflateEnd
48 # define deflateGetDictionary z_deflateGetDictionary
49 # define deflateInit z_deflateInit
50 # define deflateInit2 z_deflateInit2
51 # define deflateInit2_ z_deflateInit2_
52 # define deflateInit_ z_deflateInit_
53 # define deflateParams z_deflateParams
54 # define deflatePending z_deflatePending
55 # define deflatePrime z_deflatePrime
56 # define deflateReset z_deflateReset
57 # define deflateResetKeep z_deflateResetKeep
58 # define deflateSetDictionary z_deflateSetDictionary
59 # define deflateSetHeader z_deflateSetHeader
60 # define deflateTune z_deflateTune
61 # define deflate_copyright z_deflate_copyright
62 # define get_crc_table z_get_crc_table
64 # define gz_error z_gz_error
65 # define gz_intmax z_gz_intmax
66 # define gz_strwinerror z_gz_strwinerror
67 # define gzbuffer z_gzbuffer
68 # define gzclearerr z_gzclearerr
69 # define gzclose z_gzclose
70 # define gzclose_r z_gzclose_r
71 # define gzclose_w z_gzclose_w
72 # define gzdirect z_gzdirect
73 # define gzdopen z_gzdopen
74 # define gzeof z_gzeof
75 # define gzerror z_gzerror
76 # define gzflush z_gzflush
77 # define gzfread z_gzfread
78 # define gzfwrite z_gzfwrite
79 # define gzgetc z_gzgetc
80 # define gzgetc_ z_gzgetc_
81 # define gzgets z_gzgets
82 # define gzoffset z_gzoffset
83 # define gzoffset64 z_gzoffset64
84 # define gzopen z_gzopen
85 # define gzopen64 z_gzopen64
87 # define gzopen_w z_gzopen_w
89 # define gzprintf z_gzprintf
90 # define gzputc z_gzputc
91 # define gzputs z_gzputs
92 # define gzread z_gzread
93 # define gzrewind z_gzrewind
94 # define gzseek z_gzseek
95 # define gzseek64 z_gzseek64
96 # define gzsetparams z_gzsetparams
97 # define gztell z_gztell
98 # define gztell64 z_gztell64
99 # define gzungetc z_gzungetc
100 # define gzvprintf z_gzvprintf
101 # define gzwrite z_gzwrite
103 # define inflate z_inflate
104 # define inflateBack z_inflateBack
105 # define inflateBackEnd z_inflateBackEnd
106 # define inflateBackInit z_inflateBackInit
107 # define inflateBackInit_ z_inflateBackInit_
108 # define inflateCodesUsed z_inflateCodesUsed
109 # define inflateCopy z_inflateCopy
110 # define inflateEnd z_inflateEnd
111 # define inflateGetDictionary z_inflateGetDictionary
112 # define inflateGetHeader z_inflateGetHeader
113 # define inflateInit z_inflateInit
114 # define inflateInit2 z_inflateInit2
115 # define inflateInit2_ z_inflateInit2_
116 # define inflateInit_ z_inflateInit_
117 # define inflateMark z_inflateMark
118 # define inflatePrime z_inflatePrime
119 # define inflateReset z_inflateReset
120 # define inflateReset2 z_inflateReset2
121 # define inflateResetKeep z_inflateResetKeep
122 # define inflateSetDictionary z_inflateSetDictionary
123 # define inflateSync z_inflateSync
124 # define inflateSyncPoint z_inflateSyncPoint
125 # define inflateUndermine z_inflateUndermine
126 # define inflateValidate z_inflateValidate
127 # define inflate_copyright z_inflate_copyright
128 # define inflate_fast z_inflate_fast
129 # define inflate_table z_inflate_table
131 # define uncompress z_uncompress
132 # define uncompress2 z_uncompress2
134 # define zError z_zError
136 # define zcalloc z_zcalloc
137 # define zcfree z_zcfree
139 # define zlibCompileFlags z_zlibCompileFlags
140 # define zlibVersion z_zlibVersion
142 /* all zlib typedefs in zlib.h and zconf.h */
144 # define Bytef z_Bytef
145 # define alloc_func z_alloc_func
146 # define charf z_charf
147 # define free_func z_free_func
149 # define gzFile z_gzFile
151 # define gz_header z_gz_header
152 # define gz_headerp z_gz_headerp
153 # define in_func z_in_func
155 # define out_func z_out_func
157 # define uIntf z_uIntf
158 # define uLong z_uLong
159 # define uLongf z_uLongf
160 # define voidp z_voidp
161 # define voidpc z_voidpc
162 # define voidpf z_voidpf
164 /* all zlib structs in zlib.h and zconf.h */
165 # define gz_header_s z_gz_header_s
166 # define internal_state z_internal_state
170 #if defined(__MSDOS__) && !defined(MSDOS)
173 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
176 #if defined(_WINDOWS) && !defined(WINDOWS)
179 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
184 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
185 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
193 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
194 * than 64k bytes at a time (needed on systems with 16-bit int).
200 # define UNALIGNED_OK
203 #ifdef __STDC_VERSION__
207 # if __STDC_VERSION__ >= 199901L
213 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
216 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
219 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
222 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
226 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
231 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
232 # define const /* note: need a more gentle solution here */
236 #if defined(ZLIB_CONST) && !defined(z_const)
237 # define z_const const
243 typedef unsigned long z_size_t;
245 # define z_longlong long long
246 # if defined(NO_SIZE_T)
247 typedef unsigned NO_SIZE_T z_size_t;
250 typedef size_t z_size_t;
252 typedef unsigned long z_size_t;
257 /* Maximum value for memLevel in deflateInit2 */
258 #ifndef MAX_MEM_LEVEL
260 # define MAX_MEM_LEVEL 8
262 # define MAX_MEM_LEVEL 9
266 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
267 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
268 * created by gzip. (Files created by minigzip can still be extracted by
272 # define MAX_WBITS 15 /* 32K LZ77 window */
275 /* The memory requirements for deflate are (in bytes):
276 (1 << (windowBits+2)) + (1 << (memLevel+9))
277 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
278 plus a few kilobytes for small objects. For example, if you want to reduce
279 the default memory requirements from 256K to 128K, compile with
280 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
281 Of course this will generally degrade compression (there's no free lunch).
283 The memory requirements for inflate are (in bytes) 1 << windowBits
284 that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
288 /* Type declarations */
290 #ifndef OF /* function prototypes */
292 # define OF(args) args
298 #ifndef Z_ARG /* function prototypes for stdarg */
299 # if defined(STDC) || defined(Z_HAVE_STDARG_H)
300 # define Z_ARG(args) args
302 # define Z_ARG(args) ()
306 /* The following definitions for FAR are needed only for MSDOS mixed
307 * model programming (small or medium model with some far allocations).
308 * This was tested only with MSC; for other MSDOS compilers you may have
309 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
310 * just define FAR to be empty.
313 # if defined(M_I86SM) || defined(M_I86MM)
314 /* MSC small or medium model */
315 # define SMALL_MEDIUM
322 # if (defined(__SMALL__) || defined(__MEDIUM__))
323 /* Turbo C small or medium model */
324 # define SMALL_MEDIUM
333 #if defined(WINDOWS) || defined(WIN32)
334 /* If building or using zlib as a DLL, define ZLIB_DLL.
335 * This is not mandatory, but it offers a little performance increase.
338 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
339 # ifdef ZLIB_INTERNAL
340 # define ZEXTERN extern __declspec(dllexport)
342 # define ZEXTERN extern __declspec(dllimport)
345 # endif /* ZLIB_DLL */
346 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
347 * define ZLIB_WINAPI.
348 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
354 # include <windows.h>
355 /* No need for _export, use ZLIB.DEF instead. */
356 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
357 # define ZEXPORT WINAPI
359 # define ZEXPORTVA WINAPIV
361 # define ZEXPORTVA FAR CDECL
366 #if defined (__BEOS__)
368 # ifdef ZLIB_INTERNAL
369 # define ZEXPORT __declspec(dllexport)
370 # define ZEXPORTVA __declspec(dllexport)
372 # define ZEXPORT __declspec(dllimport)
373 # define ZEXPORTVA __declspec(dllimport)
379 # define ZEXTERN extern
392 #if !defined(__MACTYPES__)
393 typedef unsigned char Byte; /* 8 bits */
395 typedef unsigned int uInt; /* 16 bits or more */
396 typedef unsigned long uLong; /* 32 bits or more */
399 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
400 # define Bytef Byte FAR
402 typedef Byte FAR Bytef;
404 typedef char FAR charf;
405 typedef int FAR intf;
406 typedef uInt FAR uIntf;
407 typedef uLong FAR uLongf;
410 typedef void const *voidpc;
411 typedef void FAR *voidpf;
414 typedef Byte const *voidpc;
415 typedef Byte FAR *voidpf;
419 #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
421 # if (UINT_MAX == 0xffffffffUL)
422 # define Z_U4 unsigned
423 # elif (ULONG_MAX == 0xffffffffUL)
424 # define Z_U4 unsigned long
425 # elif (USHRT_MAX == 0xffffffffUL)
426 # define Z_U4 unsigned short
431 typedef Z_U4 z_crc_t;
433 typedef unsigned long z_crc_t;
436 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
437 # define Z_HAVE_UNISTD_H
440 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
441 # define Z_HAVE_STDARG_H
446 # include <sys/types.h> /* for off_t */
450 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
452 # include <stdarg.h> /* for va_list */
458 # include <stddef.h> /* for wchar_t */
462 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
463 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
464 * though the former does not conform to the LFS document), but considering
465 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
466 * equivalently requesting no 64-bit operations
468 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
469 # undef _LARGEFILE64_SOURCE
472 #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
473 # define Z_HAVE_UNISTD_H
476 # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
477 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
479 # include <unixio.h> /* for off_t */
482 # define z_off_t off_t
487 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
491 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
495 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
499 #if !defined(SEEK_SET) && !defined(Z_SOLO)
500 # define SEEK_SET 0 /* Seek from beginning of file. */
501 # define SEEK_CUR 1 /* Seek from current position. */
502 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
506 # define z_off_t long
509 #if !defined(_WIN32) && defined(Z_LARGE64)
510 # define z_off64_t off64_t
512 # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
513 # define z_off64_t __int64
515 # define z_off64_t z_off_t
519 /* MVS linker does not support external names larger than 8 bytes */
521 #pragma map(deflateInit_,"DEIN")
522 #pragma map(deflateInit2_,"DEIN2")
523 #pragma map(deflateEnd,"DEEND")
524 #pragma map(deflateBound,"DEBND")
525 #pragma map(inflateInit_,"ININ")
526 #pragma map(inflateInit2_,"ININ2")
527 #pragma map(inflateEnd,"INEND")
528 #pragma map(inflateSync,"INSY")
529 #pragma map(inflateSetDictionary,"INSEDI")
530 #pragma map(compressBound,"CMBND")
531 #pragma map(inflate_table,"INTABL")
532 #pragma map(inflate_fast,"INFA")
533 #pragma map(inflate_copyright,"INCOPY")