NCBI C++ ToolKit
zconf.h
Go to the documentation of this file.

Go to the SVN repository for this file.

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
4  */
5 
6 /* @(#) $Id: zconf.h 101277 2023-11-27 15:02:00Z ivanov $ */
7 
8 #ifndef ZCONF_H
9 #define ZCONF_H
10 #include <stdint.h>
11 
12 #define Z_PREFIX
13 
14 /*
15  * If you *really* need a unique prefix for all types and library functions,
16  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
17  * Even better than compiling with -DZ_PREFIX would be to use configure to set
18  * this permanently in zconf.h using "./configure --zprefix".
19  */
20 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
21 # define Z_PREFIX_SET
22 
23 /* all linked symbols and init macros */
24 # define _dist_code z__dist_code
25 # define _length_code z__length_code
26 # define _tr_align z__tr_align
27 # define _tr_flush_bits z__tr_flush_bits
28 # define _tr_flush_block z__tr_flush_block
29 # define _tr_init z__tr_init
30 # define _tr_stored_block z__tr_stored_block
31 # define _tr_tally z__tr_tally
32 # define adler32 z_adler32
33 # define adler32_combine z_adler32_combine
34 # define adler32_combine64 z_adler32_combine64
35 # define adler32_z z_adler32_z
36 # ifndef Z_SOLO
37 # define compress z_compress
38 # define compress2 z_compress2
39 # define compressBound z_compressBound
40 # endif
41 # define crc32 z_crc32
42 # define crc32_combine z_crc32_combine
43 # define crc32_combine64 z_crc32_combine64
44 # define deflate z_deflate
45 # define deflateBound z_deflateBound
46 # define deflateCopy z_deflateCopy
47 # define deflateEnd z_deflateEnd
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
60 # ifndef Z_SOLO
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
81 # ifdef _WIN32
82 # define gzopen_w z_gzopen_w
83 # endif
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
97 # endif
98 # define inflate z_inflate
99 # define inflateBack z_inflateBack
100 # define inflateBackEnd z_inflateBackEnd
101 # define inflateBackInit_ z_inflateBackInit_
102 # define inflateCopy z_inflateCopy
103 # define inflateEnd z_inflateEnd
104 # define inflateGetHeader z_inflateGetHeader
105 # define inflateInit2_ z_inflateInit2_
106 # define inflateInit_ z_inflateInit_
107 # define inflateMark z_inflateMark
108 # define inflatePrime z_inflatePrime
109 # define inflateReset z_inflateReset
110 # define inflateReset2 z_inflateReset2
111 # define inflateSetDictionary z_inflateSetDictionary
112 # define inflateGetDictionary z_inflateGetDictionary
113 # define inflateSync z_inflateSync
114 # define inflateSyncPoint z_inflateSyncPoint
115 # define inflateUndermine z_inflateUndermine
116 # define inflateResetKeep z_inflateResetKeep
117 # define inflateValidate z_inflateValidate
118 # define inflate_copyright z_inflate_copyright
119 # define inflate_fast z_inflate_fast
120 # define inflate_table z_inflate_table
121 # ifndef Z_SOLO
122 # define uncompress z_uncompress
123 # endif
124 # define zError z_zError
125 # ifndef Z_SOLO
126 # define zcalloc z_zcalloc
127 # define zcfree z_zcfree
128 # endif
129 # define zlibCompileFlags z_zlibCompileFlags
130 # define zlibVersion z_zlibVersion
131 
132 /* all zlib typedefs in zlib.h and zconf.h */
133 # define Byte z_Byte
134 # define Bytef z_Bytef
135 # define alloc_func z_alloc_func
136 # define charf z_charf
137 # define free_func z_free_func
138 # ifndef Z_SOLO
139 # define gzFile z_gzFile
140 # endif
141 # define gz_header z_gz_header
142 # define gz_headerp z_gz_headerp
143 # define in_func z_in_func
144 # define intf z_intf
145 # define out_func z_out_func
146 # define uInt z_uInt
147 # define uIntf z_uIntf
148 # define uLong z_uLong
149 # define uLongf z_uLongf
150 # define voidp z_voidp
151 # define voidpc z_voidpc
152 # define voidpf z_voidpf
153 
154 /* all zlib structs in zlib.h and zconf.h */
155 # define gz_header_s z_gz_header_s
156 # define internal_state z_internal_state
157 
158 #endif
159 
160 #if defined(__MSDOS__) && !defined(MSDOS)
161 # define MSDOS
162 #endif
163 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
164 # define OS2
165 #endif
166 #if defined(_WINDOWS) && !defined(WINDOWS)
167 # define WINDOWS
168 #endif
169 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
170 # ifndef WIN32
171 # define WIN32
172 # endif
173 #endif
174 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
175 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
176 # ifndef SYS16BIT
177 # define SYS16BIT
178 # endif
179 # endif
180 #endif
181 
182 /*
183  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
184  * than 64k bytes at a time (needed on systems with 16-bit int).
185  */
186 #ifdef SYS16BIT
187 # define MAXSEG_64K
188 #endif
189 #ifdef MSDOS
190 # define UNALIGNED_OK
191 #endif
192 
193 #ifdef __STDC_VERSION__
194 # ifndef STDC
195 # define STDC
196 # endif
197 # if __STDC_VERSION__ >= 199901L
198 # ifndef STDC99
199 # define STDC99
200 # endif
201 # endif
202 #endif
203 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
204 # define STDC
205 #endif
206 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
207 # define STDC
208 #endif
209 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
210 # define STDC
211 #endif
212 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
213 # define STDC
214 #endif
215 
216 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
217 # define STDC
218 #endif
219 
220 #ifndef STDC
221 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
222 # define const /* note: need a more gentle solution here */
223 # endif
224 #endif
225 
226 #if defined(ZLIB_CONST) && !defined(z_const)
227 # define z_const const
228 #else
229 # define z_const
230 #endif
231 
232 #ifndef Z_SOLO
233 # ifdef NO_SIZE_T
234  typedef unsigned NO_SIZE_T z_size_t;
235 # else
236 # include <stddef.h>
237  typedef size_t z_size_t;
238 # endif
239 # ifdef NO_SSIZE_T
240  typedef NO_SSIZE_T z_ssize_t;
241 # else
242 # include <stddef.h>
243 # include <sys/types.h>
244 # ifdef _MSC_VER
245  typedef intptr_t z_ssize_t;
246 # else
248 # endif
249 # endif
250 #endif
251 
252 /* Maximum value for memLevel in deflateInit2 */
253 #ifndef MAX_MEM_LEVEL
254 # ifdef MAXSEG_64K
255 # define MAX_MEM_LEVEL 8
256 # else
257 # define MAX_MEM_LEVEL 9
258 # endif
259 #endif
260 
261 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
262  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
263  * created by gzip. (Files created by minigzip can still be extracted by
264  * gzip.)
265  */
266 #ifndef MAX_WBITS
267 # define MAX_WBITS 15 /* 32K LZ77 window */
268 #endif
269 
270 /* The memory requirements for deflate are (in bytes):
271  (1 << (windowBits+2)) + (1 << (memLevel+9))
272  that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
273  plus a few kilobytes for small objects. For example, if you want to reduce
274  the default memory requirements from 256K to 128K, compile with
275  make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
276  Of course this will generally degrade compression (there's no free lunch).
277 
278  The memory requirements for inflate are (in bytes) 1 << windowBits
279  that is, 32K for windowBits=15 (default value) plus a few kilobytes
280  for small objects.
281 */
282 
283 /* The following definitions for FAR are needed only for MSDOS mixed
284  * model programming (small or medium model with some far allocations).
285  * This was tested only with MSC; for other MSDOS compilers you may have
286  * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
287  * just define FAR to be empty.
288  */
289 #ifdef SYS16BIT
290 # if defined(M_I86SM) || defined(M_I86MM)
291  /* MSC small or medium model */
292 # define SMALL_MEDIUM
293 # ifdef _MSC_VER
294 # define FAR _far
295 # else
296 # define FAR far
297 # endif
298 # endif
299 # if (defined(__SMALL__) || defined(__MEDIUM__))
300  /* Turbo C small or medium model */
301 # define SMALL_MEDIUM
302 # ifdef __BORLANDC__
303 # define FAR _far
304 # else
305 # define FAR far
306 # endif
307 # endif
308 #endif
309 
310 #if defined(WINDOWS) || defined(WIN32)
311  /* If building or using zlib as a DLL, define ZLIB_DLL.
312  * This is not mandatory, but it offers a little performance increase.
313  */
314 # ifdef ZLIB_DLL
315 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
316 # ifdef ZLIB_INTERNAL
317 # define ZEXTERN extern __declspec(dllexport)
318 # else
319 # define ZEXTERN extern __declspec(dllimport)
320 # endif
321 # endif
322 # endif /* ZLIB_DLL */
323  /* If building or using zlib with the WINAPI/WINAPIV calling convention,
324  * define ZLIB_WINAPI.
325  * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
326  */
327 # ifdef ZLIB_WINAPI
328 # ifdef FAR
329 # undef FAR
330 # endif
331 # ifndef WIN32_LEAN_AND_MEAN
332 # define WIN32_LEAN_AND_MEAN
333 # endif
334 # include <windows.h>
335  /* No need for _export, use ZLIB.DEF instead. */
336  /* For complete Windows compatibility, use WINAPI, not __stdcall. */
337 # define ZEXPORT WINAPI
338 # ifdef WIN32
339 # define ZEXPORTVA WINAPIV
340 # else
341 # define ZEXPORTVA FAR CDECL
342 # endif
343 # endif
344 #endif
345 
346 #if defined (__BEOS__)
347 # ifdef ZLIB_DLL
348 # ifdef ZLIB_INTERNAL
349 # define ZEXPORT __declspec(dllexport)
350 # define ZEXPORTVA __declspec(dllexport)
351 # else
352 # define ZEXPORT __declspec(dllimport)
353 # define ZEXPORTVA __declspec(dllimport)
354 # endif
355 # endif
356 #endif
357 
358 #ifndef ZEXTERN
359 # define ZEXTERN extern
360 #endif
361 #ifndef ZEXPORT
362 # define ZEXPORT
363 #endif
364 #ifndef ZEXPORTVA
365 # define ZEXPORTVA
366 #endif
367 
368 #ifndef FAR
369 # define FAR
370 #endif
371 
372 #if !defined(__MACTYPES__)
373 typedef uint8_t Byte; /* 8 bits */
374 #endif
375 typedef uint32_t uInt; /* 32 bits */
376 typedef uint64_t uLong; /* 64 bits */
377 
378 #ifdef SMALL_MEDIUM
379  /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
380 # define Bytef Byte FAR
381 #else
382  typedef Byte FAR Bytef;
383 #endif
384 typedef char FAR charf;
385 typedef int FAR intf;
386 typedef uInt FAR uIntf;
387 typedef uLong FAR uLongf;
388 
389 #ifdef STDC
390  typedef void const *voidpc;
391  typedef void FAR *voidpf;
392  typedef void *voidp;
393 #else
394  typedef Byte const *voidpc;
395  typedef Byte FAR *voidpf;
396  typedef Byte *voidp;
397 #endif
398 
399 #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
400 # include <limits.h>
401 # if (UINT_MAX == 0xffffffffUL)
402 # define Z_U4 unsigned
403 # elif (ULONG_MAX == 0xffffffffUL)
404 # define Z_U4 unsigned long
405 # elif (USHRT_MAX == 0xffffffffUL)
406 # define Z_U4 unsigned short
407 # endif
408 #endif
409 
410 #ifdef Z_U4
411  typedef Z_U4 z_crc_t;
412 #else
413  typedef unsigned long z_crc_t;
414 #endif
415 
416 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
417 # define Z_HAVE_UNISTD_H
418 #endif
419 
420 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
421 # define Z_HAVE_STDARG_H
422 #endif
423 
424 #ifdef STDC
425 # ifndef Z_SOLO
426 # include <sys/types.h> /* for off_t */
427 # endif
428 #endif
429 
430 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
431 # ifndef Z_SOLO
432 # include <stdarg.h> /* for va_list */
433 # endif
434 #endif
435 
436 #ifdef _WIN32
437 # ifndef Z_SOLO
438 # include <stddef.h> /* for wchar_t */
439 # endif
440 #endif
441 
442 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
443  * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
444  * though the former does not conform to the LFS document), but considering
445  * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
446  * equivalently requesting no 64-bit operations
447  */
448 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
449 # undef _LARGEFILE64_SOURCE
450 #endif
451 
452 #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
453 # define Z_HAVE_UNISTD_H
454 #endif
455 #ifndef Z_SOLO
456 # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
457 # ifdef _WIN32 /* _MSC_VER doesn't work for some reason when building dll*/
458 # include <io.h>
459 # else
460 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
461 # endif
462 # ifdef VMS
463 # include <unixio.h> /* for off_t */
464 # endif
465 # ifndef z_off_t
466 # define z_off_t off_t
467 # endif
468 # endif
469 #endif
470 
471 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
472 # define Z_LFS64
473 #endif
474 
475 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
476 # define Z_LARGE64
477 #endif
478 
479 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
480 # define Z_WANT64
481 #endif
482 
483 #if !defined(SEEK_SET) && !defined(Z_SOLO)
484 # define SEEK_SET 0 /* Seek from beginning of file. */
485 # define SEEK_CUR 1 /* Seek from current position. */
486 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
487 #endif
488 
489 #ifndef z_off_t
490 # define z_off_t long
491 #endif
492 
493 #if !defined(_WIN32) && defined(Z_LARGE64)
494 # define z_off64_t off64_t
495 #else
496 # if defined(_WIN32) && !defined(__GNUC__)
497 # define z_off64_t __int64
498 # else
499 # define z_off64_t z_off_t
500 # endif
501 #endif
502 
503 /* MVS linker does not support external names larger than 8 bytes */
504 #if defined(__MVS__)
505  #pragma map(deflateInit_,"DEIN")
506  #pragma map(deflateInit2_,"DEIN2")
507  #pragma map(deflateEnd,"DEEND")
508  #pragma map(deflateBound,"DEBND")
509  #pragma map(inflateInit_,"ININ")
510  #pragma map(inflateInit2_,"ININ2")
511  #pragma map(inflateEnd,"INEND")
512  #pragma map(inflateSync,"INSY")
513  #pragma map(inflateSetDictionary,"INSEDI")
514  #pragma map(compressBound,"CMBND")
515  #pragma map(inflate_table,"INTABL")
516  #pragma map(inflate_fast,"INFA")
517  #pragma map(inflate_copyright,"INCOPY")
518 #endif
519 
520 #endif /* ZCONF_H */
int intptr_t
Definition: ncbitype.h:185
int ssize_t
Definition: ncbiconf_msvc.h:92
unsigned int uint32_t
Definition: stdint.h:126
unsigned char uint8_t
Definition: stdint.h:124
unsigned __int64 uint64_t
Definition: stdint.h:136
unsigned long z_crc_t
Definition: zconf.h:431
unsigned int uInt
Definition: zconf.h:393
unsigned long z_size_t
Definition: zconf.h:250
unsigned long uLong
Definition: zconf.h:394
unsigned char Byte
Definition: zconf.h:391
ssize_t z_ssize_t
Definition: zconf.h:247
#define voidpf
Definition: zconf.h:152
#define uLongf
Definition: zconf.h:149
#define voidpc
Definition: zconf.h:151
#define uInt
Definition: zconf.h:146
#define Byte
Definition: zconf.h:133
#define intf
Definition: zconf.h:144
#define uIntf
Definition: zconf.h:147
#define voidp
Definition: zconf.h:150
#define uLong
Definition: zconf.h:148
#define charf
Definition: zconf.h:136
#define FAR
Definition: zconf.h:369
#define Bytef
Definition: zconf.h:134
Modified on Sun Mar 03 03:14:37 2024 by modify_doxy.py rev. 669887