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