Path: blob/master/src/java.base/share/native/libzip/zlib/zconf.h
41153 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/* zconf.h -- configuration of the zlib compression library25* Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler26* For conditions of distribution and use, see copyright notice in zlib.h27*/2829/* @(#) $Id$ */3031#ifndef ZCONF_H32#define ZCONF_H3334/* for _LP64 */35#include <sys/types.h>3637/*38* If you *really* need a unique prefix for all types and library functions,39* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.40* Even better than compiling with -DZ_PREFIX would be to use configure to set41* this permanently in zconf.h using "./configure --zprefix".42*/43#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */44# define Z_PREFIX_SET4546/* all linked symbols and init macros */47# define _dist_code z__dist_code48# define _length_code z__length_code49# define _tr_align z__tr_align50# define _tr_flush_bits z__tr_flush_bits51# define _tr_flush_block z__tr_flush_block52# define _tr_init z__tr_init53# define _tr_stored_block z__tr_stored_block54# define _tr_tally z__tr_tally55# define adler32 z_adler3256# define adler32_combine z_adler32_combine57# define adler32_combine64 z_adler32_combine6458# define adler32_z z_adler32_z59# ifndef Z_SOLO60# define compress z_compress61# define compress2 z_compress262# define compressBound z_compressBound63# endif64# define crc32 z_crc3265# define crc32_combine z_crc32_combine66# define crc32_combine64 z_crc32_combine6467# define crc32_z z_crc32_z68# define deflate z_deflate69# define deflateBound z_deflateBound70# define deflateCopy z_deflateCopy71# define deflateEnd z_deflateEnd72# define deflateGetDictionary z_deflateGetDictionary73# define deflateInit z_deflateInit74# define deflateInit2 z_deflateInit275# define deflateInit2_ z_deflateInit2_76# define deflateInit_ z_deflateInit_77# define deflateParams z_deflateParams78# define deflatePending z_deflatePending79# define deflatePrime z_deflatePrime80# define deflateReset z_deflateReset81# define deflateResetKeep z_deflateResetKeep82# define deflateSetDictionary z_deflateSetDictionary83# define deflateSetHeader z_deflateSetHeader84# define deflateTune z_deflateTune85# define deflate_copyright z_deflate_copyright86# define get_crc_table z_get_crc_table87# ifndef Z_SOLO88# define gz_error z_gz_error89# define gz_intmax z_gz_intmax90# define gz_strwinerror z_gz_strwinerror91# define gzbuffer z_gzbuffer92# define gzclearerr z_gzclearerr93# define gzclose z_gzclose94# define gzclose_r z_gzclose_r95# define gzclose_w z_gzclose_w96# define gzdirect z_gzdirect97# define gzdopen z_gzdopen98# define gzeof z_gzeof99# define gzerror z_gzerror100# define gzflush z_gzflush101# define gzfread z_gzfread102# define gzfwrite z_gzfwrite103# define gzgetc z_gzgetc104# define gzgetc_ z_gzgetc_105# define gzgets z_gzgets106# define gzoffset z_gzoffset107# define gzoffset64 z_gzoffset64108# define gzopen z_gzopen109# define gzopen64 z_gzopen64110# ifdef _WIN32111# define gzopen_w z_gzopen_w112# endif113# define gzprintf z_gzprintf114# define gzputc z_gzputc115# define gzputs z_gzputs116# define gzread z_gzread117# define gzrewind z_gzrewind118# define gzseek z_gzseek119# define gzseek64 z_gzseek64120# define gzsetparams z_gzsetparams121# define gztell z_gztell122# define gztell64 z_gztell64123# define gzungetc z_gzungetc124# define gzvprintf z_gzvprintf125# define gzwrite z_gzwrite126# endif127# define inflate z_inflate128# define inflateBack z_inflateBack129# define inflateBackEnd z_inflateBackEnd130# define inflateBackInit z_inflateBackInit131# define inflateBackInit_ z_inflateBackInit_132# define inflateCodesUsed z_inflateCodesUsed133# define inflateCopy z_inflateCopy134# define inflateEnd z_inflateEnd135# define inflateGetDictionary z_inflateGetDictionary136# define inflateGetHeader z_inflateGetHeader137# define inflateInit z_inflateInit138# define inflateInit2 z_inflateInit2139# define inflateInit2_ z_inflateInit2_140# define inflateInit_ z_inflateInit_141# define inflateMark z_inflateMark142# define inflatePrime z_inflatePrime143# define inflateReset z_inflateReset144# define inflateReset2 z_inflateReset2145# define inflateResetKeep z_inflateResetKeep146# define inflateSetDictionary z_inflateSetDictionary147# define inflateSync z_inflateSync148# define inflateSyncPoint z_inflateSyncPoint149# define inflateUndermine z_inflateUndermine150# define inflateValidate z_inflateValidate151# define inflate_copyright z_inflate_copyright152# define inflate_fast z_inflate_fast153# define inflate_table z_inflate_table154# ifndef Z_SOLO155# define uncompress z_uncompress156# define uncompress2 z_uncompress2157# endif158# define zError z_zError159# ifndef Z_SOLO160# define zcalloc z_zcalloc161# define zcfree z_zcfree162# endif163# define zlibCompileFlags z_zlibCompileFlags164# define zlibVersion z_zlibVersion165166/* all zlib typedefs in zlib.h and zconf.h */167# define Byte z_Byte168# define Bytef z_Bytef169# define alloc_func z_alloc_func170# define charf z_charf171# define free_func z_free_func172# ifndef Z_SOLO173# define gzFile z_gzFile174# endif175# define gz_header z_gz_header176# define gz_headerp z_gz_headerp177# define in_func z_in_func178# define intf z_intf179# define out_func z_out_func180# define uInt z_uInt181# define uIntf z_uIntf182# define uLong z_uLong183# define uLongf z_uLongf184# define voidp z_voidp185# define voidpc z_voidpc186# define voidpf z_voidpf187188/* all zlib structs in zlib.h and zconf.h */189# define gz_header_s z_gz_header_s190# define internal_state z_internal_state191192#endif193194#if defined(__MSDOS__) && !defined(MSDOS)195# define MSDOS196#endif197#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)198# define OS2199#endif200#if defined(_WINDOWS) && !defined(WINDOWS)201# define WINDOWS202#endif203#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)204# ifndef WIN32205# define WIN32206# endif207#endif208#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)209# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)210# ifndef SYS16BIT211# define SYS16BIT212# endif213# endif214#endif215216/*217* Compile with -DMAXSEG_64K if the alloc function cannot allocate more218* than 64k bytes at a time (needed on systems with 16-bit int).219*/220#ifdef SYS16BIT221# define MAXSEG_64K222#endif223#ifdef MSDOS224# define UNALIGNED_OK225#endif226227#ifdef __STDC_VERSION__228# ifndef STDC229# define STDC230# endif231# if __STDC_VERSION__ >= 199901L232# ifndef STDC99233# define STDC99234# endif235# endif236#endif237#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))238# define STDC239#endif240#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))241# define STDC242#endif243#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))244# define STDC245#endif246#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))247# define STDC248#endif249250#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */251# define STDC252#endif253254#ifndef STDC255# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */256# define const /* note: need a more gentle solution here */257# endif258#endif259260#if defined(ZLIB_CONST) && !defined(z_const)261# define z_const const262#else263# define z_const264#endif265266#ifdef Z_SOLO267typedef unsigned long z_size_t;268#else269# define z_longlong long long270# if defined(NO_SIZE_T)271typedef unsigned NO_SIZE_T z_size_t;272# elif defined(STDC)273# include <stddef.h>274typedef size_t z_size_t;275# else276typedef unsigned long z_size_t;277# endif278# undef z_longlong279#endif280281/* Maximum value for memLevel in deflateInit2 */282#ifndef MAX_MEM_LEVEL283# ifdef MAXSEG_64K284# define MAX_MEM_LEVEL 8285# else286# define MAX_MEM_LEVEL 9287# endif288#endif289290/* Maximum value for windowBits in deflateInit2 and inflateInit2.291* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files292* created by gzip. (Files created by minigzip can still be extracted by293* gzip.)294*/295#ifndef MAX_WBITS296# define MAX_WBITS 15 /* 32K LZ77 window */297#endif298299/* The memory requirements for deflate are (in bytes):300(1 << (windowBits+2)) + (1 << (memLevel+9))301that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)302plus a few kilobytes for small objects. For example, if you want to reduce303the default memory requirements from 256K to 128K, compile with304make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"305Of course this will generally degrade compression (there's no free lunch).306307The memory requirements for inflate are (in bytes) 1 << windowBits308that is, 32K for windowBits=15 (default value) plus about 7 kilobytes309for small objects.310*/311312/* Type declarations */313314#ifndef OF /* function prototypes */315# ifdef STDC316# define OF(args) args317# else318# define OF(args) ()319# endif320#endif321322#ifndef Z_ARG /* function prototypes for stdarg */323# if defined(STDC) || defined(Z_HAVE_STDARG_H)324# define Z_ARG(args) args325# else326# define Z_ARG(args) ()327# endif328#endif329330/* The following definitions for FAR are needed only for MSDOS mixed331* model programming (small or medium model with some far allocations).332* This was tested only with MSC; for other MSDOS compilers you may have333* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,334* just define FAR to be empty.335*/336#ifdef SYS16BIT337# if defined(M_I86SM) || defined(M_I86MM)338/* MSC small or medium model */339# define SMALL_MEDIUM340# ifdef _MSC_VER341# define FAR _far342# else343# define FAR far344# endif345# endif346# if (defined(__SMALL__) || defined(__MEDIUM__))347/* Turbo C small or medium model */348# define SMALL_MEDIUM349# ifdef __BORLANDC__350# define FAR _far351# else352# define FAR far353# endif354# endif355#endif356357#if defined(WINDOWS) || defined(WIN32)358/* If building or using zlib as a DLL, define ZLIB_DLL.359* This is not mandatory, but it offers a little performance increase.360*/361# ifdef ZLIB_DLL362# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))363# ifdef ZLIB_INTERNAL364# define ZEXTERN extern __declspec(dllexport)365# else366# define ZEXTERN extern __declspec(dllimport)367# endif368# endif369# endif /* ZLIB_DLL */370/* If building or using zlib with the WINAPI/WINAPIV calling convention,371* define ZLIB_WINAPI.372* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.373*/374# ifdef ZLIB_WINAPI375# ifdef FAR376# undef FAR377# endif378# include <windows.h>379/* No need for _export, use ZLIB.DEF instead. */380/* For complete Windows compatibility, use WINAPI, not __stdcall. */381# define ZEXPORT WINAPI382# ifdef WIN32383# define ZEXPORTVA WINAPIV384# else385# define ZEXPORTVA FAR CDECL386# endif387# endif388#endif389390#if defined (__BEOS__)391# ifdef ZLIB_DLL392# ifdef ZLIB_INTERNAL393# define ZEXPORT __declspec(dllexport)394# define ZEXPORTVA __declspec(dllexport)395# else396# define ZEXPORT __declspec(dllimport)397# define ZEXPORTVA __declspec(dllimport)398# endif399# endif400#endif401402#ifndef ZEXTERN403# define ZEXTERN extern404#endif405#ifndef ZEXPORT406# define ZEXPORT407#endif408#ifndef ZEXPORTVA409# define ZEXPORTVA410#endif411412#ifndef FAR413# define FAR414#endif415416#if !defined(__MACTYPES__)417typedef unsigned char Byte; /* 8 bits */418#endif419typedef unsigned int uInt; /* 16 bits or more */420421#ifdef _LP64422typedef unsigned int uLong; /* 32 bits or more */423#else424typedef unsigned long uLong; /* 32 bits or more */425#endif426427#ifdef SMALL_MEDIUM428/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */429# define Bytef Byte FAR430#else431typedef Byte FAR Bytef;432#endif433typedef char FAR charf;434typedef int FAR intf;435typedef uInt FAR uIntf;436typedef uLong FAR uLongf;437438#ifdef STDC439typedef void const *voidpc;440typedef void FAR *voidpf;441typedef void *voidp;442#else443typedef Byte const *voidpc;444typedef Byte FAR *voidpf;445typedef Byte *voidp;446#endif447448#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)449# include <limits.h>450# if (UINT_MAX == 0xffffffffUL)451# define Z_U4 unsigned452# elif (ULONG_MAX == 0xffffffffUL)453# define Z_U4 unsigned long454# elif (USHRT_MAX == 0xffffffffUL)455# define Z_U4 unsigned short456# endif457#endif458459#ifdef Z_U4460typedef Z_U4 z_crc_t;461#else462typedef unsigned long z_crc_t;463#endif464465#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */466# define Z_HAVE_UNISTD_H467#endif468469#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */470# define Z_HAVE_STDARG_H471#endif472473#ifdef STDC474# ifndef Z_SOLO475# include <sys/types.h> /* for off_t */476# endif477#endif478479#if defined(STDC) || defined(Z_HAVE_STDARG_H)480# ifndef Z_SOLO481# include <stdarg.h> /* for va_list */482# endif483#endif484485#ifdef _WIN32486# ifndef Z_SOLO487# include <stddef.h> /* for wchar_t */488# endif489#endif490491/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and492* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even493* though the former does not conform to the LFS document), but considering494* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as495* equivalently requesting no 64-bit operations496*/497#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1498# undef _LARGEFILE64_SOURCE499#endif500501#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)502# define Z_HAVE_UNISTD_H503#endif504#ifndef Z_SOLO505# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)506# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */507# ifdef VMS508# include <unixio.h> /* for off_t */509# endif510# ifndef z_off_t511# define z_off_t off_t512# endif513# endif514#endif515516#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0517# define Z_LFS64518#endif519520#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)521# define Z_LARGE64522#endif523524#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)525# define Z_WANT64526#endif527528#if !defined(SEEK_SET) && !defined(Z_SOLO)529# define SEEK_SET 0 /* Seek from beginning of file. */530# define SEEK_CUR 1 /* Seek from current position. */531# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */532#endif533534#ifndef z_off_t535# define z_off_t long536#endif537538#if !defined(_WIN32) && defined(Z_LARGE64)539# define z_off64_t off64_t540#else541# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)542# define z_off64_t __int64543# else544# define z_off64_t z_off_t545# endif546#endif547548/* MVS linker does not support external names larger than 8 bytes */549#if defined(__MVS__)550#pragma map(deflateInit_,"DEIN")551#pragma map(deflateInit2_,"DEIN2")552#pragma map(deflateEnd,"DEEND")553#pragma map(deflateBound,"DEBND")554#pragma map(inflateInit_,"ININ")555#pragma map(inflateInit2_,"ININ2")556#pragma map(inflateEnd,"INEND")557#pragma map(inflateSync,"INSY")558#pragma map(inflateSetDictionary,"INSEDI")559#pragma map(compressBound,"CMBND")560#pragma map(inflate_table,"INTABL")561#pragma map(inflate_fast,"INFA")562#pragma map(inflate_copyright,"INCOPY")563#endif564565#endif /* ZCONF_H */566567568