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-2010 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 46 /* all linked symbols */ 47 # define _dist_code z__dist_code 48 # define _length_code z__length_code 49 # define _tr_align z__tr_align 50 # define _tr_flush_block z__tr_flush_block 51 # define _tr_init z__tr_init 52 # define _tr_stored_block z__tr_stored_block 53 # define _tr_tally z__tr_tally 54 # define adler32 z_adler32 55 # define adler32_combine z_adler32_combine 56 # define adler32_combine64 z_adler32_combine64 57 # define compress z_compress 58 # define compress2 z_compress2 59 # define compressBound z_compressBound 60 # define crc32 z_crc32 61 # define crc32_combine z_crc32_combine 62 # define crc32_combine64 z_crc32_combine64 63 # define deflate z_deflate 64 # define deflateBound z_deflateBound 65 # define deflateCopy z_deflateCopy 66 # define deflateEnd z_deflateEnd 67 # define deflateInit2_ z_deflateInit2_ 68 # define deflateInit_ z_deflateInit_ 69 # define deflateParams z_deflateParams 70 # define deflatePrime z_deflatePrime 71 # define deflateReset z_deflateReset 72 # define deflateSetDictionary z_deflateSetDictionary 73 # define deflateSetHeader z_deflateSetHeader 74 # define deflateTune z_deflateTune 75 # define deflate_copyright z_deflate_copyright 76 # define get_crc_table z_get_crc_table 77 # define gz_error z_gz_error 78 # define gz_intmax z_gz_intmax 79 # define gz_strwinerror z_gz_strwinerror 80 # define gzbuffer z_gzbuffer 81 # define gzclearerr z_gzclearerr 82 # define gzclose z_gzclose 83 # define gzclose_r z_gzclose_r 84 # define gzclose_w z_gzclose_w 85 # define gzdirect z_gzdirect 86 # define gzdopen z_gzdopen 87 # define gzeof z_gzeof 88 # define gzerror z_gzerror 89 # define gzflush z_gzflush 90 # define gzgetc z_gzgetc 91 # define gzgets z_gzgets 92 # define gzoffset z_gzoffset 93 # define gzoffset64 z_gzoffset64 94 # define gzopen z_gzopen 95 # define gzopen64 z_gzopen64 96 # define gzprintf z_gzprintf 97 # define gzputc z_gzputc 98 # define gzputs z_gzputs 99 # define gzread z_gzread 100 # define gzrewind z_gzrewind 101 # define gzseek z_gzseek 102 # define gzseek64 z_gzseek64 103 # define gzsetparams z_gzsetparams 104 # define gztell z_gztell 105 # define gztell64 z_gztell64 106 # define gzungetc z_gzungetc 107 # define gzwrite z_gzwrite 108 # define inflate z_inflate 109 # define inflateBack z_inflateBack 110 # define inflateBackEnd z_inflateBackEnd 111 # define inflateBackInit_ z_inflateBackInit_ 112 # define inflateCopy z_inflateCopy 113 # define inflateEnd z_inflateEnd 114 # define inflateGetHeader z_inflateGetHeader 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 inflateSetDictionary z_inflateSetDictionary 122 # define inflateSync z_inflateSync 123 # define inflateSyncPoint z_inflateSyncPoint 124 # define inflateUndermine z_inflateUndermine 125 # define inflate_copyright z_inflate_copyright 126 # define inflate_fast z_inflate_fast 127 # define inflate_table z_inflate_table 128 # define uncompress z_uncompress 129 # define zError z_zError 130 # define zcalloc z_zcalloc 131 # define zcfree z_zcfree 132 # define zlibCompileFlags z_zlibCompileFlags 133 # define zlibVersion z_zlibVersion 134 135 /* all zlib typedefs in zlib.h and zconf.h */ 136 # define Byte z_Byte 137 # define Bytef z_Bytef 138 # define alloc_func z_alloc_func 139 # define charf z_charf 140 # define free_func z_free_func 141 # define gzFile z_gzFile 142 # define gz_header z_gz_header 143 # define gz_headerp z_gz_headerp 144 # define in_func z_in_func 145 # define intf z_intf 146 # define out_func z_out_func 147 # define uInt z_uInt 148 # define uIntf z_uIntf 149 # define uLong z_uLong 150 # define uLongf z_uLongf 151 # define voidp z_voidp 152 # define voidpc z_voidpc 153 # define voidpf z_voidpf 154 155 /* all zlib structs in zlib.h and zconf.h */ 156 # define gz_header_s z_gz_header_s 157 # define internal_state z_internal_state 158 159 #endif 160 161 #if defined(__MSDOS__) && !defined(MSDOS) 162 # define MSDOS 163 #endif 164 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) 165 # define OS2 166 #endif 167 #if defined(_WINDOWS) && !defined(WINDOWS) 168 # define WINDOWS 169 #endif 170 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) 171 # ifndef WIN32 172 # define WIN32 173 # endif 174 #endif 175 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) 176 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) 177 # ifndef SYS16BIT 178 # define SYS16BIT 179 # endif 180 # endif 181 #endif 182 183 /* 184 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more 185 * than 64k bytes at a time (needed on systems with 16-bit int). 186 */ 187 #ifdef SYS16BIT 188 # define MAXSEG_64K 189 #endif 190 #ifdef MSDOS 191 # define UNALIGNED_OK 192 #endif 193 194 #ifdef __STDC_VERSION__ 195 # ifndef STDC 196 # define STDC 197 # endif 198 # if __STDC_VERSION__ >= 199901L 199 # ifndef STDC99 200 # define STDC99 201 # endif 202 # endif 203 #endif 204 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) 205 # define STDC 206 #endif 207 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) 208 # define STDC 209 #endif 210 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) 211 # define STDC 212 #endif 213 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) 214 # define STDC 215 #endif 216 217 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ 218 # define STDC 219 #endif 220 221 #ifndef STDC 222 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ 223 # define const /* note: need a more gentle solution here */ 224 # endif 225 #endif 226 227 /* Some Mac compilers merge all .h files incorrectly: */ 228 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) 229 # define NO_DUMMY_DECL 230 #endif 231 232 /* Maximum value for memLevel in deflateInit2 */ 233 #ifndef MAX_MEM_LEVEL 234 # ifdef MAXSEG_64K 235 # define MAX_MEM_LEVEL 8 236 # else 237 # define MAX_MEM_LEVEL 9 238 # endif 239 #endif 240 241 /* Maximum value for windowBits in deflateInit2 and inflateInit2. 242 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files 243 * created by gzip. (Files created by minigzip can still be extracted by 244 * gzip.) 245 */ 246 #ifndef MAX_WBITS 247 # define MAX_WBITS 15 /* 32K LZ77 window */ 248 #endif 249 250 /* The memory requirements for deflate are (in bytes): 251 (1 << (windowBits+2)) + (1 << (memLevel+9)) 252 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) 253 plus a few kilobytes for small objects. For example, if you want to reduce 254 the default memory requirements from 256K to 128K, compile with 255 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" 256 Of course this will generally degrade compression (there's no free lunch). 257 258 The memory requirements for inflate are (in bytes) 1 << windowBits 259 that is, 32K for windowBits=15 (default value) plus a few kilobytes 260 for small objects. 261 */ 262 263 /* Type declarations */ 264 265 #ifndef OF /* function prototypes */ 266 # ifdef STDC 267 # define OF(args) args 268 # else 269 # define OF(args) () 270 # endif 271 #endif 272 273 /* The following definitions for FAR are needed only for MSDOS mixed 274 * model programming (small or medium model with some far allocations). 275 * This was tested only with MSC; for other MSDOS compilers you may have 276 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, 277 * just define FAR to be empty. 278 */ 279 #ifdef SYS16BIT 280 # if defined(M_I86SM) || defined(M_I86MM) 281 /* MSC small or medium model */ 282 # define SMALL_MEDIUM 283 # ifdef _MSC_VER 284 # define FAR _far 285 # else 286 # define FAR far 287 # endif 288 # endif 289 # if (defined(__SMALL__) || defined(__MEDIUM__)) 290 /* Turbo C small or medium model */ 291 # define SMALL_MEDIUM 292 # ifdef __BORLANDC__ 293 # define FAR _far 294 # else 295 # define FAR far 296 # endif 297 # endif 298 #endif 299 300 #if defined(WINDOWS) || defined(WIN32) 301 /* If building or using zlib as a DLL, define ZLIB_DLL. 302 * This is not mandatory, but it offers a little performance increase. 303 */ 304 # ifdef ZLIB_DLL 305 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) 306 # ifdef ZLIB_INTERNAL 307 # define ZEXTERN extern __declspec(dllexport) 308 # else 309 # define ZEXTERN extern __declspec(dllimport) 310 # endif 311 # endif 312 # endif /* ZLIB_DLL */ 313 /* If building or using zlib with the WINAPI/WINAPIV calling convention, 314 * define ZLIB_WINAPI. 315 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. 316 */ 317 # ifdef ZLIB_WINAPI 318 # ifdef FAR 319 # undef FAR 320 # endif 321 # include <windows.h> 322 /* No need for _export, use ZLIB.DEF instead. */ 323 /* For complete Windows compatibility, use WINAPI, not __stdcall. */ 324 # define ZEXPORT WINAPI 325 # ifdef WIN32 326 # define ZEXPORTVA WINAPIV 327 # else 328 # define ZEXPORTVA FAR CDECL 329 # endif 330 # endif 331 #endif 332 333 #if defined (__BEOS__) 334 # ifdef ZLIB_DLL 335 # ifdef ZLIB_INTERNAL 336 # define ZEXPORT __declspec(dllexport) 337 # define ZEXPORTVA __declspec(dllexport) 338 # else 339 # define ZEXPORT __declspec(dllimport) 340 # define ZEXPORTVA __declspec(dllimport) 341 # endif 342 # endif 343 #endif 344 345 #ifndef ZEXTERN 346 # define ZEXTERN extern 347 #endif 348 #ifndef ZEXPORT 349 # define ZEXPORT 350 #endif 351 #ifndef ZEXPORTVA 352 # define ZEXPORTVA 353 #endif 354 355 #ifndef FAR 356 # define FAR 357 #endif 358 359 #if !defined(__MACTYPES__) 360 typedef unsigned char Byte; /* 8 bits */ 361 #endif 362 typedef unsigned int uInt; /* 16 bits or more */ 363 #ifdef _LP64 364 typedef unsigned int uLong; /* 32 bits or more */ 365 #else 366 typedef unsigned long uLong; /* 32 bits or more */ 367 #endif 368 369 #ifdef SMALL_MEDIUM 370 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ 371 # define Bytef Byte FAR 372 #else 373 typedef Byte FAR Bytef; 374 #endif 375 typedef char FAR charf; 376 typedef int FAR intf; 377 typedef uInt FAR uIntf; 378 typedef uLong FAR uLongf; 379 380 #ifdef STDC 381 typedef void const *voidpc; 382 typedef void FAR *voidpf; 383 typedef void *voidp; 384 #else 385 typedef Byte const *voidpc; 386 typedef Byte FAR *voidpf; 387 typedef Byte *voidp; 388 #endif 389 390 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ 391 # define Z_HAVE_UNISTD_H 392 #endif 393 394 #ifdef STDC 395 # include <sys/types.h> /* for off_t */ 396 #endif 397 398 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and 399 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even 400 * though the former does not conform to the LFS document), but considering 401 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as 402 * equivalently requesting no 64-bit operations 403 */ 404 #if -_LARGEFILE64_SOURCE - -1 == 1 405 # undef _LARGEFILE64_SOURCE 406 #endif 407 408 #if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) 409 # include <unistd.h> /* for SEEK_* and off_t */ 410 # ifdef VMS 411 # include <unixio.h> /* for off_t */ 412 # endif 413 # ifndef z_off_t 414 # define z_off_t off_t 415 # endif 416 #endif 417 418 #ifndef SEEK_SET 419 # define SEEK_SET 0 /* Seek from beginning of file. */ 420 # define SEEK_CUR 1 /* Seek from current position. */ 421 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ 422 #endif 423 424 #ifndef z_off_t 425 # define z_off_t long 426 #endif 427 428 #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 429 # define z_off64_t off64_t 430 #else 431 # define z_off64_t z_off_t 432 #endif 433 434 #if defined(__OS400__) 435 # define NO_vsnprintf 436 #endif 437 438 #if defined(__MVS__) 439 # define NO_vsnprintf 440 #endif 441 442 /* MVS linker does not support external names larger than 8 bytes */ 443 #if defined(__MVS__) 444 #pragma map(deflateInit_,"DEIN") 445 #pragma map(deflateInit2_,"DEIN2") 446 #pragma map(deflateEnd,"DEEND") 447 #pragma map(deflateBound,"DEBND") 448 #pragma map(inflateInit_,"ININ") 449 #pragma map(inflateInit2_,"ININ2") 450 #pragma map(inflateEnd,"INEND") 451 #pragma map(inflateSync,"INSY") 452 #pragma map(inflateSetDictionary,"INSEDI") 453 #pragma map(compressBound,"CMBND") 454 #pragma map(inflate_table,"INTABL") 455 #pragma map(inflate_fast,"INFA") 456 #pragma map(inflate_copyright,"INCOPY") 457 #endif 458 459 #endif /* ZCONF_H */