- Main Page
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

# zconf.h

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