1 /* 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * 4 * This code is free software; you can redistribute it and/or modify it 5 * under the terms of the GNU General Public License version 2 only, as 6 * published by the Free Software Foundation. Oracle designates this 7 * particular file as subject to the "Classpath" exception as provided 8 * by Oracle in the LICENSE file that accompanied this code. 9 * 10 * This code is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 * version 2 for more details (a copy is included in the LICENSE file that 14 * accompanied this code). 15 * 16 * You should have received a copy of the GNU General Public License version 17 * 2 along with this work; if not, write to the Free Software Foundation, 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 * 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 * or visit www.oracle.com if you need additional information or have any 22 * questions. 23 */ 24 25 /* zconf.h -- configuration of the zlib compression library 26 * Copyright (C) 1995-2013 Jean-loup Gailly. 27 * For conditions of distribution and use, see copyright notice in zlib.h 28 */ 29 30 /* @(#) $Id$ */ 31 32 #ifndef ZCONF_H 33 #define ZCONF_H 34 35 /* for _LP64 */ 36 #include <sys/types.h> 37 38 /* 39 * If you *really* need a unique prefix for all types and library functions, 40 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. 41 * Even better than compiling with -DZ_PREFIX would be to use configure to set 42 * this permanently in zconf.h using "./configure --zprefix". 43 */ 44 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ 45 # define Z_PREFIX_SET 46 47 /* all linked symbols */ 48 # define _dist_code z__dist_code 49 # define _length_code z__length_code 50 # define _tr_align z__tr_align 51 # define _tr_flush_bits z__tr_flush_bits 52 # define _tr_flush_block z__tr_flush_block 53 # define _tr_init z__tr_init 54 # define _tr_stored_block z__tr_stored_block 55 # define _tr_tally z__tr_tally 56 # define adler32 z_adler32 57 # define adler32_combine z_adler32_combine 58 # define adler32_combine64 z_adler32_combine64 59 # ifndef Z_SOLO 60 # define compress z_compress 61 # define compress2 z_compress2 62 # define compressBound z_compressBound 63 # endif 64 # define crc32 z_crc32 65 # define crc32_combine z_crc32_combine 66 # define crc32_combine64 z_crc32_combine64 67 # define deflate z_deflate 68 # define deflateBound z_deflateBound 69 # define deflateCopy z_deflateCopy 70 # define deflateEnd z_deflateEnd 71 # define deflateInit2_ z_deflateInit2_ 72 # define deflateInit_ z_deflateInit_ 73 # define deflateParams z_deflateParams 74 # define deflatePending z_deflatePending 75 # define deflatePrime z_deflatePrime 76 # define deflateReset z_deflateReset 77 # define deflateResetKeep z_deflateResetKeep 78 # define deflateSetDictionary z_deflateSetDictionary 79 # define deflateSetHeader z_deflateSetHeader 80 # define deflateTune z_deflateTune 81 # define deflate_copyright z_deflate_copyright 82 # define get_crc_table z_get_crc_table 83 # ifndef Z_SOLO 84 # define gz_error z_gz_error 85 # define gz_intmax z_gz_intmax 86 # define gz_strwinerror z_gz_strwinerror 87 # define gzbuffer z_gzbuffer 88 # define gzclearerr z_gzclearerr 89 # define gzclose z_gzclose 90 # define gzclose_r z_gzclose_r 91 # define gzclose_w z_gzclose_w 92 # define gzdirect z_gzdirect 93 # define gzdopen z_gzdopen 94 # define gzeof z_gzeof 95 # define gzerror z_gzerror 96 # define gzflush z_gzflush 97 # define gzgetc z_gzgetc 98 # define gzgetc_ z_gzgetc_ 99 # define gzgets z_gzgets 100 # define gzoffset z_gzoffset 101 # define gzoffset64 z_gzoffset64 102 # define gzopen z_gzopen 103 # define gzopen64 z_gzopen64 104 # ifdef _WIN32 105 # define gzopen_w z_gzopen_w 106 # endif 107 # define gzprintf z_gzprintf 108 # define gzvprintf z_gzvprintf 109 # define gzputc z_gzputc 110 # define gzputs z_gzputs 111 # define gzread z_gzread 112 # define gzrewind z_gzrewind 113 # define gzseek z_gzseek 114 # define gzseek64 z_gzseek64 115 # define gzsetparams z_gzsetparams 116 # define gztell z_gztell 117 # define gztell64 z_gztell64 118 # define gzungetc z_gzungetc 119 # define gzwrite z_gzwrite 120 # endif 121 # define inflate z_inflate 122 # define inflateBack z_inflateBack 123 # define inflateBackEnd z_inflateBackEnd 124 # define inflateBackInit_ z_inflateBackInit_ 125 # define inflateCopy z_inflateCopy 126 # define inflateEnd z_inflateEnd 127 # define inflateGetHeader z_inflateGetHeader 128 # define inflateInit2_ z_inflateInit2_ 129 # define inflateInit_ z_inflateInit_ 130 # define inflateMark z_inflateMark 131 # define inflatePrime z_inflatePrime 132 # define inflateReset z_inflateReset 133 # define inflateReset2 z_inflateReset2 134 # define inflateSetDictionary z_inflateSetDictionary 135 # define inflateGetDictionary z_inflateGetDictionary 136 # define inflateSync z_inflateSync 137 # define inflateSyncPoint z_inflateSyncPoint 138 # define inflateUndermine z_inflateUndermine 139 # define inflateResetKeep z_inflateResetKeep 140 # define inflate_copyright z_inflate_copyright 141 # define inflate_fast z_inflate_fast 142 # define inflate_table z_inflate_table 143 # ifndef Z_SOLO 144 # define uncompress z_uncompress 145 # endif 146 # define zError z_zError 147 # ifndef Z_SOLO 148 # define zcalloc z_zcalloc 149 # define zcfree z_zcfree 150 # endif 151 # define zlibCompileFlags z_zlibCompileFlags 152 # define zlibVersion z_zlibVersion 153 154 /* all zlib typedefs in zlib.h and zconf.h */ 155 # define Byte z_Byte 156 # define Bytef z_Bytef 157 # define alloc_func z_alloc_func 158 # define charf z_charf 159 # define free_func z_free_func 160 # ifndef Z_SOLO 161 # define gzFile z_gzFile 162 # endif 163 # define gz_header z_gz_header 164 # define gz_headerp z_gz_headerp 165 # define in_func z_in_func 166 # define intf z_intf 167 # define out_func z_out_func 168 # define uInt z_uInt 169 # define uIntf z_uIntf 170 # define uLong z_uLong 171 # define uLongf z_uLongf 172 # define voidp z_voidp 173 # define voidpc z_voidpc 174 # define voidpf z_voidpf 175 176 /* all zlib structs in zlib.h and zconf.h */ 177 # define gz_header_s z_gz_header_s 178 # define internal_state z_internal_state 179 180 #endif 181 182 #if defined(__MSDOS__) && !defined(MSDOS) 183 # define MSDOS 184 #endif 185 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) 186 # define OS2 187 #endif 188 #if defined(_WINDOWS) && !defined(WINDOWS) 189 # define WINDOWS 190 #endif 191 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) 192 # ifndef WIN32 193 # define WIN32 194 # endif 195 #endif 196 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) 197 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) 198 # ifndef SYS16BIT 199 # define SYS16BIT 200 # endif 201 # endif 202 #endif 203 204 /* 205 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more 206 * than 64k bytes at a time (needed on systems with 16-bit int). 207 */ 208 #ifdef SYS16BIT 209 # define MAXSEG_64K 210 #endif 211 #ifdef MSDOS 212 # define UNALIGNED_OK 213 #endif 214 215 #ifdef __STDC_VERSION__ 216 # ifndef STDC 217 # define STDC 218 # endif 219 # if __STDC_VERSION__ >= 199901L 220 # ifndef STDC99 221 # define STDC99 222 # endif 223 # endif 224 #endif 225 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) 226 # define STDC 227 #endif 228 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) 229 # define STDC 230 #endif 231 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) 232 # define STDC 233 #endif 234 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) 235 # define STDC 236 #endif 237 238 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ 239 # define STDC 240 #endif 241 242 #ifndef STDC 243 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ 244 # define const /* note: need a more gentle solution here */ 245 # endif 246 #endif 247 248 #if defined(ZLIB_CONST) && !defined(z_const) 249 # define z_const const 250 #else 251 # define z_const 252 #endif 253 254 /* Some Mac compilers merge all .h files incorrectly: */ 255 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) 256 # define NO_DUMMY_DECL 257 #endif 258 259 /* Maximum value for memLevel in deflateInit2 */ 260 #ifndef MAX_MEM_LEVEL 261 # ifdef MAXSEG_64K 262 # define MAX_MEM_LEVEL 8 263 # else 264 # define MAX_MEM_LEVEL 9 265 # endif 266 #endif 267 268 /* Maximum value for windowBits in deflateInit2 and inflateInit2. 269 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files 270 * created by gzip. (Files created by minigzip can still be extracted by 271 * gzip.) 272 */ 273 #ifndef MAX_WBITS 274 # define MAX_WBITS 15 /* 32K LZ77 window */ 275 #endif 276 277 /* The memory requirements for deflate are (in bytes): 278 (1 << (windowBits+2)) + (1 << (memLevel+9)) 279 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) 280 plus a few kilobytes for small objects. For example, if you want to reduce 281 the default memory requirements from 256K to 128K, compile with 282 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" 283 Of course this will generally degrade compression (there's no free lunch). 284 285 The memory requirements for inflate are (in bytes) 1 << windowBits 286 that is, 32K for windowBits=15 (default value) plus a few kilobytes 287 for small objects. 288 */ 289 290 /* Type declarations */ 291 292 #ifndef OF /* function prototypes */ 293 # ifdef STDC 294 # define OF(args) args 295 # else 296 # define OF(args) () 297 # endif 298 #endif 299 300 #ifndef Z_ARG /* function prototypes for stdarg */ 301 # if defined(STDC) || defined(Z_HAVE_STDARG_H) 302 # define Z_ARG(args) args 303 # else 304 # define Z_ARG(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 # include <windows.h> 357 /* No need for _export, use ZLIB.DEF instead. */ 358 /* For complete Windows compatibility, use WINAPI, not __stdcall. */ 359 # define ZEXPORT WINAPI 360 # ifdef WIN32 361 # define ZEXPORTVA WINAPIV 362 # else 363 # define ZEXPORTVA FAR CDECL 364 # endif 365 # endif 366 #endif 367 368 #if defined (__BEOS__) 369 # ifdef ZLIB_DLL 370 # ifdef ZLIB_INTERNAL 371 # define ZEXPORT __declspec(dllexport) 372 # define ZEXPORTVA __declspec(dllexport) 373 # else 374 # define ZEXPORT __declspec(dllimport) 375 # define ZEXPORTVA __declspec(dllimport) 376 # endif 377 # endif 378 #endif 379 380 #ifndef ZEXTERN 381 # define ZEXTERN extern 382 #endif 383 #ifndef ZEXPORT 384 # define ZEXPORT 385 #endif 386 #ifndef ZEXPORTVA 387 # define ZEXPORTVA 388 #endif 389 390 #ifndef FAR 391 # define FAR 392 #endif 393 394 #if !defined(__MACTYPES__) 395 typedef unsigned char Byte; /* 8 bits */ 396 #endif 397 typedef unsigned int uInt; /* 16 bits or more */ 398 399 #ifdef _LP64 400 typedef unsigned int uLong; /* 32 bits or more */ 401 #else 402 typedef unsigned long uLong; /* 32 bits or more */ 403 #endif 404 405 #ifdef SMALL_MEDIUM 406 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ 407 # define Bytef Byte FAR 408 #else 409 typedef Byte FAR Bytef; 410 #endif 411 typedef char FAR charf; 412 typedef int FAR intf; 413 typedef uInt FAR uIntf; 414 typedef uLong FAR uLongf; 415 416 #ifdef STDC 417 typedef void const *voidpc; 418 typedef void FAR *voidpf; 419 typedef void *voidp; 420 #else 421 typedef Byte const *voidpc; 422 typedef Byte FAR *voidpf; 423 typedef Byte *voidp; 424 #endif 425 426 #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) 427 # include <limits.h> 428 # if (UINT_MAX == 0xffffffffUL) 429 # define Z_U4 unsigned 430 # elif (ULONG_MAX == 0xffffffffUL) 431 # define Z_U4 unsigned long 432 # elif (USHRT_MAX == 0xffffffffUL) 433 # define Z_U4 unsigned short 434 # endif 435 #endif 436 437 #ifdef Z_U4 438 typedef Z_U4 z_crc_t; 439 #else 440 typedef unsigned long z_crc_t; 441 #endif 442 443 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ 444 # define Z_HAVE_UNISTD_H 445 #endif 446 447 #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ 448 # define Z_HAVE_STDARG_H 449 #endif 450 451 #ifdef STDC 452 # ifndef Z_SOLO 453 # include <sys/types.h> /* for off_t */ 454 # endif 455 #endif 456 457 #if defined(STDC) || defined(Z_HAVE_STDARG_H) 458 # ifndef Z_SOLO 459 # include <stdarg.h> /* for va_list */ 460 # endif 461 #endif 462 463 #ifdef _WIN32 464 # ifndef Z_SOLO 465 # include <stddef.h> /* for wchar_t */ 466 # endif 467 #endif 468 469 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and 470 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even 471 * though the former does not conform to the LFS document), but considering 472 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as 473 * equivalently requesting no 64-bit operations 474 */ 475 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 476 # undef _LARGEFILE64_SOURCE 477 #endif 478 479 #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) 480 # define Z_HAVE_UNISTD_H 481 #endif 482 #ifndef Z_SOLO 483 # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) 484 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ 485 # ifdef VMS 486 # include <unixio.h> /* for off_t */ 487 # endif 488 # ifndef z_off_t 489 # define z_off_t off_t 490 # endif 491 # endif 492 #endif 493 494 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 495 # define Z_LFS64 496 #endif 497 498 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) 499 # define Z_LARGE64 500 #endif 501 502 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) 503 # define Z_WANT64 504 #endif 505 506 #if !defined(SEEK_SET) && !defined(Z_SOLO) 507 # define SEEK_SET 0 /* Seek from beginning of file. */ 508 # define SEEK_CUR 1 /* Seek from current position. */ 509 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ 510 #endif 511 512 #ifndef z_off_t 513 # define z_off_t long 514 #endif 515 516 #if !defined(_WIN32) && defined(Z_LARGE64) 517 # define z_off64_t off64_t 518 #else 519 # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) 520 # define z_off64_t __int64 521 # else 522 # define z_off64_t z_off_t 523 # endif 524 #endif 525 526 /* MVS linker does not support external names larger than 8 bytes */ 527 #if defined(__MVS__) 528 #pragma map(deflateInit_,"DEIN") 529 #pragma map(deflateInit2_,"DEIN2") 530 #pragma map(deflateEnd,"DEEND") 531 #pragma map(deflateBound,"DEBND") 532 #pragma map(inflateInit_,"ININ") 533 #pragma map(inflateInit2_,"ININ2") 534 #pragma map(inflateEnd,"INEND") 535 #pragma map(inflateSync,"INSY") 536 #pragma map(inflateSetDictionary,"INSEDI") 537 #pragma map(compressBound,"CMBND") 538 #pragma map(inflate_table,"INTABL") 539 #pragma map(inflate_fast,"INFA") 540 #pragma map(inflate_copyright,"INCOPY") 541 #endif 542 543 #endif /* ZCONF_H */