Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 244 | chris | 1 | /* zconf.h -- configuration of the zlib compression library |
| 2 | * Copyright (C) 1995-1998 Jean-loup Gailly. |
||
| 3 | * For conditions of distribution and use, see copyright notice in zlib.h |
||
| 4 | */ |
||
| 5 | |||
| 6 | /* @(#) $Id: zconf.h,v 1.1 2003/04/29 21:57:48 ace Exp $ */ |
||
| 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 | #ifdef Z_PREFIX |
||
| 16 | # define deflateInit_ z_deflateInit_ |
||
| 17 | # define deflate z_deflate |
||
| 18 | # define deflateEnd z_deflateEnd |
||
| 19 | # define inflateInit_ z_inflateInit_ |
||
| 20 | # define inflate z_inflate |
||
| 21 | # define inflateEnd z_inflateEnd |
||
| 22 | # define deflateInit2_ z_deflateInit2_ |
||
| 23 | # define deflateSetDictionary z_deflateSetDictionary |
||
| 24 | # define deflateCopy z_deflateCopy |
||
| 25 | # define deflateReset z_deflateReset |
||
| 26 | # define deflateParams z_deflateParams |
||
| 27 | # define inflateInit2_ z_inflateInit2_ |
||
| 28 | # define inflateSetDictionary z_inflateSetDictionary |
||
| 29 | # define inflateSync z_inflateSync |
||
| 30 | # define inflateSyncPoint z_inflateSyncPoint |
||
| 31 | # define inflateReset z_inflateReset |
||
| 32 | # define compress z_compress |
||
| 33 | # define compress2 z_compress2 |
||
| 34 | # define uncompress z_uncompress |
||
| 35 | # define adler32 z_adler32 |
||
| 36 | # define crc32 z_crc32 |
||
| 37 | # define get_crc_table z_get_crc_table |
||
| 38 | |||
| 39 | # define Byte z_Byte |
||
| 40 | # define uInt z_uInt |
||
| 41 | # define uLong z_uLong |
||
| 42 | # define Bytef z_Bytef |
||
| 43 | # define charf z_charf |
||
| 44 | # define intf z_intf |
||
| 45 | # define uIntf z_uIntf |
||
| 46 | # define uLongf z_uLongf |
||
| 47 | # define voidpf z_voidpf |
||
| 48 | # define voidp z_voidp |
||
| 49 | #endif |
||
| 50 | |||
| 51 | #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) |
||
| 52 | # define WIN32 |
||
| 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 | # define MSDOS |
||
| 61 | #endif |
||
| 62 | |||
| 63 | /* |
||
| 64 | * Compile with -DMAXSEG_64K if the alloc function cannot allocate more |
||
| 65 | * than 64k bytes at a time (needed on systems with 16-bit int). |
||
| 66 | */ |
||
| 67 | #if defined(MSDOS) && !defined(__32BIT__) |
||
| 68 | # define MAXSEG_64K |
||
| 69 | #endif |
||
| 70 | #ifdef MSDOS |
||
| 71 | # define UNALIGNED_OK |
||
| 72 | #endif |
||
| 73 | |||
| 74 | #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC) |
||
| 75 | # define STDC |
||
| 76 | #endif |
||
| 77 | #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__) |
||
| 78 | # ifndef STDC |
||
| 79 | # define STDC |
||
| 80 | # endif |
||
| 81 | #endif |
||
| 82 | |||
| 83 | #ifndef STDC |
||
| 84 | # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ |
||
| 85 | # define constt |
||
| 86 | # endif |
||
| 87 | #endif |
||
| 88 | |||
| 89 | /* Some Mac compilers merge all .h files incorrectly: */ |
||
| 90 | #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) |
||
| 91 | # define NO_DUMMY_DECL |
||
| 92 | #endif |
||
| 93 | |||
| 94 | /* Old Borland C incorrectly complains about missing returns: */ |
||
| 95 | #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) |
||
| 96 | # define NEED_DUMMY_RETURN |
||
| 97 | #endif |
||
| 98 | |||
| 99 | |||
| 100 | /* Maximum value for memLevel in deflateInit2 */ |
||
| 101 | #ifndef MAX_MEM_LEVEL |
||
| 102 | # ifdef MAXSEG_64K |
||
| 103 | # define MAX_MEM_LEVEL 8 |
||
| 104 | # else |
||
| 105 | # define MAX_MEM_LEVEL 9 |
||
| 106 | # endif |
||
| 107 | #endif |
||
| 108 | |||
| 109 | /* Maximum value for windowBits in deflateInit2 and inflateInit2. |
||
| 110 | * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files |
||
| 111 | * created by gzip. (Files created by minigzip can still be extracted by |
||
| 112 | * gzip.) |
||
| 113 | */ |
||
| 114 | #ifndef MAX_WBITS |
||
| 115 | # define MAX_WBITS 15 /* 32K LZ77 window */ |
||
| 116 | #endif |
||
| 117 | |||
| 118 | /* The memory requirements for deflate are (in bytes): |
||
| 119 | (1 << (windowBits+2)) + (1 << (memLevel+9)) |
||
| 120 | that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) |
||
| 121 | plus a few kilobytes for small objects. For example, if you want to reduce |
||
| 122 | the default memory requirements from 256K to 128K, compile with |
||
| 123 | make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" |
||
| 124 | Of course this will generally degrade compression (there's no free lunch). |
||
| 125 | |||
| 126 | The memory requirements for inflate are (in bytes) 1 << windowBits |
||
| 127 | that is, 32K for windowBits=15 (default value) plus a few kilobytes |
||
| 128 | for small objects. |
||
| 129 | */ |
||
| 130 | |||
| 131 | /* Type declarations */ |
||
| 132 | |||
| 133 | #ifndef OF /* function prototypes */ |
||
| 134 | # ifdef STDC |
||
| 135 | # define OF(args) args |
||
| 136 | # else |
||
| 137 | # define OF(args) () |
||
| 138 | # endif |
||
| 139 | #endif |
||
| 140 | |||
| 141 | /* The following definitions for FAR are needed only for MSDOS mixed |
||
| 142 | * model programming (small or medium model with some far allocations). |
||
| 143 | * This was tested only with MSC; for other MSDOS compilers you may have |
||
| 144 | * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, |
||
| 145 | * just define FAR to be empty. |
||
| 146 | */ |
||
| 147 | #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__) |
||
| 148 | /* MSC small or medium model */ |
||
| 149 | # define SMALL_MEDIUM |
||
| 150 | # ifdef _MSC_VER |
||
| 151 | # define FAR _far |
||
| 152 | # else |
||
| 153 | # define FAR far |
||
| 154 | # endif |
||
| 155 | #endif |
||
| 156 | #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__)) |
||
| 157 | # ifndef __32BIT__ |
||
| 158 | # define SMALL_MEDIUM |
||
| 159 | # define FAR _far |
||
| 160 | # endif |
||
| 161 | #endif |
||
| 162 | |||
| 163 | /* Compile with -DZLIB_DLL for Windows DLL support */ |
||
| 164 | #if defined(ZLIB_DLL) |
||
| 165 | # if defined(_WINDOWS) || defined(WINDOWS) |
||
| 166 | # ifdef FAR |
||
| 167 | # undef FAR |
||
| 168 | # endif |
||
| 169 | # include <windows.h> |
||
| 170 | # if defined (_VISUALC_) |
||
| 171 | # define ZEXTERN extern __declspec(dllexport) |
||
| 172 | # else |
||
| 173 | # define ZEXPORT WINAPI |
||
| 174 | # define ZEXPORT ZEXPORT __declspec(dllexport) |
||
| 175 | # ifdef WIN32 |
||
| 176 | # define ZEXPORTVA WINAPIV |
||
| 177 | # define ZEXPORTVA __declspec(dllexport) |
||
| 178 | # else |
||
| 179 | # define ZEXPORTVA FAR _cdecl _export |
||
| 180 | # endif |
||
| 181 | # endif |
||
| 182 | # endif |
||
| 183 | # if defined (__BORLANDC__) |
||
| 184 | # if (__BORLANDC__ >= 0x0500) && defined (WIN32) |
||
| 185 | # include <windows.h> |
||
| 186 | # define ZEXPORT __declspec(dllexport) WINAPI |
||
| 187 | # define ZEXPORTRVA __declspec(dllexport) WINAPIV |
||
| 188 | # else |
||
| 189 | # if defined (_Windows) && defined (__DLL__) |
||
| 190 | # define ZEXPORT _export |
||
| 191 | # define ZEXPORTVA _export |
||
| 192 | # endif |
||
| 193 | # endif |
||
| 194 | # endif |
||
| 195 | #endif |
||
| 196 | #if defined (__BEOS__) |
||
| 197 | # if defined (ZLIB_DLL) |
||
| 198 | # define ZEXTERN extern __declspec(dllexport) |
||
| 199 | # else |
||
| 200 | # define ZEXTERN extern __declspec(dllimport) |
||
| 201 | # endif |
||
| 202 | #endif |
||
| 203 | |||
| 204 | |||
| 205 | #ifndef ZEXPORT |
||
| 206 | # define ZEXPORT |
||
| 207 | #endif |
||
| 208 | #ifndef ZEXPORTVA |
||
| 209 | # define ZEXPORTVA |
||
| 210 | #endif |
||
| 211 | #ifndef ZEXTERN |
||
| 212 | # define ZEXTERN extern |
||
| 213 | #endif |
||
| 214 | |||
| 215 | #ifndef FAR |
||
| 216 | # define FAR |
||
| 217 | #endif |
||
| 218 | |||
| 219 | #if !defined(MACOS) && !defined(TARGET_OS_MAC) |
||
| 220 | typedef unsigned char Byte; /* 8 bits */ |
||
| 221 | #endif |
||
| 222 | typedef unsigned int uInt; /* 16 bits or more */ |
||
| 223 | typedef unsigned long uLong; /* 32 bits or more */ |
||
| 224 | |||
| 225 | #ifdef SMALL_MEDIUM |
||
| 226 | /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ |
||
| 227 | # define Bytef Byte FAR |
||
| 228 | #else |
||
| 229 | typedef Byte FAR Bytef; |
||
| 230 | #endif |
||
| 231 | typedef char FAR charf; |
||
| 232 | typedef int FAR intf; |
||
| 233 | typedef uInt FAR uIntf; |
||
| 234 | typedef uLong FAR uLongf; |
||
| 235 | |||
| 236 | #ifdef STDC |
||
| 237 | typedef void FAR *voidpf; |
||
| 238 | typedef void *voidp; |
||
| 239 | #else |
||
| 240 | typedef Byte FAR *voidpf; |
||
| 241 | typedef Byte *voidp; |
||
| 242 | #endif |
||
| 243 | |||
| 244 | #ifdef HAVE_UNISTD_H |
||
| 245 | # include <sys/types.h> /* for off_t */ |
||
| 246 | # include <unistd.h> /* for SEEK_* and off_t */ |
||
| 247 | # define z_off_t off_t |
||
| 248 | #endif |
||
| 249 | #ifndef SEEK_SET |
||
| 250 | # define SEEK_SET 0 /* Seek from beginning of file. */ |
||
| 251 | # define SEEK_CUR 1 /* Seek from current position. */ |
||
| 252 | # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ |
||
| 253 | #endif |
||
| 254 | #ifndef z_off_t |
||
| 255 | # define z_off_t long |
||
| 256 | #endif |
||
| 257 | |||
| 258 | /* MVS linker does not support external names larger than 8 bytes */ |
||
| 259 | #if defined(__MVS__) |
||
| 260 | # pragma map(deflateInit_,"DEIN") |
||
| 261 | # pragma map(deflateInit2_,"DEIN2") |
||
| 262 | # pragma map(deflateEnd,"DEEND") |
||
| 263 | # pragma map(inflateInit_,"ININ") |
||
| 264 | # pragma map(inflateInit2_,"ININ2") |
||
| 265 | # pragma map(inflateEnd,"INEND") |
||
| 266 | # pragma map(inflateSync,"INSY") |
||
| 267 | # pragma map(inflateSetDictionary,"INSEDI") |
||
| 268 | # pragma map(inflate_blocks,"INBL") |
||
| 269 | # pragma map(inflate_blocks_new,"INBLNE") |
||
| 270 | # pragma map(inflate_blocks_free,"INBLFR") |
||
| 271 | # pragma map(inflate_blocks_reset,"INBLRE") |
||
| 272 | # pragma map(inflate_codes_free,"INCOFR") |
||
| 273 | # pragma map(inflate_codes,"INCO") |
||
| 274 | # pragma map(inflate_fast,"INFA") |
||
| 275 | # pragma map(inflate_flush,"INFLU") |
||
| 276 | # pragma map(inflate_mask,"INMA") |
||
| 277 | # pragma map(inflate_set_dictionary,"INSEDI2") |
||
| 278 | # pragma map(inflate_copyright,"INCOPY") |
||
| 279 | # pragma map(inflate_trees_bits,"INTRBI") |
||
| 280 | # pragma map(inflate_trees_dynamic,"INTRDY") |
||
| 281 | # pragma map(inflate_trees_fixed,"INTRFI") |
||
| 282 | # pragma map(inflate_trees_free,"INTRFR") |
||
| 283 | #endif |
||
| 284 | |||
| 285 | #endif /* _ZCONF_H */ |