zconf.h
Go to the documentation of this file.
1 /* zconf.h -- configuration of the zlib compression library
2  * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
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 #define Z_PREFIX
11 #define Z_HAVE_UNISTD_H
12 
13 /*
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".
18  */
19 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
20 # define Z_PREFIX_SET
21 
22 /* all linked symbols and init macros */
23 # define _dist_code vtkzlib__dist_code
24 # define _length_code vtkzlib__length_code
25 # define _tr_align vtkzlib__tr_align
26 # define _tr_flush_bits vtkzlib__tr_flush_bits
27 # define _tr_flush_block vtkzlib__tr_flush_block
28 # define _tr_init vtkzlib__tr_init
29 # define _tr_stored_block vtkzlib__tr_stored_block
30 # define _tr_tally vtkzlib__tr_tally
31 # define adler32 vtkzlib_adler32
32 # define adler32_combine vtkzlib_adler32_combine
33 # define adler32_combine64 vtkzlib_adler32_combine64
34 # define adler32_z vtkzlib_adler32_z
35 # ifndef Z_SOLO
36 # define compress vtkzlib_compress
37 # define compress2 vtkzlib_compress2
38 # define compressBound vtkzlib_compressBound
39 # endif
40 # define crc32 vtkzlib_crc32
41 # define crc32_combine vtkzlib_crc32_combine
42 # define crc32_combine64 vtkzlib_crc32_combine64
43 # define crc32_combine_gen vtkzlib_crc32_combine_gen
44 # define crc32_combine_gen64 vtkzlib_crc32_combine_gen64
45 # define crc32_combine_op vtkzlib_crc32_combine_op
46 # define crc32_z vtkzlib_crc32_z
47 # define deflate vtkzlib_deflate
48 # define deflateBound vtkzlib_deflateBound
49 # define deflateCopy vtkzlib_deflateCopy
50 # define deflateEnd vtkzlib_deflateEnd
51 # define deflateGetDictionary vtkzlib_deflateGetDictionary
52 # define deflateInit vtkzlib_deflateInit
53 # define deflateInit2 vtkzlib_deflateInit2
54 # define deflateInit2_ vtkzlib_deflateInit2_
55 # define deflateInit_ vtkzlib_deflateInit_
56 # define deflateParams vtkzlib_deflateParams
57 # define deflatePending vtkzlib_deflatePending
58 # define deflatePrime vtkzlib_deflatePrime
59 # define deflateReset vtkzlib_deflateReset
60 # define deflateResetKeep vtkzlib_deflateResetKeep
61 # define deflateSetDictionary vtkzlib_deflateSetDictionary
62 # define deflateSetHeader vtkzlib_deflateSetHeader
63 # define deflateTune vtkzlib_deflateTune
64 # define deflate_copyright vtkzlib_deflate_copyright
65 # define get_crc_table vtkzlib_get_crc_table
66 # ifndef Z_SOLO
67 # define gz_error vtkzlib_gz_error
68 # define gz_intmax vtkzlib_gz_intmax
69 # define gz_strwinerror vtkzlib_gz_strwinerror
70 # define gzbuffer vtkzlib_gzbuffer
71 # define gzclearerr vtkzlib_gzclearerr
72 # define gzclose vtkzlib_gzclose
73 # define gzclose_r vtkzlib_gzclose_r
74 # define gzclose_w vtkzlib_gzclose_w
75 # define gzdirect vtkzlib_gzdirect
76 # define gzdopen vtkzlib_gzdopen
77 # define gzeof vtkzlib_gzeof
78 # define gzerror vtkzlib_gzerror
79 # define gzflush vtkzlib_gzflush
80 # define gzfread vtkzlib_gzfread
81 # define gzfwrite vtkzlib_gzfwrite
82 # define gzgetc vtkzlib_gzgetc
83 # define gzgetc_ vtkzlib_gzgetc_
84 # define gzgets vtkzlib_gzgets
85 # define gzoffset vtkzlib_gzoffset
86 # define gzoffset64 vtkzlib_gzoffset64
87 # define gzopen vtkzlib_gzopen
88 # define gzopen64 vtkzlib_gzopen64
89 # ifdef _WIN32
90 # define gzopen_w vtkzlib_gzopen_w
91 # endif
92 # define gzprintf vtkzlib_gzprintf
93 # define gzputc vtkzlib_gzputc
94 # define gzputs vtkzlib_gzputs
95 # define gzread vtkzlib_gzread
96 # define gzrewind vtkzlib_gzrewind
97 # define gzseek vtkzlib_gzseek
98 # define gzseek64 vtkzlib_gzseek64
99 # define gzsetparams vtkzlib_gzsetparams
100 # define gztell vtkzlib_gztell
101 # define gztell64 vtkzlib_gztell64
102 # define gzungetc vtkzlib_gzungetc
103 # define gzvprintf vtkzlib_gzvprintf
104 # define gzwrite vtkzlib_gzwrite
105 # endif
106 # define inflate vtkzlib_inflate
107 # define inflateBack vtkzlib_inflateBack
108 # define inflateBackEnd vtkzlib_inflateBackEnd
109 # define inflateBackInit vtkzlib_inflateBackInit
110 # define inflateBackInit_ vtkzlib_inflateBackInit_
111 # define inflateCodesUsed vtkzlib_inflateCodesUsed
112 # define inflateCopy vtkzlib_inflateCopy
113 # define inflateEnd vtkzlib_inflateEnd
114 # define inflateGetDictionary vtkzlib_inflateGetDictionary
115 # define inflateGetHeader vtkzlib_inflateGetHeader
116 # define inflateInit vtkzlib_inflateInit
117 # define inflateInit2 vtkzlib_inflateInit2
118 # define inflateInit2_ vtkzlib_inflateInit2_
119 # define inflateInit_ vtkzlib_inflateInit_
120 # define inflateMark vtkzlib_inflateMark
121 # define inflatePrime vtkzlib_inflatePrime
122 # define inflateReset vtkzlib_inflateReset
123 # define inflateReset2 vtkzlib_inflateReset2
124 # define inflateResetKeep vtkzlib_inflateResetKeep
125 # define inflateSetDictionary vtkzlib_inflateSetDictionary
126 # define inflateSync vtkzlib_inflateSync
127 # define inflateSyncPoint vtkzlib_inflateSyncPoint
128 # define inflateUndermine vtkzlib_inflateUndermine
129 # define inflateValidate vtkzlib_inflateValidate
130 # define inflate_copyright vtkzlib_inflate_copyright
131 # define inflate_fast vtkzlib_inflate_fast
132 # define inflate_table vtkzlib_inflate_table
133 # ifndef Z_SOLO
134 # define uncompress vtkzlib_uncompress
135 # define uncompress2 vtkzlib_uncompress2
136 # endif
137 # define zError vtkzlib_zError
138 # ifndef Z_SOLO
139 # define zcalloc vtkzlib_zcalloc
140 # define zcfree vtkzlib_zcfree
141 # endif
142 # define zlibCompileFlags vtkzlib_zlibCompileFlags
143 # define zlibVersion vtkzlib_zlibVersion
144 
145 /* all zlib typedefs in zlib.h and zconf.h */
146 # define Byte vtkzlib_Byte
147 # define Bytef vtkzlib_Bytef
148 # define alloc_func vtkzlib_alloc_func
149 # define charf vtkzlib_charf
150 # define free_func vtkzlib_free_func
151 # ifndef Z_SOLO
152 # define gzFile vtkzlib_gzFile
153 # endif
154 # define gz_header vtkzlib_gz_header
155 # define gz_headerp vtkzlib_gz_headerp
156 # define in_func vtkzlib_in_func
157 # define intf vtkzlib_intf
158 # define out_func vtkzlib_out_func
159 # define uInt vtkzlib_uInt
160 # define uIntf vtkzlib_uIntf
161 # define uLong vtkzlib_uLong
162 # define uLongf vtkzlib_uLongf
163 # define voidp vtkzlib_voidp
164 # define voidpc vtkzlib_voidpc
165 # define voidpf vtkzlib_voidpf
166 
167 /* all zlib structs in zlib.h and zconf.h */
168 # define gz_header_s vtkzlib_gz_header_s
169 # define internal_state vtkzlib_internal_state
170 
171 /* all zlib structs in zutil.h */
172 # define z_errmsg vtkzlib_z_errmsg
173 
174 #endif
175 
176 #if defined(__MSDOS__) && !defined(MSDOS)
177 # define MSDOS
178 #endif
179 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
180 # define OS2
181 #endif
182 #if defined(_WINDOWS) && !defined(WINDOWS)
183 # define WINDOWS
184 #endif
185 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
186 # ifndef WIN32
187 # define WIN32
188 # endif
189 #endif
190 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
191 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
192 # ifndef SYS16BIT
193 # define SYS16BIT
194 # endif
195 # endif
196 #endif
197 
198 /*
199  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
200  * than 64k bytes at a time (needed on systems with 16-bit int).
201  */
202 #ifdef SYS16BIT
203 # define MAXSEG_64K
204 #endif
205 #ifdef MSDOS
206 # define UNALIGNED_OK
207 #endif
208 
209 #ifdef __STDC_VERSION__
210 # ifndef STDC
211 # define STDC
212 # endif
213 # if __STDC_VERSION__ >= 199901L
214 # ifndef STDC99
215 # define STDC99
216 # endif
217 # endif
218 #endif
219 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
220 # define STDC
221 #endif
222 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
223 # define STDC
224 #endif
225 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
226 # define STDC
227 #endif
228 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
229 # define STDC
230 #endif
231 
232 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
233 # define STDC
234 #endif
235 
236 #ifndef STDC
237 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
238 # define const /* note: need a more gentle solution here */
239 # endif
240 #endif
241 
242 #if defined(ZLIB_CONST) && !defined(z_const)
243 # define z_const const
244 #else
245 # define z_const
246 #endif
247 
248 #ifdef Z_SOLO
249 # ifdef _WIN64
250  typedef unsigned long long z_size_t;
251 # else
252  typedef unsigned long z_size_t;
253 # endif
254 #else
255 # define z_longlong long long
256 # if defined(NO_SIZE_T)
257  typedef unsigned NO_SIZE_T z_size_t;
258 # elif defined(STDC)
259 # include <stddef.h>
260  typedef size_t z_size_t;
261 # else
262  typedef unsigned long z_size_t;
263 # endif
264 # undef z_longlong
265 #endif
266 
267 /* Maximum value for memLevel in deflateInit2 */
268 #ifndef MAX_MEM_LEVEL
269 # ifdef MAXSEG_64K
270 # define MAX_MEM_LEVEL 8
271 # else
272 # define MAX_MEM_LEVEL 9
273 # endif
274 #endif
275 
276 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
277  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
278  * created by gzip. (Files created by minigzip can still be extracted by
279  * gzip.)
280  */
281 #ifndef MAX_WBITS
282 # define MAX_WBITS 15 /* 32K LZ77 window */
283 #endif
284 
285 /* The memory requirements for deflate are (in bytes):
286  (1 << (windowBits+2)) + (1 << (memLevel+9))
287  that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
288  plus a few kilobytes for small objects. For example, if you want to reduce
289  the default memory requirements from 256K to 128K, compile with
290  make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
291  Of course this will generally degrade compression (there's no free lunch).
292 
293  The memory requirements for inflate are (in bytes) 1 << windowBits
294  that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
295  for small objects.
296 */
297 
298  /* Type declarations */
299 
300 #ifndef OF /* function prototypes */
301 # ifdef STDC
302 # define OF(args) args
303 # else
304 # define OF(args) ()
305 # endif
306 #endif
307 
308 /* The following definitions for FAR are needed only for MSDOS mixed
309  * model programming (small or medium model with some far allocations).
310  * This was tested only with MSC; for other MSDOS compilers you may have
311  * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
312  * just define FAR to be empty.
313  */
314 #ifdef SYS16BIT
315 # if defined(M_I86SM) || defined(M_I86MM)
316  /* MSC small or medium model */
317 # define SMALL_MEDIUM
318 # ifdef _MSC_VER
319 # define FAR _far
320 # else
321 # define FAR far
322 # endif
323 # endif
324 # if (defined(__SMALL__) || defined(__MEDIUM__))
325  /* Turbo C small or medium model */
326 # define SMALL_MEDIUM
327 # ifdef __BORLANDC__
328 # define FAR _far
329 # else
330 # define FAR far
331 # endif
332 # endif
333 #endif
334 
335 #if defined(WINDOWS) || defined(WIN32)
336  /* If building or using zlib as a DLL, define ZLIB_DLL.
337  * This is not mandatory, but it offers a little performance increase.
338  */
339 # ifdef ZLIB_DLL
340 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
341 # ifdef ZLIB_INTERNAL
342 # define ZEXTERN extern __declspec(dllexport)
343 # else
344 # define ZEXTERN extern __declspec(dllimport)
345 # endif
346 # endif
347 # endif /* ZLIB_DLL */
348  /* If building or using zlib with the WINAPI/WINAPIV calling convention,
349  * define ZLIB_WINAPI.
350  * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
351  */
352 # ifdef ZLIB_WINAPI
353 # ifdef FAR
354 # undef FAR
355 # endif
356 # ifndef WIN32_LEAN_AND_MEAN
357 # define WIN32_LEAN_AND_MEAN
358 # endif
359 # include <windows.h>
360  /* No need for _export, use ZLIB.DEF instead. */
361  /* For complete Windows compatibility, use WINAPI, not __stdcall. */
362 # define ZEXPORT WINAPI
363 # ifdef WIN32
364 # define ZEXPORTVA WINAPIV
365 # else
366 # define ZEXPORTVA FAR CDECL
367 # endif
368 # endif
369 #endif
370 
371 #if defined (__BEOS__)
372 # ifdef ZLIB_DLL
373 # ifdef ZLIB_INTERNAL
374 # define ZEXPORT __declspec(dllexport)
375 # define ZEXPORTVA __declspec(dllexport)
376 # else
377 # define ZEXPORT __declspec(dllimport)
378 # define ZEXPORTVA __declspec(dllimport)
379 # endif
380 # endif
381 #endif
382 
383 #ifndef ZEXTERN
384 # define ZEXTERN extern
385 #endif
386 #ifndef ZEXPORT
387 # define ZEXPORT
388 #endif
389 #ifndef ZEXPORTVA
390 # define ZEXPORTVA
391 #endif
392 
393 #ifndef FAR
394 # define FAR
395 #endif
396 
397 #if !defined(__MACTYPES__)
398 typedef unsigned char Byte; /* 8 bits */
399 #endif
400 typedef unsigned int uInt; /* 16 bits or more */
401 typedef unsigned long uLong; /* 32 bits or more */
402 
403 #ifdef SMALL_MEDIUM
404  /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
405 # define Bytef Byte FAR
406 #else
407  typedef Byte FAR Bytef;
408 #endif
409 typedef char FAR charf;
410 typedef int FAR intf;
411 typedef uInt FAR uIntf;
412 typedef uLong FAR uLongf;
413 
414 #ifdef STDC
415  typedef void const *voidpc;
416  typedef void FAR *voidpf;
417  typedef void *voidp;
418 #else
419  typedef Byte const *voidpc;
420  typedef Byte FAR *voidpf;
421  typedef Byte *voidp;
422 #endif
423 
424 #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
425 # include <limits.h>
426 # if (UINT_MAX == 0xffffffffUL)
427 # define Z_U4 unsigned
428 # elif (ULONG_MAX == 0xffffffffUL)
429 # define Z_U4 unsigned long
430 # elif (USHRT_MAX == 0xffffffffUL)
431 # define Z_U4 unsigned short
432 # endif
433 #endif
434 
435 #ifdef Z_U4
436  typedef Z_U4 z_crc_t;
437 #else
438  typedef unsigned long z_crc_t;
439 #endif
440 
441 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
442 # define Z_HAVE_UNISTD_H
443 #endif
444 
445 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
446 # define Z_HAVE_STDARG_H
447 #endif
448 
449 #ifdef STDC
450 # ifndef Z_SOLO
451 # include <sys/types.h> /* for off_t */
452 # endif
453 #endif
454 
455 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
456 # ifndef Z_SOLO
457 # include <stdarg.h> /* for va_list */
458 # endif
459 #endif
460 
461 #ifdef _WIN32
462 # ifndef Z_SOLO
463 # include <stddef.h> /* for wchar_t */
464 # endif
465 #endif
466 
467 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
468  * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
469  * though the former does not conform to the LFS document), but considering
470  * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
471  * equivalently requesting no 64-bit operations
472  */
473 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
474 # undef _LARGEFILE64_SOURCE
475 #endif
476 
477 #ifndef Z_HAVE_UNISTD_H
478 # ifdef __WATCOMC__
479 # define Z_HAVE_UNISTD_H
480 # endif
481 #endif
482 #ifndef Z_HAVE_UNISTD_H
483 # if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
484 # define Z_HAVE_UNISTD_H
485 # endif
486 #endif
487 #ifndef Z_SOLO
488 # if defined(Z_HAVE_UNISTD_H)
489 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
490 # ifdef VMS
491 # include <unixio.h> /* for off_t */
492 # endif
493 # ifndef z_off_t
494 # define z_off_t off_t
495 # endif
496 # endif
497 #endif
498 
499 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
500 # define Z_LFS64
501 #endif
502 
503 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
504 # define Z_LARGE64
505 #endif
506 
507 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
508 # define Z_WANT64
509 #endif
510 
511 #if !defined(SEEK_SET) && !defined(Z_SOLO)
512 # define SEEK_SET 0 /* Seek from beginning of file. */
513 # define SEEK_CUR 1 /* Seek from current position. */
514 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
515 #endif
516 
517 #ifndef z_off_t
518 # define z_off_t long
519 #endif
520 
521 #if !defined(_WIN32) && defined(Z_LARGE64)
522 # define z_off64_t off64_t
523 #else
524 # if defined(_WIN32) && !defined(__GNUC__)
525 # define z_off64_t __int64
526 # else
527 # define z_off64_t z_off_t
528 # endif
529 #endif
530 
531 /* MVS linker does not support external names larger than 8 bytes */
532 #if defined(__MVS__)
533  #pragma map(deflateInit_,"DEIN")
534  #pragma map(deflateInit2_,"DEIN2")
535  #pragma map(deflateEnd,"DEEND")
536  #pragma map(deflateBound,"DEBND")
537  #pragma map(inflateInit_,"ININ")
538  #pragma map(inflateInit2_,"ININ2")
539  #pragma map(inflateEnd,"INEND")
540  #pragma map(inflateSync,"INSY")
541  #pragma map(inflateSetDictionary,"INSEDI")
542  #pragma map(compressBound,"CMBND")
543  #pragma map(inflate_table,"INTABL")
544  #pragma map(inflate_fast,"INFA")
545  #pragma map(inflate_copyright,"INCOPY")
546 #endif
547 
548 #endif /* ZCONF_H */
unsigned long z_size_t
Definition: zconf.h:262
unsigned long z_crc_t
Definition: zconf.h:438
#define intf
Definition: zconf.h:157
#define voidpf
Definition: zconf.h:165
unsigned char Byte
Definition: zconf.h:398
#define Bytef
Definition: zconf.h:147
unsigned long uLong
Definition: zconf.h:401
#define voidp
Definition: zconf.h:163
#define charf
Definition: zconf.h:149
#define uLongf
Definition: zconf.h:162
#define Byte
Definition: zconf.h:146
#define uLong
Definition: zconf.h:161
#define voidpc
Definition: zconf.h:164
#define uInt
Definition: zconf.h:159
#define FAR
Definition: zconf.h:394
#define uIntf
Definition: zconf.h:160
unsigned int uInt
Definition: zconf.h:400