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