zconf.h

Go to the documentation of this file.
00001 /* zconf.h -- configuration of the zlib compression library
00002  * Copyright (C) 1995-2005 Jean-loup Gailly.
00003  * For conditions of distribution and use, see copyright notice in zlib.h
00004  */
00005 
00006 /* @(#) $Id$ */
00007 
00008 #ifndef ZCONF_H
00009 #define ZCONF_H
00010 
00011 #if (defined(__SYMBIAN32__) && !defined(SYMBIAN))
00012 #define SYMBIAN
00013 #endif
00014 
00015 
00016 /*
00017  * If you *really* need a unique prefix for all types and library functions,
00018  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
00019  */
00020 #ifdef Z_PREFIX
00021 #  define deflateInit_          z_deflateInit_
00022 #  define deflate               z_deflate
00023 #  define deflateEnd            z_deflateEnd
00024 #  define inflateInit_          z_inflateInit_
00025 #  define inflate               z_inflate
00026 #  define inflateEnd            z_inflateEnd
00027 #  define deflateInit2_         z_deflateInit2_
00028 #  define deflateSetDictionary  z_deflateSetDictionary
00029 #  define deflateCopy           z_deflateCopy
00030 #  define deflateReset          z_deflateReset
00031 #  define deflateParams         z_deflateParams
00032 #  define deflateBound          z_deflateBound
00033 #  define deflatePrime          z_deflatePrime
00034 #  define inflateInit2_         z_inflateInit2_
00035 #  define inflateSetDictionary  z_inflateSetDictionary
00036 #  define inflateSync           z_inflateSync
00037 #  define inflateSyncPoint      z_inflateSyncPoint
00038 #  define inflateCopy           z_inflateCopy
00039 #  define inflateReset          z_inflateReset
00040 #  define inflateBack           z_inflateBack
00041 #  define inflateBackEnd        z_inflateBackEnd
00042 #  define compress              z_compress
00043 #  define compress2             z_compress2
00044 #  define compressBound         z_compressBound
00045 #  define uncompress            z_uncompress
00046 #  define adler32               z_adler32
00047 #  define crc32                 z_crc32
00048 #  define get_crc_table         z_get_crc_table
00049 #  define zError                z_zError
00050 
00051 #  define alloc_func            z_alloc_func
00052 #  define free_func             z_free_func
00053 #  define in_func               z_in_func
00054 #  define out_func              z_out_func
00055 #  define Byte                  z_Byte
00056 #  define uInt                  z_uInt
00057 #  define uLong                 z_uLong
00058 #  define Bytef                 z_Bytef
00059 #  define charf                 z_charf
00060 #  define intf                  z_intf
00061 #  define uIntf                 z_uIntf
00062 #  define uLongf                z_uLongf
00063 #  define voidpf                z_voidpf
00064 #  define voidp                 z_voidp
00065 #endif
00066 
00067 #if defined(__MSDOS__) && !defined(MSDOS)
00068 #  define MSDOS
00069 #endif
00070 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
00071 #  define OS2
00072 #endif
00073 #if defined(_WINDOWS) && !defined(WINDOWS)
00074 #  define WINDOWS
00075 #endif
00076 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
00077 #  ifndef WIN32
00078 #    define WIN32
00079 #  endif
00080 #endif
00081 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
00082 #  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
00083 #    ifndef SYS16BIT
00084 #      define SYS16BIT
00085 #    endif
00086 #  endif
00087 #endif
00088 
00089 /*
00090  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
00091  * than 64k bytes at a time (needed on systems with 16-bit int).
00092  */
00093 #ifdef SYS16BIT
00094 #  define MAXSEG_64K
00095 #endif
00096 #ifdef MSDOS
00097 #  define UNALIGNED_OK
00098 #endif
00099 
00100 #ifdef __STDC_VERSION__
00101 #  ifndef STDC
00102 #    define STDC
00103 #  endif
00104 #  if __STDC_VERSION__ >= 199901L
00105 #    ifndef STDC99
00106 #      define STDC99
00107 #    endif
00108 #  endif
00109 #endif
00110 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
00111 #  define STDC
00112 #endif
00113 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
00114 #  define STDC
00115 #endif
00116 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
00117 #  define STDC
00118 #endif
00119 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
00120 #  define STDC
00121 #endif
00122 
00123 #if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
00124 #  define STDC
00125 #endif
00126 
00127 #ifndef STDC
00128 #  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
00129 #    define const       /* note: need a more gentle solution here */
00130 #  endif
00131 #endif
00132 
00133 /* Some Mac compilers merge all .h files incorrectly: */
00134 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
00135 #  define NO_DUMMY_DECL
00136 #endif
00137 
00138 /* Maximum value for memLevel in deflateInit2 */
00139 #ifndef MAX_MEM_LEVEL
00140 #  ifdef MAXSEG_64K
00141 #    define MAX_MEM_LEVEL 8
00142 #  else
00143 #    define MAX_MEM_LEVEL 9
00144 #  endif
00145 #endif
00146 
00147 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
00148  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
00149  * created by gzip. (Files created by minigzip can still be extracted by
00150  * gzip.)
00151  */
00152 #ifndef  __SYMBIAN32__
00153 #ifndef MAX_WBITS
00154 #define MAX_WBITS   15 /* 32K LZ77 window */
00155 #endif
00156 #else
00157 #ifndef MAX_WBITS
00158 #define MAX_WBITS   13 //default value changed to reduce the ram memory required
00159 #endif
00160 #endif
00161 /* The memory requirements for deflate are (in bytes):
00162             (1 << (windowBits+2)) +  (1 << (memLevel+9))
00163  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
00164  plus a few kilobytes for small objects. For example, if you want to reduce
00165  the default memory requirements from 256K to 128K, compile with
00166      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
00167  Of course this will generally degrade compression (there's no free lunch).
00168 
00169    The memory requirements for inflate are (in bytes) 1 << windowBits
00170  that is, 32K for windowBits=15 (default value) plus a few kilobytes
00171  for small objects.
00172 */
00173 
00174                         /* Type declarations */
00175 
00176 #ifndef OF /* function prototypes */
00177 #  ifdef STDC
00178 #    define OF(args)  args
00179 #  else
00180 #    define OF(args)  ()
00181 #  endif
00182 #endif
00183 
00184 /* The following definitions for FAR are needed only for MSDOS mixed
00185  * model programming (small or medium model with some far allocations).
00186  * This was tested only with MSC; for other MSDOS compilers you may have
00187  * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
00188  * just define FAR to be empty.
00189  */
00190 #ifdef SYS16BIT
00191 #  if defined(M_I86SM) || defined(M_I86MM)
00192      /* MSC small or medium model */
00193 #    define SMALL_MEDIUM
00194 #    ifdef _MSC_VER
00195 #      define FAR _far
00196 #    else
00197 #      define FAR far
00198 #    endif
00199 #  endif
00200 #  if (defined(__SMALL__) || defined(__MEDIUM__))
00201      /* Turbo C small or medium model */
00202 #    define SMALL_MEDIUM
00203 #    ifdef __BORLANDC__
00204 #      define FAR _far
00205 #    else
00206 #      define FAR far
00207 #    endif
00208 #  endif
00209 #endif
00210 
00211 #if defined(WINDOWS) || defined(WIN32)
00212    /* If building or using zlib as a DLL, define ZLIB_DLL.
00213     * This is not mandatory, but it offers a little performance increase.
00214     */
00215 #  ifdef ZLIB_DLL
00216 #    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
00217 #      ifdef ZLIB_INTERNAL
00218 #        define ZEXTERN extern __declspec(dllexport)
00219 #      else
00220 #        define ZEXTERN extern __declspec(dllimport)
00221 #      endif
00222 #    endif
00223 #  endif  /* ZLIB_DLL */
00224    /* If building or using zlib with the WINAPI/WINAPIV calling convention,
00225     * define ZLIB_WINAPI.
00226     * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
00227     */
00228 #  ifdef ZLIB_WINAPI
00229 #    ifdef FAR
00230 #      undef FAR
00231 #    endif
00232 #    include <windows.h>
00233      /* No need for _export, use ZLIB.DEF instead. */
00234      /* For complete Windows compatibility, use WINAPI, not __stdcall. */
00235 #    define ZEXPORT WINAPI
00236 #    ifdef WIN32
00237 #      define ZEXPORTVA WINAPIV
00238 #    else
00239 #      define ZEXPORTVA FAR CDECL
00240 #    endif
00241 #  endif
00242 #endif
00243 
00244 #if defined (__BEOS__)
00245 #  ifdef ZLIB_DLL
00246 #    ifdef ZLIB_INTERNAL
00247 #      define ZEXPORT   __declspec(dllexport)
00248 #      define ZEXPORTVA __declspec(dllexport)
00249 #    else
00250 #      define ZEXPORT   __declspec(dllimport)
00251 #      define ZEXPORTVA __declspec(dllimport)
00252 #    endif
00253 #  endif
00254 #endif
00255 
00256 #ifndef ZEXTERN
00257 #  define ZEXTERN extern
00258 #endif
00259 #ifndef ZEXPORT
00260 #  define ZEXPORT
00261 #endif
00262 #ifndef ZEXPORTVA
00263 #  define ZEXPORTVA
00264 #endif
00265 
00266 #ifndef FAR
00267 #  define FAR
00268 #endif
00269 
00270 #if !defined(__MACTYPES__)
00271 typedef unsigned char  Byte;  /* 8 bits */
00272 #endif
00273 typedef unsigned int   uInt;  /* 16 bits or more */
00274 typedef unsigned long  uLong; /* 32 bits or more */
00275 
00276 #ifdef SMALL_MEDIUM
00277    /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
00278 #  define Bytef Byte FAR
00279 #else
00280    typedef Byte  FAR Bytef;
00281 #endif
00282 typedef char  FAR charf;
00283 typedef int   FAR intf;
00284 typedef uInt  FAR uIntf;
00285 typedef uLong FAR uLongf;
00286 
00287 #ifdef STDC
00288    typedef void const *voidpc;
00289    typedef void FAR   *voidpf;
00290    typedef void       *voidp;
00291 #else
00292    typedef Byte const *voidpc;
00293    typedef Byte FAR   *voidpf;
00294    typedef Byte       *voidp;
00295 #endif
00296 
00297 #if 0           /* HAVE_UNISTD_H -- this line is updated by ./configure */
00298 #  include <sys/types.h> /* for off_t */
00299 #  include <unistd.h>    /* for SEEK_* and off_t */
00300 #  ifdef VMS
00301 #    include <unixio.h>   /* for off_t */
00302 #  endif
00303 #  define z_off_t off_t
00304 #endif
00305 #ifndef SEEK_SET
00306 #  define SEEK_SET        0       /* Seek from beginning of file.  */
00307 #  define SEEK_CUR        1       /* Seek from current position.  */
00308 #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
00309 #endif
00310 #ifndef z_off_t
00311 #  define z_off_t long
00312 #endif
00313 
00314 #if defined(__OS400__)
00315 #  define NO_vsnprintf
00316 #endif
00317 
00318 #if defined(__MVS__)
00319 #  define NO_vsnprintf
00320 #  ifdef FAR
00321 #    undef FAR
00322 #  endif
00323 #endif
00324 
00325 /* MVS linker does not support external names larger than 8 bytes */
00326 #if defined(__MVS__)
00327 #   pragma map(deflateInit_,"DEIN")
00328 #   pragma map(deflateInit2_,"DEIN2")
00329 #   pragma map(deflateEnd,"DEEND")
00330 #   pragma map(deflateBound,"DEBND")
00331 #   pragma map(inflateInit_,"ININ")
00332 #   pragma map(inflateInit2_,"ININ2")
00333 #   pragma map(inflateEnd,"INEND")
00334 #   pragma map(inflateSync,"INSY")
00335 #   pragma map(inflateSetDictionary,"INSEDI")
00336 #   pragma map(compressBound,"CMBND")
00337 #   pragma map(inflate_table,"INTABL")
00338 #   pragma map(inflate_fast,"INFA")
00339 #   pragma map(inflate_copyright,"INCOPY")
00340 #endif
00341 
00342 #endif /* ZCONF_H */

Copyright © Nokia Corporation 2001-2008
Back to top