Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# zconf.h

Go to the documentation of this file.

    00001 /* zconf.h -- configuration of the zlib compression library
    00002  * Copyright (C) 1995-1998 Jean-loup Gailly.
    00003  * For conditions of distribution and use, see copyright notice in zlib.h
    00004  */
    00005
    00006 #ifndef _ZCONF_H
    00007 #define _ZCONF_H
    00008
    00009 /*
    00010  * If you *really* need a unique prefix for all types and library functions,
    00011  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
    00012  */
    00013 #ifdef Z_PREFIX
    00014 #  define deflateInit_  z_deflateInit_
    00015 #  define deflate   z_deflate
    00016 #  define deflateEnd    z_deflateEnd
    00017 #  define inflateInit_  z_inflateInit_
    00018 #  define inflate   z_inflate
    00019 #  define inflateEnd    z_inflateEnd
    00020 #  define deflateInit2_ z_deflateInit2_
    00021 #  define deflateSetDictionary z_deflateSetDictionary
    00022 #  define deflateCopy   z_deflateCopy
    00023 #  define deflateReset  z_deflateReset
    00024 #  define deflateParams z_deflateParams
    00025 #  define inflateInit2_ z_inflateInit2_
    00026 #  define inflateSetDictionary z_inflateSetDictionary
    00027 #  define inflateSync   z_inflateSync
    00028 #  define inflateSyncPoint z_inflateSyncPoint
    00029 #  define inflateReset  z_inflateReset
    00030 #  define compress  z_compress
    00031 #  define compress2 z_compress2
    00032 #  define uncompress    z_uncompress
    00033 #  define adler32   z_adler32
    00034 #  define crc32     z_crc32
    00035 #  define get_crc_table z_get_crc_table
    00036
    00037 #  define Byte      z_Byte
    00038 #  define uInt      z_uInt
    00039 #  define uLong     z_uLong
    00040 #  define Bytef         z_Bytef
    00041 #  define charf     z_charf
    00042 #  define intf      z_intf
    00043 #  define uIntf     z_uIntf
    00044 #  define uLongf    z_uLongf
    00045 #  define voidpf    z_voidpf
    00046 #  define voidp     z_voidp
    00047 #endif
    00048
    00049 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
    00050 #  define WIN32
    00051 #endif
    00052 #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
    00053 #  ifndef __32BIT__
    00054 #    define __32BIT__
    00055 #  endif
    00056 #endif
    00057 #if defined(__MSDOS__) && !defined(MSDOS)
    00058 #  define MSDOS
    00059 #endif
    00060
    00061 /*
    00062  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
    00063  * than 64k bytes at a time (needed on systems with 16-bit int).
    00064  */
    00065 #if defined(MSDOS) && !defined(__32BIT__)
    00066 #  define MAXSEG_64K
    00067 #endif
    00068 #ifdef MSDOS
    00069 #  define UNALIGNED_OK
    00070 #endif
    00071
    00072 #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32))  && !defined(STDC)
    00073 #  define STDC
    00074 #endif
    00075 #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
    00076 #  ifndef STDC
    00077 #    define STDC
    00078 #  endif
    00079 #endif
    00080
    00081 #ifndef STDC
    00082 #  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
    00083 #    define const
    00084 #  endif
    00085 #endif
    00086
    00087 /* Some Mac compilers merge all .h files incorrectly: */
    00088 #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
    00089 #  define NO_DUMMY_DECL
    00090 #endif
    00091
    00092 /* Old Borland C incorrectly complains about missing returns: */
    00093 #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
    00094 #  define NEED_DUMMY_RETURN
    00095 #endif
    00096
    00097
    00098 /* Maximum value for memLevel in deflateInit2 */
    00099 #ifndef MAX_MEM_LEVEL
    00100 #  ifdef MAXSEG_64K
    00101 #    define MAX_MEM_LEVEL 8
    00102 #  else
    00103 #    define MAX_MEM_LEVEL 9
    00104 #  endif
    00105 #endif
    00106
    00107 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
    00108  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
    00109  * created by gzip. (Files created by minigzip can still be extracted by
    00110  * gzip.)
    00111  */
    00112 #ifndef MAX_WBITS
    00113 #  define MAX_WBITS   15 /* 32K LZ77 window */
    00114 #endif
    00115
    00116 /* The memory requirements for deflate are (in bytes):
    00117             (1 << (windowBits+2)) +  (1 << (memLevel+9))
    00118  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
    00119  plus a few kilobytes for small objects. For example, if you want to reduce
    00120  the default memory requirements from 256K to 128K, compile with
    00121      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
    00122  Of course this will generally degrade compression (there's no free lunch).
    00123
    00124    The memory requirements for inflate are (in bytes) 1 << windowBits
    00125  that is, 32K for windowBits=15 (default value) plus a few kilobytes
    00126  for small objects.
    00127 */
    00128
    00129                         /* Type declarations */
    00130
    00131 #ifndef OF /* function prototypes */
    00132 #  ifdef STDC
    00133 #    define OF(args)  args
    00134 #  else
    00135 #    define OF(args)  ()
    00136 #  endif
    00137 #endif
    00138
    00139 /* The following definitions for FAR are needed only for MSDOS mixed
    00140  * model programming (small or medium model with some far allocations).
    00141  * This was tested only with MSC; for other MSDOS compilers you may have
    00142  * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
    00143  * just define FAR to be empty.
    00144  */
    00145 #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
    00146    /* MSC small or medium model */
    00147 #  define SMALL_MEDIUM
    00148 #  ifdef _MSC_VER
    00149 #    define FAR _far
    00150 #  else
    00151 #    define FAR far
    00152 #  endif
    00153 #endif
    00154 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
    00155 #  ifndef __32BIT__
    00156 #    define SMALL_MEDIUM
    00157 #    define FAR _far
    00158 #  endif
    00159 #endif
    00160
    00161 /* Compile with -DZLIB_DLL for Windows DLL support */
    00162 #if defined(ZLIB_DLL)
    00163 #  if defined(_WINDOWS) || defined(WINDOWS)
    00164 #    ifdef FAR
    00165 #      undef FAR
    00166 #    endif
    00167 #    include <windows.h>
    00168 #    ifdef WIN32
    00169 #      define ZEXPORT  WINAPI
    00170 #      define ZEXPORTVA  WINAPIV
    00171 #    else
    00172 #      define ZEXPORT  WINAPI _export
    00173 #      define ZEXPORTVA  FAR _cdecl _export
    00174 #    endif
    00175 #  endif
    00176 #  if defined (__BORLANDC__)
    00177 #    if (__BORLANDC__ >= 0x0500) && defined (WIN32)
    00178 #      include <windows.h>
    00179 #      define ZEXPORT __declspec(dllexport) WINAPI
    00180 #      define ZEXPORTRVA __declspec(dllexport) WINAPIV
    00181 #    else
    00182 #      if defined (_Windows) && defined (__DLL__)
    00183 #        define ZEXPORT _export
    00184 #        define ZEXPORTVA _export
    00185 #      endif
    00186 #    endif
    00187 #  endif
    00188 #endif
    00189
    00190 #if defined (__BEOS__)
    00191 #  if defined (ZLIB_DLL)
    00192 #    define ZEXTERN extern __declspec(dllexport)
    00193 #  else
    00194 #    define ZEXTERN extern __declspec(dllimport)
    00195 #  endif
    00196 #endif
    00197
    00198 #ifndef ZEXPORT
    00199 #  define ZEXPORT
    00200 #endif
    00201 #ifndef ZEXPORTVA
    00202 #  define ZEXPORTVA
    00203 #endif
    00204 #ifndef ZEXTERN
    00205 #  define ZEXTERN extern
    00206 #endif
    00207
    00208 #ifndef FAR
    00209 #   define FAR
    00210 #endif
    00211
    00212 #if !defined(MACOS) && !defined(TARGET_OS_MAC)
    00213 typedef unsigned char  Byte;  /* 8 bits */
    00214 #endif
    00215 typedef unsigned int   uInt;  /* 16 bits or more */
    00216 typedef unsigned long  uLong; /* 32 bits or more */
    00217
    00218 #ifdef SMALL_MEDIUM
    00219    /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
    00220 #  define Bytef Byte FAR
    00221 #else
    00222    typedef Byte  FAR Bytef;
    00223 #endif
    00224 typedef char  FAR charf;
    00225 typedef int   FAR intf;
    00226 typedef uInt  FAR uIntf;
    00227 typedef uLong FAR uLongf;
    00228
    00229 #ifdef STDC
    00230    typedef void FAR *voidpf;
    00231    typedef void     *voidp;
    00232 #else
    00233    typedef Byte FAR *voidpf;
    00234    typedef Byte     *voidp;
    00235 #endif
    00236
    00237 #ifdef HAVE_UNISTD_H
    00238 #  include <sys/types.h> /* for off_t */
    00239 #  include <unistd.h>    /* for SEEK_* and off_t */
    00240 #  define z_off_t  off_t
    00241 #endif
    00242 #ifndef SEEK_SET
    00243 #  define SEEK_SET        0       /* Seek from beginning of file.  */
    00244 #  define SEEK_CUR        1       /* Seek from current position.  */
    00245 #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
    00246 #endif
    00247 #ifndef z_off_t
    00248 #  define  z_off_t long
    00249 #endif
    00250
    00251 /* MVS linker does not support external names larger than 8 bytes */
    00252 #if defined(__MVS__)
    00253 #   pragma map(deflateInit_,"DEIN")
    00254 #   pragma map(deflateInit2_,"DEIN2")
    00255 #   pragma map(deflateEnd,"DEEND")
    00256 #   pragma map(inflateInit_,"ININ")
    00257 #   pragma map(inflateInit2_,"ININ2")
    00258 #   pragma map(inflateEnd,"INEND")
    00259 #   pragma map(inflateSync,"INSY")
    00260 #   pragma map(inflateSetDictionary,"INSEDI")
    00261 #   pragma map(inflate_blocks,"INBL")
    00262 #   pragma map(inflate_blocks_new,"INBLNE")
    00263 #   pragma map(inflate_blocks_free,"INBLFR")
    00264 #   pragma map(inflate_blocks_reset,"INBLRE")
    00265 #   pragma map(inflate_codes_free,"INCOFR")
    00266 #   pragma map(inflate_codes,"INCO")
    00267 #   pragma map(inflate_fast,"INFA")
    00268 #   pragma map(inflate_flush,"INFLU")
    00269 #   pragma map(inflate_mask,"INMA")
    00270 #   pragma map(inflate_set_dictionary,"INSEDI2")
    00271 #   pragma map(inflate_copyright,"INCOPY")
    00272 #   pragma map(inflate_trees_bits,"INTRBI")
    00273 #   pragma map(inflate_trees_dynamic,"INTRDY")
    00274 #   pragma map(inflate_trees_fixed,"INTRFI")
    00275 #   pragma map(inflate_trees_free,"INTRFR")
    00276 #endif
    00277
    00278 #endif /* _ZCONF_H */