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