cannam@89: /* zconf.h -- configuration of the zlib compression library cannam@89: * Copyright (C) 1995-2012 Jean-loup Gailly. cannam@89: * For conditions of distribution and use, see copyright notice in zlib.h cannam@89: */ cannam@89: cannam@89: /* @(#) $Id$ */ cannam@89: cannam@89: #ifndef ZCONF_H cannam@89: #define ZCONF_H cannam@89: cannam@89: /* cannam@89: * If you *really* need a unique prefix for all types and library functions, cannam@89: * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. cannam@89: * Even better than compiling with -DZ_PREFIX would be to use configure to set cannam@89: * this permanently in zconf.h using "./configure --zprefix". cannam@89: */ cannam@89: #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ cannam@89: # define Z_PREFIX_SET cannam@89: cannam@89: /* all linked symbols */ cannam@89: # define _dist_code z__dist_code cannam@89: # define _length_code z__length_code cannam@89: # define _tr_align z__tr_align cannam@89: # define _tr_flush_block z__tr_flush_block cannam@89: # define _tr_init z__tr_init cannam@89: # define _tr_stored_block z__tr_stored_block cannam@89: # define _tr_tally z__tr_tally cannam@89: # define adler32 z_adler32 cannam@89: # define adler32_combine z_adler32_combine cannam@89: # define adler32_combine64 z_adler32_combine64 cannam@89: # ifndef Z_SOLO cannam@89: # define compress z_compress cannam@89: # define compress2 z_compress2 cannam@89: # define compressBound z_compressBound cannam@89: # endif cannam@89: # define crc32 z_crc32 cannam@89: # define crc32_combine z_crc32_combine cannam@89: # define crc32_combine64 z_crc32_combine64 cannam@89: # define deflate z_deflate cannam@89: # define deflateBound z_deflateBound cannam@89: # define deflateCopy z_deflateCopy cannam@89: # define deflateEnd z_deflateEnd cannam@89: # define deflateInit2_ z_deflateInit2_ cannam@89: # define deflateInit_ z_deflateInit_ cannam@89: # define deflateParams z_deflateParams cannam@89: # define deflatePending z_deflatePending cannam@89: # define deflatePrime z_deflatePrime cannam@89: # define deflateReset z_deflateReset cannam@89: # define deflateResetKeep z_deflateResetKeep cannam@89: # define deflateSetDictionary z_deflateSetDictionary cannam@89: # define deflateSetHeader z_deflateSetHeader cannam@89: # define deflateTune z_deflateTune cannam@89: # define deflate_copyright z_deflate_copyright cannam@89: # define get_crc_table z_get_crc_table cannam@89: # ifndef Z_SOLO cannam@89: # define gz_error z_gz_error cannam@89: # define gz_intmax z_gz_intmax cannam@89: # define gz_strwinerror z_gz_strwinerror cannam@89: # define gzbuffer z_gzbuffer cannam@89: # define gzclearerr z_gzclearerr cannam@89: # define gzclose z_gzclose cannam@89: # define gzclose_r z_gzclose_r cannam@89: # define gzclose_w z_gzclose_w cannam@89: # define gzdirect z_gzdirect cannam@89: # define gzdopen z_gzdopen cannam@89: # define gzeof z_gzeof cannam@89: # define gzerror z_gzerror cannam@89: # define gzflush z_gzflush cannam@89: # define gzgetc z_gzgetc cannam@89: # define gzgetc_ z_gzgetc_ cannam@89: # define gzgets z_gzgets cannam@89: # define gzoffset z_gzoffset cannam@89: # define gzoffset64 z_gzoffset64 cannam@89: # define gzopen z_gzopen cannam@89: # define gzopen64 z_gzopen64 cannam@89: # ifdef _WIN32 cannam@89: # define gzopen_w z_gzopen_w cannam@89: # endif cannam@89: # define gzprintf z_gzprintf cannam@89: # define gzputc z_gzputc cannam@89: # define gzputs z_gzputs cannam@89: # define gzread z_gzread cannam@89: # define gzrewind z_gzrewind cannam@89: # define gzseek z_gzseek cannam@89: # define gzseek64 z_gzseek64 cannam@89: # define gzsetparams z_gzsetparams cannam@89: # define gztell z_gztell cannam@89: # define gztell64 z_gztell64 cannam@89: # define gzungetc z_gzungetc cannam@89: # define gzwrite z_gzwrite cannam@89: # endif cannam@89: # define inflate z_inflate cannam@89: # define inflateBack z_inflateBack cannam@89: # define inflateBackEnd z_inflateBackEnd cannam@89: # define inflateBackInit_ z_inflateBackInit_ cannam@89: # define inflateCopy z_inflateCopy cannam@89: # define inflateEnd z_inflateEnd cannam@89: # define inflateGetHeader z_inflateGetHeader cannam@89: # define inflateInit2_ z_inflateInit2_ cannam@89: # define inflateInit_ z_inflateInit_ cannam@89: # define inflateMark z_inflateMark cannam@89: # define inflatePrime z_inflatePrime cannam@89: # define inflateReset z_inflateReset cannam@89: # define inflateReset2 z_inflateReset2 cannam@89: # define inflateSetDictionary z_inflateSetDictionary cannam@89: # define inflateSync z_inflateSync cannam@89: # define inflateSyncPoint z_inflateSyncPoint cannam@89: # define inflateUndermine z_inflateUndermine cannam@89: # define inflateResetKeep z_inflateResetKeep cannam@89: # define inflate_copyright z_inflate_copyright cannam@89: # define inflate_fast z_inflate_fast cannam@89: # define inflate_table z_inflate_table cannam@89: # ifndef Z_SOLO cannam@89: # define uncompress z_uncompress cannam@89: # endif cannam@89: # define zError z_zError cannam@89: # ifndef Z_SOLO cannam@89: # define zcalloc z_zcalloc cannam@89: # define zcfree z_zcfree cannam@89: # endif cannam@89: # define zlibCompileFlags z_zlibCompileFlags cannam@89: # define zlibVersion z_zlibVersion cannam@89: cannam@89: /* all zlib typedefs in zlib.h and zconf.h */ cannam@89: # define Byte z_Byte cannam@89: # define Bytef z_Bytef cannam@89: # define alloc_func z_alloc_func cannam@89: # define charf z_charf cannam@89: # define free_func z_free_func cannam@89: # ifndef Z_SOLO cannam@89: # define gzFile z_gzFile cannam@89: # endif cannam@89: # define gz_header z_gz_header cannam@89: # define gz_headerp z_gz_headerp cannam@89: # define in_func z_in_func cannam@89: # define intf z_intf cannam@89: # define out_func z_out_func cannam@89: # define uInt z_uInt cannam@89: # define uIntf z_uIntf cannam@89: # define uLong z_uLong cannam@89: # define uLongf z_uLongf cannam@89: # define voidp z_voidp cannam@89: # define voidpc z_voidpc cannam@89: # define voidpf z_voidpf cannam@89: cannam@89: /* all zlib structs in zlib.h and zconf.h */ cannam@89: # define gz_header_s z_gz_header_s cannam@89: # define internal_state z_internal_state cannam@89: cannam@89: #endif cannam@89: cannam@89: #if defined(__MSDOS__) && !defined(MSDOS) cannam@89: # define MSDOS cannam@89: #endif cannam@89: #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) cannam@89: # define OS2 cannam@89: #endif cannam@89: #if defined(_WINDOWS) && !defined(WINDOWS) cannam@89: # define WINDOWS cannam@89: #endif cannam@89: #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) cannam@89: # ifndef WIN32 cannam@89: # define WIN32 cannam@89: # endif cannam@89: #endif cannam@89: #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) cannam@89: # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) cannam@89: # ifndef SYS16BIT cannam@89: # define SYS16BIT cannam@89: # endif cannam@89: # endif cannam@89: #endif cannam@89: cannam@89: /* cannam@89: * Compile with -DMAXSEG_64K if the alloc function cannot allocate more cannam@89: * than 64k bytes at a time (needed on systems with 16-bit int). cannam@89: */ cannam@89: #ifdef SYS16BIT cannam@89: # define MAXSEG_64K cannam@89: #endif cannam@89: #ifdef MSDOS cannam@89: # define UNALIGNED_OK cannam@89: #endif cannam@89: cannam@89: #ifdef __STDC_VERSION__ cannam@89: # ifndef STDC cannam@89: # define STDC cannam@89: # endif cannam@89: # if __STDC_VERSION__ >= 199901L cannam@89: # ifndef STDC99 cannam@89: # define STDC99 cannam@89: # endif cannam@89: # endif cannam@89: #endif cannam@89: #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) cannam@89: # define STDC cannam@89: #endif cannam@89: #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) cannam@89: # define STDC cannam@89: #endif cannam@89: #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) cannam@89: # define STDC cannam@89: #endif cannam@89: #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) cannam@89: # define STDC cannam@89: #endif cannam@89: cannam@89: #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ cannam@89: # define STDC cannam@89: #endif cannam@89: cannam@89: #ifndef STDC cannam@89: # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ cannam@89: # define const /* note: need a more gentle solution here */ cannam@89: # endif cannam@89: #endif cannam@89: cannam@89: #if defined(ZLIB_CONST) && !defined(z_const) cannam@89: # define z_const const cannam@89: #else cannam@89: # define z_const cannam@89: #endif cannam@89: cannam@89: /* Some Mac compilers merge all .h files incorrectly: */ cannam@89: #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) cannam@89: # define NO_DUMMY_DECL cannam@89: #endif cannam@89: cannam@89: /* Maximum value for memLevel in deflateInit2 */ cannam@89: #ifndef MAX_MEM_LEVEL cannam@89: # ifdef MAXSEG_64K cannam@89: # define MAX_MEM_LEVEL 8 cannam@89: # else cannam@89: # define MAX_MEM_LEVEL 9 cannam@89: # endif cannam@89: #endif cannam@89: cannam@89: /* Maximum value for windowBits in deflateInit2 and inflateInit2. cannam@89: * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files cannam@89: * created by gzip. (Files created by minigzip can still be extracted by cannam@89: * gzip.) cannam@89: */ cannam@89: #ifndef MAX_WBITS cannam@89: # define MAX_WBITS 15 /* 32K LZ77 window */ cannam@89: #endif cannam@89: cannam@89: /* The memory requirements for deflate are (in bytes): cannam@89: (1 << (windowBits+2)) + (1 << (memLevel+9)) cannam@89: that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) cannam@89: plus a few kilobytes for small objects. For example, if you want to reduce cannam@89: the default memory requirements from 256K to 128K, compile with cannam@89: make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" cannam@89: Of course this will generally degrade compression (there's no free lunch). cannam@89: cannam@89: The memory requirements for inflate are (in bytes) 1 << windowBits cannam@89: that is, 32K for windowBits=15 (default value) plus a few kilobytes cannam@89: for small objects. cannam@89: */ cannam@89: cannam@89: /* Type declarations */ cannam@89: cannam@89: #ifndef OF /* function prototypes */ cannam@89: # ifdef STDC cannam@89: # define OF(args) args cannam@89: # else cannam@89: # define OF(args) () cannam@89: # endif cannam@89: #endif cannam@89: cannam@89: #ifndef Z_ARG /* function prototypes for stdarg */ cannam@89: # if defined(STDC) || defined(Z_HAVE_STDARG_H) cannam@89: # define Z_ARG(args) args cannam@89: # else cannam@89: # define Z_ARG(args) () cannam@89: # endif cannam@89: #endif cannam@89: cannam@89: /* The following definitions for FAR are needed only for MSDOS mixed cannam@89: * model programming (small or medium model with some far allocations). cannam@89: * This was tested only with MSC; for other MSDOS compilers you may have cannam@89: * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, cannam@89: * just define FAR to be empty. cannam@89: */ cannam@89: #ifdef SYS16BIT cannam@89: # if defined(M_I86SM) || defined(M_I86MM) cannam@89: /* MSC small or medium model */ cannam@89: # define SMALL_MEDIUM cannam@89: # ifdef _MSC_VER cannam@89: # define FAR _far cannam@89: # else cannam@89: # define FAR far cannam@89: # endif cannam@89: # endif cannam@89: # if (defined(__SMALL__) || defined(__MEDIUM__)) cannam@89: /* Turbo C small or medium model */ cannam@89: # define SMALL_MEDIUM cannam@89: # ifdef __BORLANDC__ cannam@89: # define FAR _far cannam@89: # else cannam@89: # define FAR far cannam@89: # endif cannam@89: # endif cannam@89: #endif cannam@89: cannam@89: #if defined(WINDOWS) || defined(WIN32) cannam@89: /* If building or using zlib as a DLL, define ZLIB_DLL. cannam@89: * This is not mandatory, but it offers a little performance increase. cannam@89: */ cannam@89: # ifdef ZLIB_DLL cannam@89: # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) cannam@89: # ifdef ZLIB_INTERNAL cannam@89: # define ZEXTERN extern __declspec(dllexport) cannam@89: # else cannam@89: # define ZEXTERN extern __declspec(dllimport) cannam@89: # endif cannam@89: # endif cannam@89: # endif /* ZLIB_DLL */ cannam@89: /* If building or using zlib with the WINAPI/WINAPIV calling convention, cannam@89: * define ZLIB_WINAPI. cannam@89: * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. cannam@89: */ cannam@89: # ifdef ZLIB_WINAPI cannam@89: # ifdef FAR cannam@89: # undef FAR cannam@89: # endif cannam@89: # include cannam@89: /* No need for _export, use ZLIB.DEF instead. */ cannam@89: /* For complete Windows compatibility, use WINAPI, not __stdcall. */ cannam@89: # define ZEXPORT WINAPI cannam@89: # ifdef WIN32 cannam@89: # define ZEXPORTVA WINAPIV cannam@89: # else cannam@89: # define ZEXPORTVA FAR CDECL cannam@89: # endif cannam@89: # endif cannam@89: #endif cannam@89: cannam@89: #if defined (__BEOS__) cannam@89: # ifdef ZLIB_DLL cannam@89: # ifdef ZLIB_INTERNAL cannam@89: # define ZEXPORT __declspec(dllexport) cannam@89: # define ZEXPORTVA __declspec(dllexport) cannam@89: # else cannam@89: # define ZEXPORT __declspec(dllimport) cannam@89: # define ZEXPORTVA __declspec(dllimport) cannam@89: # endif cannam@89: # endif cannam@89: #endif cannam@89: cannam@89: #ifndef ZEXTERN cannam@89: # define ZEXTERN extern cannam@89: #endif cannam@89: #ifndef ZEXPORT cannam@89: # define ZEXPORT cannam@89: #endif cannam@89: #ifndef ZEXPORTVA cannam@89: # define ZEXPORTVA cannam@89: #endif cannam@89: cannam@89: #ifndef FAR cannam@89: # define FAR cannam@89: #endif cannam@89: cannam@89: #if !defined(__MACTYPES__) cannam@89: typedef unsigned char Byte; /* 8 bits */ cannam@89: #endif cannam@89: typedef unsigned int uInt; /* 16 bits or more */ cannam@89: typedef unsigned long uLong; /* 32 bits or more */ cannam@89: cannam@89: #ifdef SMALL_MEDIUM cannam@89: /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ cannam@89: # define Bytef Byte FAR cannam@89: #else cannam@89: typedef Byte FAR Bytef; cannam@89: #endif cannam@89: typedef char FAR charf; cannam@89: typedef int FAR intf; cannam@89: typedef uInt FAR uIntf; cannam@89: typedef uLong FAR uLongf; cannam@89: cannam@89: #ifdef STDC cannam@89: typedef void const *voidpc; cannam@89: typedef void FAR *voidpf; cannam@89: typedef void *voidp; cannam@89: #else cannam@89: typedef Byte const *voidpc; cannam@89: typedef Byte FAR *voidpf; cannam@89: typedef Byte *voidp; cannam@89: #endif cannam@89: cannam@89: /* ./configure may #define Z_U4 here */ cannam@89: cannam@89: #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) cannam@89: # include cannam@89: # if (UINT_MAX == 0xffffffffUL) cannam@89: # define Z_U4 unsigned cannam@89: # else cannam@89: # if (ULONG_MAX == 0xffffffffUL) cannam@89: # define Z_U4 unsigned long cannam@89: # else cannam@89: # if (USHRT_MAX == 0xffffffffUL) cannam@89: # define Z_U4 unsigned short cannam@89: # endif cannam@89: # endif cannam@89: # endif cannam@89: #endif cannam@89: cannam@89: #ifdef Z_U4 cannam@89: typedef Z_U4 z_crc_t; cannam@89: #else cannam@89: typedef unsigned long z_crc_t; cannam@89: #endif cannam@89: cannam@89: #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ cannam@89: # define Z_HAVE_UNISTD_H cannam@89: #endif cannam@89: cannam@89: #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ cannam@89: # define Z_HAVE_STDARG_H cannam@89: #endif cannam@89: cannam@89: #ifdef STDC cannam@89: # ifndef Z_SOLO cannam@89: # include /* for off_t */ cannam@89: # endif cannam@89: #endif cannam@89: cannam@89: #ifdef _WIN32 cannam@89: # include /* for wchar_t */ cannam@89: #endif cannam@89: cannam@89: /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and cannam@89: * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even cannam@89: * though the former does not conform to the LFS document), but considering cannam@89: * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as cannam@89: * equivalently requesting no 64-bit operations cannam@89: */ cannam@89: #if defined(LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 cannam@89: # undef _LARGEFILE64_SOURCE cannam@89: #endif cannam@89: cannam@89: #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) cannam@89: # define Z_HAVE_UNISTD_H cannam@89: #endif cannam@89: #ifndef Z_SOLO cannam@89: # if defined(Z_HAVE_UNISTD_H) || defined(LARGEFILE64_SOURCE) cannam@89: # include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ cannam@89: # ifdef VMS cannam@89: # include /* for off_t */ cannam@89: # endif cannam@89: # ifndef z_off_t cannam@89: # define z_off_t off_t cannam@89: # endif cannam@89: # endif cannam@89: #endif cannam@89: cannam@89: #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 cannam@89: # define Z_LFS64 cannam@89: #endif cannam@89: cannam@89: #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) cannam@89: # define Z_LARGE64 cannam@89: #endif cannam@89: cannam@89: #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) cannam@89: # define Z_WANT64 cannam@89: #endif cannam@89: cannam@89: #if !defined(SEEK_SET) && !defined(Z_SOLO) cannam@89: # define SEEK_SET 0 /* Seek from beginning of file. */ cannam@89: # define SEEK_CUR 1 /* Seek from current position. */ cannam@89: # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ cannam@89: #endif cannam@89: cannam@89: #ifndef z_off_t cannam@89: # define z_off_t long cannam@89: #endif cannam@89: cannam@89: #if !defined(_WIN32) && defined(Z_LARGE64) cannam@89: # define z_off64_t off64_t cannam@89: #else cannam@89: # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) cannam@89: # define z_off64_t __int64 cannam@89: # else cannam@89: # define z_off64_t z_off_t cannam@89: # endif cannam@89: #endif cannam@89: cannam@89: /* MVS linker does not support external names larger than 8 bytes */ cannam@89: #if defined(__MVS__) cannam@89: #pragma map(deflateInit_,"DEIN") cannam@89: #pragma map(deflateInit2_,"DEIN2") cannam@89: #pragma map(deflateEnd,"DEEND") cannam@89: #pragma map(deflateBound,"DEBND") cannam@89: #pragma map(inflateInit_,"ININ") cannam@89: #pragma map(inflateInit2_,"ININ2") cannam@89: #pragma map(inflateEnd,"INEND") cannam@89: #pragma map(inflateSync,"INSY") cannam@89: #pragma map(inflateSetDictionary,"INSEDI") cannam@89: #pragma map(compressBound,"CMBND") cannam@89: #pragma map(inflate_table,"INTABL") cannam@89: #pragma map(inflate_fast,"INFA") cannam@89: #pragma map(inflate_copyright,"INCOPY") cannam@89: #endif cannam@89: cannam@89: #endif /* ZCONF_H */