Back to index

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