zlib/zconf.h.in

507 lines
15 KiB
C
Raw Normal View History

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