nuclear@1: /* zconf.h -- configuration of the zlib compression library nuclear@1: * Copyright (C) 1995-2005 Jean-loup Gailly. nuclear@1: * For conditions of distribution and use, see copyright notice in zlib.h nuclear@1: */ nuclear@1: nuclear@1: /* @(#) $Id$ */ nuclear@1: nuclear@1: #ifndef ZCONF_H nuclear@1: #define ZCONF_H nuclear@1: nuclear@1: /* nuclear@1: * If you *really* need a unique prefix for all types and library functions, nuclear@1: * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. nuclear@1: */ nuclear@1: #ifdef Z_PREFIX nuclear@1: # define deflateInit_ z_deflateInit_ nuclear@1: # define deflate z_deflate nuclear@1: # define deflateEnd z_deflateEnd nuclear@1: # define inflateInit_ z_inflateInit_ nuclear@1: # define inflate z_inflate nuclear@1: # define inflateEnd z_inflateEnd nuclear@1: # define deflateInit2_ z_deflateInit2_ nuclear@1: # define deflateSetDictionary z_deflateSetDictionary nuclear@1: # define deflateCopy z_deflateCopy nuclear@1: # define deflateReset z_deflateReset nuclear@1: # define deflateParams z_deflateParams nuclear@1: # define deflateBound z_deflateBound nuclear@1: # define deflatePrime z_deflatePrime nuclear@1: # define inflateInit2_ z_inflateInit2_ nuclear@1: # define inflateSetDictionary z_inflateSetDictionary nuclear@1: # define inflateSync z_inflateSync nuclear@1: # define inflateSyncPoint z_inflateSyncPoint nuclear@1: # define inflateCopy z_inflateCopy nuclear@1: # define inflateReset z_inflateReset nuclear@1: # define inflateBack z_inflateBack nuclear@1: # define inflateBackEnd z_inflateBackEnd nuclear@1: # define compress z_compress nuclear@1: # define compress2 z_compress2 nuclear@1: # define compressBound z_compressBound nuclear@1: # define uncompress z_uncompress nuclear@1: # define adler32 z_adler32 nuclear@1: # define crc32 z_crc32 nuclear@1: # define get_crc_table z_get_crc_table nuclear@1: # define zError z_zError nuclear@1: nuclear@1: # define alloc_func z_alloc_func nuclear@1: # define free_func z_free_func nuclear@1: # define in_func z_in_func nuclear@1: # define out_func z_out_func nuclear@1: # define Byte z_Byte nuclear@1: # define uInt z_uInt nuclear@1: # define uLong z_uLong nuclear@1: # define Bytef z_Bytef nuclear@1: # define charf z_charf nuclear@1: # define intf z_intf nuclear@1: # define uIntf z_uIntf nuclear@1: # define uLongf z_uLongf nuclear@1: # define voidpf z_voidpf nuclear@1: # define voidp z_voidp nuclear@1: #endif nuclear@1: nuclear@1: #if defined(__MSDOS__) && !defined(MSDOS) nuclear@1: # define MSDOS nuclear@1: #endif nuclear@1: #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) nuclear@1: # define OS2 nuclear@1: #endif nuclear@1: #if defined(_WINDOWS) && !defined(WINDOWS) nuclear@1: # define WINDOWS nuclear@1: #endif nuclear@1: #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) nuclear@1: # ifndef WIN32 nuclear@1: # define WIN32 nuclear@1: # endif nuclear@1: #endif nuclear@1: #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) nuclear@1: # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) nuclear@1: # ifndef SYS16BIT nuclear@1: # define SYS16BIT nuclear@1: # endif nuclear@1: # endif nuclear@1: #endif nuclear@1: nuclear@1: /* nuclear@1: * Compile with -DMAXSEG_64K if the alloc function cannot allocate more nuclear@1: * than 64k bytes at a time (needed on systems with 16-bit int). nuclear@1: */ nuclear@1: #ifdef SYS16BIT nuclear@1: # define MAXSEG_64K nuclear@1: #endif nuclear@1: #ifdef MSDOS nuclear@1: # define UNALIGNED_OK nuclear@1: #endif nuclear@1: nuclear@1: #ifdef __STDC_VERSION__ nuclear@1: # ifndef STDC nuclear@1: # define STDC nuclear@1: # endif nuclear@1: # if __STDC_VERSION__ >= 199901L nuclear@1: # ifndef STDC99 nuclear@1: # define STDC99 nuclear@1: # endif nuclear@1: # endif nuclear@1: #endif nuclear@1: #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) nuclear@1: # define STDC nuclear@1: #endif nuclear@1: #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) nuclear@1: # define STDC nuclear@1: #endif nuclear@1: #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) nuclear@1: # define STDC nuclear@1: #endif nuclear@1: #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) nuclear@1: # define STDC nuclear@1: #endif nuclear@1: nuclear@1: #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ nuclear@1: # define STDC nuclear@1: #endif nuclear@1: nuclear@1: #ifndef STDC nuclear@1: # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ nuclear@1: # define const /* note: need a more gentle solution here */ nuclear@1: # endif nuclear@1: #endif nuclear@1: nuclear@1: /* Some Mac compilers merge all .h files incorrectly: */ nuclear@1: #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) nuclear@1: # define NO_DUMMY_DECL nuclear@1: #endif nuclear@1: nuclear@1: /* Maximum value for memLevel in deflateInit2 */ nuclear@1: #ifndef MAX_MEM_LEVEL nuclear@1: # ifdef MAXSEG_64K nuclear@1: # define MAX_MEM_LEVEL 8 nuclear@1: # else nuclear@1: # define MAX_MEM_LEVEL 9 nuclear@1: # endif nuclear@1: #endif nuclear@1: nuclear@1: /* Maximum value for windowBits in deflateInit2 and inflateInit2. nuclear@1: * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files nuclear@1: * created by gzip. (Files created by minigzip can still be extracted by nuclear@1: * gzip.) nuclear@1: */ nuclear@1: #ifndef MAX_WBITS nuclear@1: # define MAX_WBITS 15 /* 32K LZ77 window */ nuclear@1: #endif nuclear@1: nuclear@1: /* The memory requirements for deflate are (in bytes): nuclear@1: (1 << (windowBits+2)) + (1 << (memLevel+9)) nuclear@1: that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) nuclear@1: plus a few kilobytes for small objects. For example, if you want to reduce nuclear@1: the default memory requirements from 256K to 128K, compile with nuclear@1: make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" nuclear@1: Of course this will generally degrade compression (there's no free lunch). nuclear@1: nuclear@1: The memory requirements for inflate are (in bytes) 1 << windowBits nuclear@1: that is, 32K for windowBits=15 (default value) plus a few kilobytes nuclear@1: for small objects. nuclear@1: */ nuclear@1: nuclear@1: /* Type declarations */ nuclear@1: nuclear@1: #ifndef OF /* function prototypes */ nuclear@1: # ifdef STDC nuclear@1: # define OF(args) args nuclear@1: # else nuclear@1: # define OF(args) () nuclear@1: # endif nuclear@1: #endif nuclear@1: nuclear@1: /* The following definitions for FAR are needed only for MSDOS mixed nuclear@1: * model programming (small or medium model with some far allocations). nuclear@1: * This was tested only with MSC; for other MSDOS compilers you may have nuclear@1: * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, nuclear@1: * just define FAR to be empty. nuclear@1: */ nuclear@1: #ifdef SYS16BIT nuclear@1: # if defined(M_I86SM) || defined(M_I86MM) nuclear@1: /* MSC small or medium model */ nuclear@1: # define SMALL_MEDIUM nuclear@1: # ifdef _MSC_VER nuclear@1: # define FAR _far nuclear@1: # else nuclear@1: # define FAR far nuclear@1: # endif nuclear@1: # endif nuclear@1: # if (defined(__SMALL__) || defined(__MEDIUM__)) nuclear@1: /* Turbo C small or medium model */ nuclear@1: # define SMALL_MEDIUM nuclear@1: # ifdef __BORLANDC__ nuclear@1: # define FAR _far nuclear@1: # else nuclear@1: # define FAR far nuclear@1: # endif nuclear@1: # endif nuclear@1: #endif nuclear@1: nuclear@1: #if defined(WINDOWS) || defined(WIN32) nuclear@1: /* If building or using zlib as a DLL, define ZLIB_DLL. nuclear@1: * This is not mandatory, but it offers a little performance increase. nuclear@1: */ nuclear@1: # ifdef ZLIB_DLL nuclear@1: # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) nuclear@1: # ifdef ZLIB_INTERNAL nuclear@1: # define ZEXTERN extern __declspec(dllexport) nuclear@1: # else nuclear@1: # define ZEXTERN extern __declspec(dllimport) nuclear@1: # endif nuclear@1: # endif nuclear@1: # endif /* ZLIB_DLL */ nuclear@1: /* If building or using zlib with the WINAPI/WINAPIV calling convention, nuclear@1: * define ZLIB_WINAPI. nuclear@1: * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. nuclear@1: */ nuclear@1: # ifdef ZLIB_WINAPI nuclear@1: # ifdef FAR nuclear@1: # undef FAR nuclear@1: # endif nuclear@1: # include nuclear@1: /* No need for _export, use ZLIB.DEF instead. */ nuclear@1: /* For complete Windows compatibility, use WINAPI, not __stdcall. */ nuclear@1: # define ZEXPORT WINAPI nuclear@1: # ifdef WIN32 nuclear@1: # define ZEXPORTVA WINAPIV nuclear@1: # else nuclear@1: # define ZEXPORTVA FAR CDECL nuclear@1: # endif nuclear@1: # endif nuclear@1: #endif nuclear@1: nuclear@1: #if defined (__BEOS__) nuclear@1: # ifdef ZLIB_DLL nuclear@1: # ifdef ZLIB_INTERNAL nuclear@1: # define ZEXPORT __declspec(dllexport) nuclear@1: # define ZEXPORTVA __declspec(dllexport) nuclear@1: # else nuclear@1: # define ZEXPORT __declspec(dllimport) nuclear@1: # define ZEXPORTVA __declspec(dllimport) nuclear@1: # endif nuclear@1: # endif nuclear@1: #endif nuclear@1: nuclear@1: #ifndef ZEXTERN nuclear@1: # define ZEXTERN extern nuclear@1: #endif nuclear@1: #ifndef ZEXPORT nuclear@1: # define ZEXPORT nuclear@1: #endif nuclear@1: #ifndef ZEXPORTVA nuclear@1: # define ZEXPORTVA nuclear@1: #endif nuclear@1: nuclear@1: #ifndef FAR nuclear@1: # define FAR nuclear@1: #endif nuclear@1: nuclear@1: #if !defined(__MACTYPES__) nuclear@1: typedef unsigned char Byte; /* 8 bits */ nuclear@1: #endif nuclear@1: typedef unsigned int uInt; /* 16 bits or more */ nuclear@1: typedef unsigned long uLong; /* 32 bits or more */ nuclear@1: nuclear@1: #ifdef SMALL_MEDIUM nuclear@1: /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ nuclear@1: # define Bytef Byte FAR nuclear@1: #else nuclear@1: typedef Byte FAR Bytef; nuclear@1: #endif nuclear@1: typedef char FAR charf; nuclear@1: typedef int FAR intf; nuclear@1: typedef uInt FAR uIntf; nuclear@1: typedef uLong FAR uLongf; nuclear@1: nuclear@1: #ifdef STDC nuclear@1: typedef void const *voidpc; nuclear@1: typedef void FAR *voidpf; nuclear@1: typedef void *voidp; nuclear@1: #else nuclear@1: typedef Byte const *voidpc; nuclear@1: typedef Byte FAR *voidpf; nuclear@1: typedef Byte *voidp; nuclear@1: #endif nuclear@1: nuclear@1: #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ nuclear@1: # include /* for off_t */ nuclear@1: # include /* for SEEK_* and off_t */ nuclear@1: # ifdef VMS nuclear@1: # include /* for off_t */ nuclear@1: # endif nuclear@1: # define z_off_t off_t nuclear@1: #endif nuclear@1: #ifndef SEEK_SET nuclear@1: # define SEEK_SET 0 /* Seek from beginning of file. */ nuclear@1: # define SEEK_CUR 1 /* Seek from current position. */ nuclear@1: # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ nuclear@1: #endif nuclear@1: #ifndef z_off_t nuclear@1: # define z_off_t long nuclear@1: #endif nuclear@1: nuclear@1: #if defined(__OS400__) nuclear@1: # define NO_vsnprintf nuclear@1: #endif nuclear@1: nuclear@1: #if defined(__MVS__) nuclear@1: # define NO_vsnprintf nuclear@1: # ifdef FAR nuclear@1: # undef FAR nuclear@1: # endif nuclear@1: #endif nuclear@1: nuclear@1: /* MVS linker does not support external names larger than 8 bytes */ nuclear@1: #if defined(__MVS__) nuclear@1: # pragma map(deflateInit_,"DEIN") nuclear@1: # pragma map(deflateInit2_,"DEIN2") nuclear@1: # pragma map(deflateEnd,"DEEND") nuclear@1: # pragma map(deflateBound,"DEBND") nuclear@1: # pragma map(inflateInit_,"ININ") nuclear@1: # pragma map(inflateInit2_,"ININ2") nuclear@1: # pragma map(inflateEnd,"INEND") nuclear@1: # pragma map(inflateSync,"INSY") nuclear@1: # pragma map(inflateSetDictionary,"INSEDI") nuclear@1: # pragma map(compressBound,"CMBND") nuclear@1: # pragma map(inflate_table,"INTABL") nuclear@1: # pragma map(inflate_fast,"INFA") nuclear@1: # pragma map(inflate_copyright,"INCOPY") nuclear@1: #endif nuclear@1: nuclear@1: #endif /* ZCONF_H */