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