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