|
| 1 | +/* zconf.h -- configuration of the zlib compression library |
| 2 | + * Copyright (C) 1995-2002 Jean-loup Gailly. |
| 3 | + * For conditions of distribution and use, see copyright notice in zlib.h |
| 4 | + */ |
| 5 | + |
| 6 | +/* @(#) $Id$ */ |
| 7 | + |
| 8 | +#ifndef_ZCONF_H |
| 9 | +#define_ZCONF_H |
| 10 | + |
| 11 | +/* |
| 12 | + * If you *really* need a unique prefix for all types and library functions, |
| 13 | + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. |
| 14 | + */ |
| 15 | +#ifdefZ_PREFIX |
| 16 | +# definedeflateInit_ z_deflateInit_ |
| 17 | +# definedeflate z_deflate |
| 18 | +# definedeflateEnd z_deflateEnd |
| 19 | +# defineinflateInit_ z_inflateInit_ |
| 20 | +# defineinflate z_inflate |
| 21 | +# defineinflateEnd z_inflateEnd |
| 22 | +# definedeflateInit2_ z_deflateInit2_ |
| 23 | +# definedeflateSetDictionary z_deflateSetDictionary |
| 24 | +# definedeflateCopy z_deflateCopy |
| 25 | +# definedeflateReset z_deflateReset |
| 26 | +# definedeflateParams z_deflateParams |
| 27 | +# defineinflateInit2_ z_inflateInit2_ |
| 28 | +# defineinflateSetDictionary z_inflateSetDictionary |
| 29 | +# defineinflateSync z_inflateSync |
| 30 | +# defineinflateSyncPoint z_inflateSyncPoint |
| 31 | +# defineinflateReset z_inflateReset |
| 32 | +# definecompress z_compress |
| 33 | +# definecompress2 z_compress2 |
| 34 | +# defineuncompress z_uncompress |
| 35 | +# defineadler32 z_adler32 |
| 36 | +# definecrc32 z_crc32 |
| 37 | +# defineget_crc_table z_get_crc_table |
| 38 | + |
| 39 | +# defineByte z_Byte |
| 40 | +# defineuInt z_uInt |
| 41 | +# defineuLong z_uLong |
| 42 | +# defineBytef z_Bytef |
| 43 | +# definecharf z_charf |
| 44 | +# defineintf z_intf |
| 45 | +# defineuIntf z_uIntf |
| 46 | +# defineuLongf z_uLongf |
| 47 | +# definevoidpf z_voidpf |
| 48 | +# definevoidp z_voidp |
| 49 | +#endif |
| 50 | + |
| 51 | +#if (defined(_WIN32)|| defined(__WIN32__))&& !defined(WIN32) |
| 52 | +# defineWIN32 |
| 53 | +#endif |
| 54 | +#if defined(__GNUC__)|| defined(WIN32)|| defined(__386__)|| defined(i386) |
| 55 | +# ifndef__32BIT__ |
| 56 | +# define__32BIT__ |
| 57 | +# endif |
| 58 | +#endif |
| 59 | +#if defined(__MSDOS__)&& !defined(MSDOS) |
| 60 | +# defineMSDOS |
| 61 | +#endif |
| 62 | + |
| 63 | +/* WinCE doesn't have errno.h */ |
| 64 | +#ifdef_WIN32_WCE |
| 65 | +# defineNO_ERRNO_H |
| 66 | +#endif |
| 67 | + |
| 68 | + |
| 69 | +/* |
| 70 | + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more |
| 71 | + * than 64k bytes at a time (needed on systems with 16-bit int). |
| 72 | + */ |
| 73 | +#if defined(MSDOS)&& !defined(__32BIT__) |
| 74 | +# defineMAXSEG_64K |
| 75 | +#endif |
| 76 | +#ifdefMSDOS |
| 77 | +# defineUNALIGNED_OK |
| 78 | +#endif |
| 79 | + |
| 80 | +#if (defined(MSDOS)|| defined(_WINDOWS)|| defined(WIN32))&& !defined(STDC) |
| 81 | +# defineSTDC |
| 82 | +#endif |
| 83 | +#if defined(__STDC__)|| defined(__cplusplus)|| defined(__OS2__) |
| 84 | +# ifndefSTDC |
| 85 | +# defineSTDC |
| 86 | +# endif |
| 87 | +#endif |
| 88 | + |
| 89 | +#ifndefSTDC |
| 90 | +# ifndefconst/* cannot use !defined(STDC) && !defined(const) on Mac */ |
| 91 | +# defineconst |
| 92 | +# endif |
| 93 | +#endif |
| 94 | + |
| 95 | +/* Some Mac compilers merge all .h files incorrectly: */ |
| 96 | +#if defined(__MWERKS__)|| defined(applec)||defined(THINK_C)||defined(__SC__) |
| 97 | +# defineNO_DUMMY_DECL |
| 98 | +#endif |
| 99 | + |
| 100 | +/* Old Borland C and LCC incorrectly complains about missing returns: */ |
| 101 | +#if defined(__BORLANDC__)&& (__BORLANDC__<0x500) |
| 102 | +# defineNEED_DUMMY_RETURN |
| 103 | +#endif |
| 104 | + |
| 105 | +#if defined(__LCC__) |
| 106 | +# defineNEED_DUMMY_RETURN |
| 107 | +#endif |
| 108 | + |
| 109 | +/* Maximum value for memLevel in deflateInit2 */ |
| 110 | +#ifndefMAX_MEM_LEVEL |
| 111 | +# ifdefMAXSEG_64K |
| 112 | +# defineMAX_MEM_LEVEL 8 |
| 113 | +# else |
| 114 | +# defineMAX_MEM_LEVEL 9 |
| 115 | +# endif |
| 116 | +#endif |
| 117 | + |
| 118 | +/* Maximum value for windowBits in deflateInit2 and inflateInit2. |
| 119 | + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files |
| 120 | + * created by gzip. (Files created by minigzip can still be extracted by |
| 121 | + * gzip.) |
| 122 | + */ |
| 123 | +#ifndefMAX_WBITS |
| 124 | +# defineMAX_WBITS 15/* 32K LZ77 window */ |
| 125 | +#endif |
| 126 | + |
| 127 | +/* The memory requirements for deflate are (in bytes): |
| 128 | + (1 << (windowBits+2)) + (1 << (memLevel+9)) |
| 129 | + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) |
| 130 | + plus a few kilobytes for small objects. For example, if you want to reduce |
| 131 | + the default memory requirements from 256K to 128K, compile with |
| 132 | + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" |
| 133 | + Of course this will generally degrade compression (there's no free lunch). |
| 134 | +
|
| 135 | + The memory requirements for inflate are (in bytes) 1 << windowBits |
| 136 | + that is, 32K for windowBits=15 (default value) plus a few kilobytes |
| 137 | + for small objects. |
| 138 | +*/ |
| 139 | + |
| 140 | +/* Type declarations */ |
| 141 | + |
| 142 | +#ifndefOF/* function prototypes */ |
| 143 | +# ifdefSTDC |
| 144 | +# defineOF(args) args |
| 145 | +# else |
| 146 | +# defineOF(args) () |
| 147 | +# endif |
| 148 | +#endif |
| 149 | + |
| 150 | +/* The following definitions for FAR are needed only for MSDOS mixed |
| 151 | + * model programming (small or medium model with some far allocations). |
| 152 | + * This was tested only with MSC; for other MSDOS compilers you may have |
| 153 | + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, |
| 154 | + * just define FAR to be empty. |
| 155 | + */ |
| 156 | +#if (defined(M_I86SM)|| defined(M_I86MM))&& !defined(__32BIT__) |
| 157 | +/* MSC small or medium model */ |
| 158 | +# defineSMALL_MEDIUM |
| 159 | +# ifdef_MSC_VER |
| 160 | +# defineFAR _far |
| 161 | +# else |
| 162 | +# defineFAR far |
| 163 | +# endif |
| 164 | +#endif |
| 165 | +#if defined(__BORLANDC__)&& (defined(__SMALL__)|| defined(__MEDIUM__)) |
| 166 | +# ifndef__32BIT__ |
| 167 | +# defineSMALL_MEDIUM |
| 168 | +# defineFAR _far |
| 169 | +# endif |
| 170 | +#endif |
| 171 | + |
| 172 | +/* Compile with -DZLIB_DLL for Windows DLL support */ |
| 173 | +#if defined(ZLIB_DLL) |
| 174 | +# if defined(_WINDOWS)|| defined(WINDOWS) |
| 175 | +# ifdefFAR |
| 176 | +# undef FAR |
| 177 | +# endif |
| 178 | +# include<windows.h> |
| 179 | +# defineZEXPORT(x) x WINAPI |
| 180 | +# ifdefWIN32 |
| 181 | +# defineZEXPORTVA(x) x WINAPIV |
| 182 | +# else |
| 183 | +# defineZEXPORTVA(x) x FAR _cdecl _export |
| 184 | +# endif |
| 185 | +# endif |
| 186 | +# if defined (__BORLANDC__) |
| 187 | +# if (__BORLANDC__ >=0x0500)&& defined (WIN32) |
| 188 | +# include<windows.h> |
| 189 | +# defineZEXPORT(x) x __declspec(dllexport) WINAPI |
| 190 | +# defineZEXPORTRVA(x) x __declspec(dllexport) WINAPIV |
| 191 | +# else |
| 192 | +# if defined (_Windows)&& defined (__DLL__) |
| 193 | +# defineZEXPORT(x) x _export |
| 194 | +# defineZEXPORTVA(x) x _export |
| 195 | +# endif |
| 196 | +# endif |
| 197 | +# endif |
| 198 | +#endif |
| 199 | + |
| 200 | + |
| 201 | +#ifndefZEXPORT |
| 202 | +# defineZEXPORT(x) static x |
| 203 | +#endif |
| 204 | +#ifndefZEXPORTVA |
| 205 | +# defineZEXPORTVA(x) static x |
| 206 | +#endif |
| 207 | +#ifndefZEXTERN |
| 208 | +# defineZEXTERN(x) static x |
| 209 | +#endif |
| 210 | +#ifndefZEXTERNDEF |
| 211 | +# defineZEXTERNDEF(x) static x |
| 212 | +#endif |
| 213 | + |
| 214 | +#ifndefFAR |
| 215 | +# defineFAR |
| 216 | +#endif |
| 217 | + |
| 218 | +#if !defined(__MACTYPES__) |
| 219 | +typedefunsignedcharByte;/* 8 bits */ |
| 220 | +#endif |
| 221 | +typedefunsignedintuInt;/* 16 bits or more */ |
| 222 | +typedefunsigned longuLong;/* 32 bits or more */ |
| 223 | + |
| 224 | +#ifdefSMALL_MEDIUM |
| 225 | +/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ |
| 226 | +# defineBytef Byte FAR |
| 227 | +#else |
| 228 | +typedefByteFARBytef; |
| 229 | +#endif |
| 230 | +typedefcharFARcharf; |
| 231 | +typedefintFARintf; |
| 232 | +typedefuIntFARuIntf; |
| 233 | +typedefuLongFARuLongf; |
| 234 | + |
| 235 | +#ifdefSTDC |
| 236 | +typedefvoidFAR*voidpf; |
| 237 | +typedefvoid*voidp; |
| 238 | +#else |
| 239 | +typedefByteFAR*voidpf; |
| 240 | +typedefByte*voidp; |
| 241 | +#endif |
| 242 | + |
| 243 | +#ifdefHAVE_UNISTD_H |
| 244 | +# include<sys/types.h>/* for off_t */ |
| 245 | +# include<unistd.h>/* for SEEK_* and off_t */ |
| 246 | +# definez_off_t off_t |
| 247 | +#endif |
| 248 | +#ifndefSEEK_SET |
| 249 | +# defineSEEK_SET 0/* Seek from beginning of file. */ |
| 250 | +# defineSEEK_CUR 1/* Seek from current position. */ |
| 251 | +# defineSEEK_END 2/* Set file pointer to EOF plus "offset" */ |
| 252 | +#endif |
| 253 | +#ifndefz_off_t |
| 254 | +# definez_off_t long |
| 255 | +#endif |
| 256 | + |
| 257 | +/* MVS linker does not support external names larger than 8 bytes */ |
| 258 | +#if defined(__MVS__) |
| 259 | +# pragma map(deflateInit_,"DEIN") |
| 260 | +# pragma map(deflateInit2_,"DEIN2") |
| 261 | +# pragma map(deflateEnd,"DEEND") |
| 262 | +# pragma map(inflateInit_,"ININ") |
| 263 | +# pragma map(inflateInit2_,"ININ2") |
| 264 | +# pragma map(inflateEnd,"INEND") |
| 265 | +# pragma map(inflateSync,"INSY") |
| 266 | +# pragma map(inflateSetDictionary,"INSEDI") |
| 267 | +# pragma map(inflate_blocks,"INBL") |
| 268 | +# pragma map(inflate_blocks_new,"INBLNE") |
| 269 | +# pragma map(inflate_blocks_free,"INBLFR") |
| 270 | +# pragma map(inflate_blocks_reset,"INBLRE") |
| 271 | +# pragma map(inflate_codes_free,"INCOFR") |
| 272 | +# pragma map(inflate_codes,"INCO") |
| 273 | +# pragma map(inflate_fast,"INFA") |
| 274 | +# pragma map(inflate_flush,"INFLU") |
| 275 | +# pragma map(inflate_mask,"INMA") |
| 276 | +# pragma map(inflate_set_dictionary,"INSEDI2") |
| 277 | +# pragma map(inflate_copyright,"INCOPY") |
| 278 | +# pragma map(inflate_trees_bits,"INTRBI") |
| 279 | +# pragma map(inflate_trees_dynamic,"INTRDY") |
| 280 | +# pragma map(inflate_trees_fixed,"INTRFI") |
| 281 | +# pragma map(inflate_trees_free,"INTRFR") |
| 282 | +#endif |
| 283 | + |
| 284 | +#endif/* _ZCONF_H */ |