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