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