199767f8919635c4928607450d9e0abb932109ceToomas Soome/* zconf.h -- configuration of the zlib compression library
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Copyright (C) 1995-2013 Jean-loup Gailly.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * For conditions of distribution and use, see copyright notice in zlib.h
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* @(#) $FreeBSD$ */
199767f8919635c4928607450d9e0abb932109ceToomas Soome * If you *really* need a unique prefix for all types and library functions,
199767f8919635c4928607450d9e0abb932109ceToomas Soome * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Even better than compiling with -DZ_PREFIX would be to use configure to set
199767f8919635c4928607450d9e0abb932109ceToomas Soome * this permanently in zconf.h using "./configure --zprefix".
199767f8919635c4928607450d9e0abb932109ceToomas Soome#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* all linked symbols */
199767f8919635c4928607450d9e0abb932109ceToomas Soome# define deflateSetDictionary z_deflateSetDictionary
199767f8919635c4928607450d9e0abb932109ceToomas Soome# define inflateSetDictionary z_inflateSetDictionary
199767f8919635c4928607450d9e0abb932109ceToomas Soome# define inflateGetDictionary z_inflateGetDictionary
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* all zlib typedefs in zlib.h and zconf.h */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* all zlib structs in zlib.h and zconf.h */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
199767f8919635c4928607450d9e0abb932109ceToomas Soome# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
199767f8919635c4928607450d9e0abb932109ceToomas Soome * than 64k bytes at a time (needed on systems with 16-bit int).
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
199767f8919635c4928607450d9e0abb932109ceToomas Soome# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
199767f8919635c4928607450d9e0abb932109ceToomas Soome# define const /* note: need a more gentle solution here */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* Some Mac compilers merge all .h files incorrectly: */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* Maximum value for memLevel in deflateInit2 */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* Maximum value for windowBits in deflateInit2 and inflateInit2.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
199767f8919635c4928607450d9e0abb932109ceToomas Soome * created by gzip. (Files created by minigzip can still be extracted by
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* The memory requirements for deflate are (in bytes):
199767f8919635c4928607450d9e0abb932109ceToomas Soome (1 << (windowBits+2)) + (1 << (memLevel+9))
199767f8919635c4928607450d9e0abb932109ceToomas Soome that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
199767f8919635c4928607450d9e0abb932109ceToomas Soome plus a few kilobytes for small objects. For example, if you want to reduce
199767f8919635c4928607450d9e0abb932109ceToomas Soome the default memory requirements from 256K to 128K, compile with
199767f8919635c4928607450d9e0abb932109ceToomas Soome make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
199767f8919635c4928607450d9e0abb932109ceToomas Soome Of course this will generally degrade compression (there's no free lunch).
199767f8919635c4928607450d9e0abb932109ceToomas Soome The memory requirements for inflate are (in bytes) 1 << windowBits
199767f8919635c4928607450d9e0abb932109ceToomas Soome that is, 32K for windowBits=15 (default value) plus a few kilobytes
199767f8919635c4928607450d9e0abb932109ceToomas Soome for small objects.
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* Type declarations */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#ifndef Z_ARG /* function prototypes for stdarg */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* The following definitions for FAR are needed only for MSDOS mixed
199767f8919635c4928607450d9e0abb932109ceToomas Soome * model programming (small or medium model with some far allocations).
199767f8919635c4928607450d9e0abb932109ceToomas Soome * This was tested only with MSC; for other MSDOS compilers you may have
199767f8919635c4928607450d9e0abb932109ceToomas Soome * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
199767f8919635c4928607450d9e0abb932109ceToomas Soome * just define FAR to be empty.
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* MSC small or medium model */
199767f8919635c4928607450d9e0abb932109ceToomas Soome# if (defined(__SMALL__) || defined(__MEDIUM__))
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* Turbo C small or medium model */
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* If building or using zlib as a DLL, define ZLIB_DLL.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * This is not mandatory, but it offers a little performance increase.
199767f8919635c4928607450d9e0abb932109ceToomas Soome# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
199767f8919635c4928607450d9e0abb932109ceToomas Soome# endif /* ZLIB_DLL */
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* If building or using zlib with the WINAPI/WINAPIV calling convention,
199767f8919635c4928607450d9e0abb932109ceToomas Soome * define ZLIB_WINAPI.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* No need for _export, use ZLIB.DEF instead. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* For complete Windows compatibility, use WINAPI, not __stdcall. */
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef unsigned int uInt; /* 16 bits or more */
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef unsigned long uLong; /* 32 bits or more */
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if 0 /* was set to #if 0 by ./configure */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
199767f8919635c4928607450d9e0abb932109ceToomas Soome * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
199767f8919635c4928607450d9e0abb932109ceToomas Soome * though the former does not conform to the LFS document), but considering
199767f8919635c4928607450d9e0abb932109ceToomas Soome * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
199767f8919635c4928607450d9e0abb932109ceToomas Soome * equivalently requesting no 64-bit operations
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
199767f8919635c4928607450d9e0abb932109ceToomas Soome# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
199767f8919635c4928607450d9e0abb932109ceToomas Soome# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
199767f8919635c4928607450d9e0abb932109ceToomas Soome# define SEEK_SET 0 /* Seek from beginning of file. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome# define SEEK_CUR 1 /* Seek from current position. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
199767f8919635c4928607450d9e0abb932109ceToomas Soome * This is hard-configured for FreeBSD.
199767f8919635c4928607450d9e0abb932109ceToomas Soome# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* MVS linker does not support external names larger than 8 bytes */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* ZCONF_H */