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