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