1 /* $MirOS: src/kern/include/zconf.h,v 1.8 2013/08/06 17:01:21 tg Exp $ */ 2 3 /* zconf.h -- configuration of the zlib compression library 4 * Copyright (c) 2006-2013 Thorsten Glaser. 5 * Copyright (C) 1995-2013 Jean-loup Gailly. 6 * For conditions of distribution and use, see copyright notice in zlib.h 7 */ 8 9 /* @(#) $Id$ */ 10 11 #ifndef ZCONF_H 12 #define ZCONF_H 13 14 /* 15 * If you *really* need a unique prefix for all types and library functions, 16 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. 17 * Even better than compiling with -DZ_PREFIX would be to use configure to set 18 * this permanently in zconf.h using "./configure --zprefix". 19 */ 20 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ 21 # define Z_PREFIX_SET 22 23 /* all linked symbols */ 24 # define _dist_code z__dist_code 25 # define _length_code z__length_code 26 # define _tr_align z__tr_align 27 # define _tr_flush_bits z__tr_flush_bits 28 # define _tr_flush_block z__tr_flush_block 29 # define _tr_init z__tr_init 30 # define _tr_stored_block z__tr_stored_block 31 # define _tr_tally z__tr_tally 32 # define adler32 z_adler32 33 # define adler32_combine z_adler32_combine 34 # define adler32_combine64 z_adler32_combine64 35 # ifndef Z_SOLO 36 # define compress z_compress 37 # define compress2 z_compress2 38 # define compressBound z_compressBound 39 # endif 40 # define crc32 z_crc32 41 # define crc32_combine z_crc32_combine 42 # define crc32_combine64 z_crc32_combine64 43 # define deflate z_deflate 44 # define deflateBound z_deflateBound 45 # define deflateCopy z_deflateCopy 46 # define deflateEnd z_deflateEnd 47 # define deflateInit2_ z_deflateInit2_ 48 # define deflateInit_ z_deflateInit_ 49 # define deflateParams z_deflateParams 50 # define deflatePending z_deflatePending 51 # define deflatePrime z_deflatePrime 52 # define deflateReset z_deflateReset 53 # define deflateResetKeep z_deflateResetKeep 54 # define deflateSetDictionary z_deflateSetDictionary 55 # define deflateSetHeader z_deflateSetHeader 56 # define deflateTune z_deflateTune 57 # define deflate_copyright z_deflate_copyright 58 # define get_crc_table z_get_crc_table 59 # ifndef Z_SOLO 60 # define gz_error z_gz_error 61 # define gz_intmax z_gz_intmax 62 # define gz_strwinerror z_gz_strwinerror 63 # define gzbuffer z_gzbuffer 64 # define gzclearerr z_gzclearerr 65 # define gzclose z_gzclose 66 # define gzclose_r z_gzclose_r 67 # define gzclose_w z_gzclose_w 68 # define gzdirect z_gzdirect 69 # define gzdopen z_gzdopen 70 # define gzeof z_gzeof 71 # define gzerror z_gzerror 72 # define gzflush z_gzflush 73 # define gzgetc z_gzgetc 74 # define gzgetc_ z_gzgetc_ 75 # define gzgets z_gzgets 76 # define gzoffset z_gzoffset 77 # define gzoffset64 z_gzoffset64 78 # define gzopen z_gzopen 79 # define gzopen64 z_gzopen64 80 # ifdef _WIN32 81 # define gzopen_w z_gzopen_w 82 # endif 83 # define gzprintf z_gzprintf 84 # define gzvprintf z_gzvprintf 85 # define gzputc z_gzputc 86 # define gzputs z_gzputs 87 # define gzread z_gzread 88 # define gzrewind z_gzrewind 89 # define gzseek z_gzseek 90 # define gzseek64 z_gzseek64 91 # define gzsetparams z_gzsetparams 92 # define gztell z_gztell 93 # define gztell64 z_gztell64 94 # define gzungetc z_gzungetc 95 # define gzwrite z_gzwrite 96 # endif 97 # define inflate z_inflate 98 # define inflateBack z_inflateBack 99 # define inflateBackEnd z_inflateBackEnd 100 # define inflateBackInit_ z_inflateBackInit_ 101 # define inflateCopy z_inflateCopy 102 # define inflateEnd z_inflateEnd 103 # define inflateGetHeader z_inflateGetHeader 104 # define inflateInit2_ z_inflateInit2_ 105 # define inflateInit_ z_inflateInit_ 106 # define inflateMark z_inflateMark 107 # define inflatePrime z_inflatePrime 108 # define inflateReset z_inflateReset 109 # define inflateReset2 z_inflateReset2 110 # define inflateSetDictionary z_inflateSetDictionary 111 # define inflateGetDictionary z_inflateGetDictionary 112 # define inflateSync z_inflateSync 113 # define inflateSyncPoint z_inflateSyncPoint 114 # define inflateUndermine z_inflateUndermine 115 # define inflateResetKeep z_inflateResetKeep 116 # define inflate_copyright z_inflate_copyright 117 # define inflate_fast z_inflate_fast 118 # define inflate_table z_inflate_table 119 # ifndef Z_SOLO 120 # define uncompress z_uncompress 121 # endif 122 # define zError z_zError 123 # ifndef Z_SOLO 124 # define zcalloc z_zcalloc 125 # define zcfree z_zcfree 126 # endif 127 # define zlibCompileFlags z_zlibCompileFlags 128 # define zlibVersion z_zlibVersion 129 130 /* all zlib typedefs in zlib.h and zconf.h */ 131 # define Byte z_Byte 132 # define Bytef z_Bytef 133 # define alloc_func z_alloc_func 134 # define charf z_charf 135 # define free_func z_free_func 136 # ifndef Z_SOLO 137 # define gzFile z_gzFile 138 # endif 139 # define gz_header z_gz_header 140 # define gz_headerp z_gz_headerp 141 # define in_func z_in_func 142 # define intf z_intf 143 # define out_func z_out_func 144 # define uInt z_uInt 145 # define uIntf z_uIntf 146 # define uLong z_uLong 147 # define uLongf z_uLongf 148 # define voidp z_voidp 149 # define voidpc z_voidpc 150 # define voidpf z_voidpf 151 152 /* all zlib structs in zlib.h and zconf.h */ 153 # define gz_header_s z_gz_header_s 154 # define internal_state z_internal_state 155 156 #endif 157 158 # define STDC 159 160 # define z_const const 161 162 /* Maximum value for memLevel in deflateInit2 */ 163 #ifndef MAX_MEM_LEVEL 164 # ifdef MAXSEG_64K 165 # define MAX_MEM_LEVEL 8 166 # else 167 # define MAX_MEM_LEVEL 9 168 # endif 169 #endif 170 171 /* Maximum value for windowBits in deflateInit2 and inflateInit2. 172 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files 173 * created by gzip. (Files created by minigzip can still be extracted by 174 * gzip.) 175 */ 176 #ifndef MAX_WBITS 177 # define MAX_WBITS 15 /* 32K LZ77 window */ 178 #endif 179 180 /* The memory requirements for deflate are (in bytes): 181 (1 << (windowBits+2)) + (1 << (memLevel+9)) 182 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) 183 plus a few kilobytes for small objects. For example, if you want to reduce 184 the default memory requirements from 256K to 128K, compile with 185 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" 186 Of course this will generally degrade compression (there's no free lunch). 187 188 The memory requirements for inflate are (in bytes) 1 << windowBits 189 that is, 32K for windowBits=15 (default value) plus a few kilobytes 190 for small objects. 191 */ 192 193 /* Type declarations */ 194 195 #ifndef OF /* function prototypes */ 196 # ifdef STDC 197 # define OF(args) args 198 # else 199 # define OF(args) () 200 # endif 201 #endif 202 203 #ifndef Z_ARG /* function prototypes for stdarg */ 204 # if defined(STDC) || defined(Z_HAVE_STDARG_H) 205 # define Z_ARG(args) args 206 # else 207 # define Z_ARG(args) () 208 # endif 209 #endif 210 211 #ifndef ZEXTERN 212 # define ZEXTERN extern 213 #endif 214 #ifndef ZEXPORT 215 # define ZEXPORT 216 #endif 217 #ifndef ZEXPORTVA 218 # define ZEXPORTVA 219 #endif 220 221 #ifndef FAR 222 # define FAR 223 #endif 224 225 #if !defined(__MACTYPES__) 226 typedef unsigned char Byte; /* 8 bits */ 227 #endif 228 typedef unsigned int uInt; /* 16 bits or more */ 229 typedef unsigned long uLong; /* 32 bits or more */ 230 231 #ifdef SMALL_MEDIUM 232 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ 233 # define Bytef Byte FAR 234 #else 235 typedef Byte FAR Bytef; 236 #endif 237 typedef char FAR charf; 238 typedef int FAR intf; 239 typedef uInt FAR uIntf; 240 typedef uLong FAR uLongf; 241 242 #ifdef STDC 243 typedef void const *voidpc; 244 typedef void FAR *voidpf; 245 typedef void *voidp; 246 #else 247 typedef Byte const *voidpc; 248 typedef Byte FAR *voidpf; 249 typedef Byte *voidp; 250 #endif 251 252 #include <sys/param.h> 253 #define Z_U4 uint32_t 254 255 #ifdef Z_U4 256 typedef Z_U4 z_crc_t; 257 #else 258 typedef unsigned long z_crc_t; 259 #endif 260 261 # define Z_HAVE_UNISTD_H 262 263 #if !defined(_STANDALONE) && !defined(_KERNEL) 264 # define Z_HAVE_STDARG_H 265 266 # include <stdarg.h> /* for va_list */ 267 #endif 268 269 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and 270 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even 271 * though the former does not conform to the LFS document), but considering 272 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as 273 * equivalently requesting no 64-bit operations 274 */ 275 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 276 # undef _LARGEFILE64_SOURCE 277 #endif 278 279 #if defined(_STANDALONE) || defined(_KERNEL) 280 # include <sys/unistd.h> 281 # define ZLIB_FREESTANDING 282 #else 283 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ 284 #endif 285 286 # ifndef z_off_t 287 # define z_off_t off_t 288 # endif 289 290 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 291 # define Z_LFS64 292 #endif 293 294 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) 295 # define Z_LARGE64 296 #endif 297 298 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) 299 # define Z_WANT64 300 #endif 301 302 #if !defined(SEEK_SET) && !defined(Z_SOLO) 303 # define SEEK_SET 0 /* Seek from beginning of file. */ 304 # define SEEK_CUR 1 /* Seek from current position. */ 305 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ 306 #endif 307 308 #ifndef z_off_t 309 # define z_off_t long 310 #endif 311 312 #if !defined(_WIN32) && defined(Z_LARGE64) 313 # define z_off64_t off64_t 314 #else 315 # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) 316 # define z_off64_t __int64 317 # else 318 # define z_off64_t z_off_t 319 # endif 320 #endif 321 322 /* MVS linker does not support external names larger than 8 bytes */ 323 #if defined(__MVS__) 324 #pragma map(deflateInit_,"DEIN") 325 #pragma map(deflateInit2_,"DEIN2") 326 #pragma map(deflateEnd,"DEEND") 327 #pragma map(deflateBound,"DEBND") 328 #pragma map(inflateInit_,"ININ") 329 #pragma map(inflateInit2_,"ININ2") 330 #pragma map(inflateEnd,"INEND") 331 #pragma map(inflateSync,"INSY") 332 #pragma map(inflateSetDictionary,"INSEDI") 333 #pragma map(compressBound,"CMBND") 334 #pragma map(inflate_table,"INTABL") 335 #pragma map(inflate_fast,"INFA") 336 #pragma map(inflate_copyright,"INCOPY") 337 #endif 338 339 #endif /* ZCONF_H */ 340