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 */
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 deflateInit2_ z_deflateInit2_
47 # define deflateInit_ z_deflateInit_
48 # define deflateParams z_deflateParams
49 # define deflatePending z_deflatePending
50 # define deflatePrime z_deflatePrime
51 # define deflateReset z_deflateReset
52 # define deflateResetKeep z_deflateResetKeep
53 # define deflateSetDictionary z_deflateSetDictionary
54 # define deflateSetHeader z_deflateSetHeader
55 # define deflateTune z_deflateTune
56 # define deflate_copyright z_deflate_copyright
57 # define get_crc_table z_get_crc_table
59 # define gz_error z_gz_error
60 # define gz_intmax z_gz_intmax
61 # define gz_strwinerror z_gz_strwinerror
62 # define gzbuffer z_gzbuffer
63 # define gzclearerr z_gzclearerr
64 # define gzclose z_gzclose
65 # define gzclose_r z_gzclose_r
66 # define gzclose_w z_gzclose_w
67 # define gzdirect z_gzdirect
68 # define gzdopen z_gzdopen
69 # define gzeof z_gzeof
70 # define gzerror z_gzerror
71 # define gzflush z_gzflush
72 # define gzgetc z_gzgetc
73 # define gzgetc_ z_gzgetc_
74 # define gzgets z_gzgets
75 # define gzoffset z_gzoffset
76 # define gzoffset64 z_gzoffset64
77 # define gzopen z_gzopen
78 # define gzopen64 z_gzopen64
80 # define gzopen_w z_gzopen_w
82 # define gzprintf z_gzprintf
83 # define gzvprintf z_gzvprintf
84 # define gzputc z_gzputc
85 # define gzputs z_gzputs
86 # define gzread z_gzread
87 # define gzrewind z_gzrewind
88 # define gzseek z_gzseek
89 # define gzseek64 z_gzseek64
90 # define gzsetparams z_gzsetparams
91 # define gztell z_gztell
92 # define gztell64 z_gztell64
93 # define gzungetc z_gzungetc
94 # define gzwrite z_gzwrite
96 # define inflate z_inflate
97 # define inflateBack z_inflateBack
98 # define inflateBackEnd z_inflateBackEnd
99 # define inflateBackInit_ z_inflateBackInit_
100 # define inflateCopy z_inflateCopy
101 # define inflateEnd z_inflateEnd
102 # define inflateGetHeader z_inflateGetHeader
103 # define inflateInit2_ z_inflateInit2_
104 # define inflateInit_ z_inflateInit_
105 # define inflateMark z_inflateMark
106 # define inflatePrime z_inflatePrime
107 # define inflateReset z_inflateReset
108 # define inflateReset2 z_inflateReset2
109 # define inflateSetDictionary z_inflateSetDictionary
110 # define inflateGetDictionary z_inflateGetDictionary
111 # define inflateSync z_inflateSync
112 # define inflateSyncPoint z_inflateSyncPoint
113 # define inflateUndermine z_inflateUndermine
114 # define inflateResetKeep z_inflateResetKeep
115 # define inflate_copyright z_inflate_copyright
116 # define inflate_fast z_inflate_fast
117 # define inflate_table z_inflate_table
119 # define uncompress z_uncompress
121 # define zError z_zError
123 # define zcalloc z_zcalloc
124 # define zcfree z_zcfree
126 # define zlibCompileFlags z_zlibCompileFlags
127 # define zlibVersion z_zlibVersion
129 /* all zlib typedefs in zlib.h and zconf.h */
131 # define Bytef z_Bytef
132 # define alloc_func z_alloc_func
133 # define charf z_charf
134 # define free_func z_free_func
136 # define gzFile z_gzFile
138 # define gz_header z_gz_header
139 # define gz_headerp z_gz_headerp
140 # define in_func z_in_func
142 # define out_func z_out_func
144 # define uIntf z_uIntf
145 # define uLong z_uLong
146 # define uLongf z_uLongf
147 # define voidp z_voidp
148 # define voidpc z_voidpc
149 # define voidpf z_voidpf
151 /* all zlib structs in zlib.h and zconf.h */
152 # define gz_header_s z_gz_header_s
153 # define internal_state z_internal_state
157 #if defined(__MSDOS__) && !defined(MSDOS)
160 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
163 #if defined(_WINDOWS) && !defined(WINDOWS)
166 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
171 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
172 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
180 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
181 * than 64k bytes at a time (needed on systems with 16-bit int).
187 # define UNALIGNED_OK
190 #ifdef __STDC_VERSION__
194 # if __STDC_VERSION__ >= 199901L
200 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
203 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
206 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
209 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
213 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
218 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
219 # define const /* note: need a more gentle solution here */
223 #if defined(ZLIB_CONST) && !defined(z_const)
224 # define z_const const
231 typedef unsigned NO_SIZE_T z_size_t;
234 typedef size_t z_size_t;
237 typedef NO_SSIZE_T z_ssize_t;
239 # include <sys/types.h>
240 typedef ssize_t z_ssize_t;
244 /* Maximum value for memLevel in deflateInit2 */
245 #ifndef MAX_MEM_LEVEL
247 # define MAX_MEM_LEVEL 8
249 # define MAX_MEM_LEVEL 9
253 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
254 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
255 * created by gzip. (Files created by minigzip can still be extracted by
259 # define MAX_WBITS 15 /* 32K LZ77 window */
262 /* The memory requirements for deflate are (in bytes):
263 (1 << (windowBits+2)) + (1 << (memLevel+9))
264 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
265 plus a few kilobytes for small objects. For example, if you want to reduce
266 the default memory requirements from 256K to 128K, compile with
267 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
268 Of course this will generally degrade compression (there's no free lunch).
270 The memory requirements for inflate are (in bytes) 1 << windowBits
271 that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
275 /* Type declarations */
277 #ifndef OF /* function prototypes */
279 # define OF(args) args
285 #ifndef Z_ARG /* function prototypes for stdarg */
286 # if defined(STDC) || defined(Z_HAVE_STDARG_H)
287 # define Z_ARG(args) args
289 # define Z_ARG(args) ()
293 /* The following definitions for FAR are needed only for MSDOS mixed
294 * model programming (small or medium model with some far allocations).
295 * This was tested only with MSC; for other MSDOS compilers you may have
296 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
297 * just define FAR to be empty.
300 # if defined(M_I86SM) || defined(M_I86MM)
301 /* MSC small or medium model */
302 # define SMALL_MEDIUM
309 # if (defined(__SMALL__) || defined(__MEDIUM__))
310 /* Turbo C small or medium model */
311 # define SMALL_MEDIUM
320 #if defined(WINDOWS) || defined(WIN32)
321 /* If building or using zlib as a DLL, define ZLIB_DLL.
322 * This is not mandatory, but it offers a little performance increase.
325 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
326 # ifdef ZLIB_INTERNAL
327 # define ZEXTERN extern __declspec(dllexport)
329 # define ZEXTERN extern __declspec(dllimport)
332 # endif /* ZLIB_DLL */
333 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
334 * define ZLIB_WINAPI.
335 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
341 # include <windows.h>
342 /* No need for _export, use ZLIB.DEF instead. */
343 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
344 # define ZEXPORT WINAPI
346 # define ZEXPORTVA WINAPIV
348 # define ZEXPORTVA FAR CDECL
353 #if defined (__BEOS__)
355 # ifdef ZLIB_INTERNAL
356 # define ZEXPORT __declspec(dllexport)
357 # define ZEXPORTVA __declspec(dllexport)
359 # define ZEXPORT __declspec(dllimport)
360 # define ZEXPORTVA __declspec(dllimport)
366 # define ZEXTERN extern
379 #if !defined(__MACTYPES__)
380 typedef unsigned char Byte; /* 8 bits */
382 typedef unsigned int uInt; /* 16 bits or more */
383 typedef unsigned long uLong; /* 32 bits or more */
386 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
387 # define Bytef Byte FAR
389 typedef Byte FAR Bytef;
391 typedef char FAR charf;
392 typedef int FAR intf;
393 typedef uInt FAR uIntf;
394 typedef uLong FAR uLongf;
397 typedef void const *voidpc;
398 typedef void FAR *voidpf;
401 typedef Byte const *voidpc;
402 typedef Byte FAR *voidpf;
406 #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
408 # if (UINT_MAX == 0xffffffffUL)
409 # define Z_U4 unsigned
410 # elif (ULONG_MAX == 0xffffffffUL)
411 # define Z_U4 unsigned long
412 # elif (USHRT_MAX == 0xffffffffUL)
413 # define Z_U4 unsigned short
418 typedef Z_U4 z_crc_t;
420 typedef unsigned long z_crc_t;
423 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
424 # define Z_HAVE_UNISTD_H
427 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
428 # define Z_HAVE_STDARG_H
433 # include <sys/types.h> /* for off_t */
437 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
439 # include <stdarg.h> /* for va_list */
445 # include <stddef.h> /* for wchar_t */
449 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
450 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
451 * though the former does not conform to the LFS document), but considering
452 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
453 * equivalently requesting no 64-bit operations
455 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
456 # undef _LARGEFILE64_SOURCE
459 #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
460 # define Z_HAVE_UNISTD_H
463 # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
464 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
466 # include <unixio.h> /* for off_t */
469 # define z_off_t off_t
474 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
478 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
482 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
486 #if !defined(SEEK_SET) && !defined(Z_SOLO)
487 # define SEEK_SET 0 /* Seek from beginning of file. */
488 # define SEEK_CUR 1 /* Seek from current position. */
489 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
493 # define z_off_t long
496 #if !defined(_WIN32) && defined(Z_LARGE64)
497 # define z_off64_t off64_t
499 # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
500 # define z_off64_t __int64
502 # define z_off64_t z_off_t
506 /* MVS linker does not support external names larger than 8 bytes */
508 #pragma map(deflateInit_,"DEIN")
509 #pragma map(deflateInit2_,"DEIN2")
510 #pragma map(deflateEnd,"DEEND")
511 #pragma map(deflateBound,"DEBND")
512 #pragma map(inflateInit_,"ININ")
513 #pragma map(inflateInit2_,"ININ2")
514 #pragma map(inflateEnd,"INEND")
515 #pragma map(inflateSync,"INSY")
516 #pragma map(inflateSetDictionary,"INSEDI")
517 #pragma map(compressBound,"CMBND")
518 #pragma map(inflate_table,"INTABL")
519 #pragma map(inflate_fast,"INFA")
520 #pragma map(inflate_copyright,"INCOPY")