istereo

annotate libs/zlib/zconf.h @ 26:862a3329a8f0

wohooo, added a shitload of code from zlib/libpng/libjpeg. When the good lord was raining shared libraries the iphone held a fucking umbrella...
author John Tsiombikas <nuclear@mutantstargoat.com>
date Thu, 08 Sep 2011 06:28:38 +0300
parents
children
rev   line source
nuclear@26 1 /* zconf.h -- configuration of the zlib compression library
nuclear@26 2 * Copyright (C) 1995-2005 Jean-loup Gailly.
nuclear@26 3 * For conditions of distribution and use, see copyright notice in zlib.h
nuclear@26 4 */
nuclear@26 5
nuclear@26 6 /* @(#) $Id$ */
nuclear@26 7
nuclear@26 8 #ifndef ZCONF_H
nuclear@26 9 #define ZCONF_H
nuclear@26 10
nuclear@26 11 /*
nuclear@26 12 * If you *really* need a unique prefix for all types and library functions,
nuclear@26 13 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
nuclear@26 14 */
nuclear@26 15 #ifdef Z_PREFIX
nuclear@26 16 # define deflateInit_ z_deflateInit_
nuclear@26 17 # define deflate z_deflate
nuclear@26 18 # define deflateEnd z_deflateEnd
nuclear@26 19 # define inflateInit_ z_inflateInit_
nuclear@26 20 # define inflate z_inflate
nuclear@26 21 # define inflateEnd z_inflateEnd
nuclear@26 22 # define deflateInit2_ z_deflateInit2_
nuclear@26 23 # define deflateSetDictionary z_deflateSetDictionary
nuclear@26 24 # define deflateCopy z_deflateCopy
nuclear@26 25 # define deflateReset z_deflateReset
nuclear@26 26 # define deflateParams z_deflateParams
nuclear@26 27 # define deflateBound z_deflateBound
nuclear@26 28 # define deflatePrime z_deflatePrime
nuclear@26 29 # define inflateInit2_ z_inflateInit2_
nuclear@26 30 # define inflateSetDictionary z_inflateSetDictionary
nuclear@26 31 # define inflateSync z_inflateSync
nuclear@26 32 # define inflateSyncPoint z_inflateSyncPoint
nuclear@26 33 # define inflateCopy z_inflateCopy
nuclear@26 34 # define inflateReset z_inflateReset
nuclear@26 35 # define inflateBack z_inflateBack
nuclear@26 36 # define inflateBackEnd z_inflateBackEnd
nuclear@26 37 # define compress z_compress
nuclear@26 38 # define compress2 z_compress2
nuclear@26 39 # define compressBound z_compressBound
nuclear@26 40 # define uncompress z_uncompress
nuclear@26 41 # define adler32 z_adler32
nuclear@26 42 # define crc32 z_crc32
nuclear@26 43 # define get_crc_table z_get_crc_table
nuclear@26 44 # define zError z_zError
nuclear@26 45
nuclear@26 46 # define alloc_func z_alloc_func
nuclear@26 47 # define free_func z_free_func
nuclear@26 48 # define in_func z_in_func
nuclear@26 49 # define out_func z_out_func
nuclear@26 50 # define Byte z_Byte
nuclear@26 51 # define uInt z_uInt
nuclear@26 52 # define uLong z_uLong
nuclear@26 53 # define Bytef z_Bytef
nuclear@26 54 # define charf z_charf
nuclear@26 55 # define intf z_intf
nuclear@26 56 # define uIntf z_uIntf
nuclear@26 57 # define uLongf z_uLongf
nuclear@26 58 # define voidpf z_voidpf
nuclear@26 59 # define voidp z_voidp
nuclear@26 60 #endif
nuclear@26 61
nuclear@26 62 #if defined(__MSDOS__) && !defined(MSDOS)
nuclear@26 63 # define MSDOS
nuclear@26 64 #endif
nuclear@26 65 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
nuclear@26 66 # define OS2
nuclear@26 67 #endif
nuclear@26 68 #if defined(_WINDOWS) && !defined(WINDOWS)
nuclear@26 69 # define WINDOWS
nuclear@26 70 #endif
nuclear@26 71 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
nuclear@26 72 # ifndef WIN32
nuclear@26 73 # define WIN32
nuclear@26 74 # endif
nuclear@26 75 #endif
nuclear@26 76 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
nuclear@26 77 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
nuclear@26 78 # ifndef SYS16BIT
nuclear@26 79 # define SYS16BIT
nuclear@26 80 # endif
nuclear@26 81 # endif
nuclear@26 82 #endif
nuclear@26 83
nuclear@26 84 /*
nuclear@26 85 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
nuclear@26 86 * than 64k bytes at a time (needed on systems with 16-bit int).
nuclear@26 87 */
nuclear@26 88 #ifdef SYS16BIT
nuclear@26 89 # define MAXSEG_64K
nuclear@26 90 #endif
nuclear@26 91 #ifdef MSDOS
nuclear@26 92 # define UNALIGNED_OK
nuclear@26 93 #endif
nuclear@26 94
nuclear@26 95 #ifdef __STDC_VERSION__
nuclear@26 96 # ifndef STDC
nuclear@26 97 # define STDC
nuclear@26 98 # endif
nuclear@26 99 # if __STDC_VERSION__ >= 199901L
nuclear@26 100 # ifndef STDC99
nuclear@26 101 # define STDC99
nuclear@26 102 # endif
nuclear@26 103 # endif
nuclear@26 104 #endif
nuclear@26 105 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
nuclear@26 106 # define STDC
nuclear@26 107 #endif
nuclear@26 108 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
nuclear@26 109 # define STDC
nuclear@26 110 #endif
nuclear@26 111 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
nuclear@26 112 # define STDC
nuclear@26 113 #endif
nuclear@26 114 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
nuclear@26 115 # define STDC
nuclear@26 116 #endif
nuclear@26 117
nuclear@26 118 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
nuclear@26 119 # define STDC
nuclear@26 120 #endif
nuclear@26 121
nuclear@26 122 #ifndef STDC
nuclear@26 123 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
nuclear@26 124 # define const /* note: need a more gentle solution here */
nuclear@26 125 # endif
nuclear@26 126 #endif
nuclear@26 127
nuclear@26 128 /* Some Mac compilers merge all .h files incorrectly: */
nuclear@26 129 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
nuclear@26 130 # define NO_DUMMY_DECL
nuclear@26 131 #endif
nuclear@26 132
nuclear@26 133 /* Maximum value for memLevel in deflateInit2 */
nuclear@26 134 #ifndef MAX_MEM_LEVEL
nuclear@26 135 # ifdef MAXSEG_64K
nuclear@26 136 # define MAX_MEM_LEVEL 8
nuclear@26 137 # else
nuclear@26 138 # define MAX_MEM_LEVEL 9
nuclear@26 139 # endif
nuclear@26 140 #endif
nuclear@26 141
nuclear@26 142 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
nuclear@26 143 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
nuclear@26 144 * created by gzip. (Files created by minigzip can still be extracted by
nuclear@26 145 * gzip.)
nuclear@26 146 */
nuclear@26 147 #ifndef MAX_WBITS
nuclear@26 148 # define MAX_WBITS 15 /* 32K LZ77 window */
nuclear@26 149 #endif
nuclear@26 150
nuclear@26 151 /* The memory requirements for deflate are (in bytes):
nuclear@26 152 (1 << (windowBits+2)) + (1 << (memLevel+9))
nuclear@26 153 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
nuclear@26 154 plus a few kilobytes for small objects. For example, if you want to reduce
nuclear@26 155 the default memory requirements from 256K to 128K, compile with
nuclear@26 156 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
nuclear@26 157 Of course this will generally degrade compression (there's no free lunch).
nuclear@26 158
nuclear@26 159 The memory requirements for inflate are (in bytes) 1 << windowBits
nuclear@26 160 that is, 32K for windowBits=15 (default value) plus a few kilobytes
nuclear@26 161 for small objects.
nuclear@26 162 */
nuclear@26 163
nuclear@26 164 /* Type declarations */
nuclear@26 165
nuclear@26 166 #ifndef OF /* function prototypes */
nuclear@26 167 # ifdef STDC
nuclear@26 168 # define OF(args) args
nuclear@26 169 # else
nuclear@26 170 # define OF(args) ()
nuclear@26 171 # endif
nuclear@26 172 #endif
nuclear@26 173
nuclear@26 174 /* The following definitions for FAR are needed only for MSDOS mixed
nuclear@26 175 * model programming (small or medium model with some far allocations).
nuclear@26 176 * This was tested only with MSC; for other MSDOS compilers you may have
nuclear@26 177 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
nuclear@26 178 * just define FAR to be empty.
nuclear@26 179 */
nuclear@26 180 #ifdef SYS16BIT
nuclear@26 181 # if defined(M_I86SM) || defined(M_I86MM)
nuclear@26 182 /* MSC small or medium model */
nuclear@26 183 # define SMALL_MEDIUM
nuclear@26 184 # ifdef _MSC_VER
nuclear@26 185 # define FAR _far
nuclear@26 186 # else
nuclear@26 187 # define FAR far
nuclear@26 188 # endif
nuclear@26 189 # endif
nuclear@26 190 # if (defined(__SMALL__) || defined(__MEDIUM__))
nuclear@26 191 /* Turbo C small or medium model */
nuclear@26 192 # define SMALL_MEDIUM
nuclear@26 193 # ifdef __BORLANDC__
nuclear@26 194 # define FAR _far
nuclear@26 195 # else
nuclear@26 196 # define FAR far
nuclear@26 197 # endif
nuclear@26 198 # endif
nuclear@26 199 #endif
nuclear@26 200
nuclear@26 201 #if defined(WINDOWS) || defined(WIN32)
nuclear@26 202 /* If building or using zlib as a DLL, define ZLIB_DLL.
nuclear@26 203 * This is not mandatory, but it offers a little performance increase.
nuclear@26 204 */
nuclear@26 205 # ifdef ZLIB_DLL
nuclear@26 206 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
nuclear@26 207 # ifdef ZLIB_INTERNAL
nuclear@26 208 # define ZEXTERN extern __declspec(dllexport)
nuclear@26 209 # else
nuclear@26 210 # define ZEXTERN extern __declspec(dllimport)
nuclear@26 211 # endif
nuclear@26 212 # endif
nuclear@26 213 # endif /* ZLIB_DLL */
nuclear@26 214 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
nuclear@26 215 * define ZLIB_WINAPI.
nuclear@26 216 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
nuclear@26 217 */
nuclear@26 218 # ifdef ZLIB_WINAPI
nuclear@26 219 # ifdef FAR
nuclear@26 220 # undef FAR
nuclear@26 221 # endif
nuclear@26 222 # include <windows.h>
nuclear@26 223 /* No need for _export, use ZLIB.DEF instead. */
nuclear@26 224 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
nuclear@26 225 # define ZEXPORT WINAPI
nuclear@26 226 # ifdef WIN32
nuclear@26 227 # define ZEXPORTVA WINAPIV
nuclear@26 228 # else
nuclear@26 229 # define ZEXPORTVA FAR CDECL
nuclear@26 230 # endif
nuclear@26 231 # endif
nuclear@26 232 #endif
nuclear@26 233
nuclear@26 234 #if defined (__BEOS__)
nuclear@26 235 # ifdef ZLIB_DLL
nuclear@26 236 # ifdef ZLIB_INTERNAL
nuclear@26 237 # define ZEXPORT __declspec(dllexport)
nuclear@26 238 # define ZEXPORTVA __declspec(dllexport)
nuclear@26 239 # else
nuclear@26 240 # define ZEXPORT __declspec(dllimport)
nuclear@26 241 # define ZEXPORTVA __declspec(dllimport)
nuclear@26 242 # endif
nuclear@26 243 # endif
nuclear@26 244 #endif
nuclear@26 245
nuclear@26 246 #ifndef ZEXTERN
nuclear@26 247 # define ZEXTERN extern
nuclear@26 248 #endif
nuclear@26 249 #ifndef ZEXPORT
nuclear@26 250 # define ZEXPORT
nuclear@26 251 #endif
nuclear@26 252 #ifndef ZEXPORTVA
nuclear@26 253 # define ZEXPORTVA
nuclear@26 254 #endif
nuclear@26 255
nuclear@26 256 #ifndef FAR
nuclear@26 257 # define FAR
nuclear@26 258 #endif
nuclear@26 259
nuclear@26 260 #if !defined(__MACTYPES__)
nuclear@26 261 typedef unsigned char Byte; /* 8 bits */
nuclear@26 262 #endif
nuclear@26 263 typedef unsigned int uInt; /* 16 bits or more */
nuclear@26 264 typedef unsigned long uLong; /* 32 bits or more */
nuclear@26 265
nuclear@26 266 #ifdef SMALL_MEDIUM
nuclear@26 267 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
nuclear@26 268 # define Bytef Byte FAR
nuclear@26 269 #else
nuclear@26 270 typedef Byte FAR Bytef;
nuclear@26 271 #endif
nuclear@26 272 typedef char FAR charf;
nuclear@26 273 typedef int FAR intf;
nuclear@26 274 typedef uInt FAR uIntf;
nuclear@26 275 typedef uLong FAR uLongf;
nuclear@26 276
nuclear@26 277 #ifdef STDC
nuclear@26 278 typedef void const *voidpc;
nuclear@26 279 typedef void FAR *voidpf;
nuclear@26 280 typedef void *voidp;
nuclear@26 281 #else
nuclear@26 282 typedef Byte const *voidpc;
nuclear@26 283 typedef Byte FAR *voidpf;
nuclear@26 284 typedef Byte *voidp;
nuclear@26 285 #endif
nuclear@26 286
nuclear@26 287 #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
nuclear@26 288 # include <sys/types.h> /* for off_t */
nuclear@26 289 # include <unistd.h> /* for SEEK_* and off_t */
nuclear@26 290 # ifdef VMS
nuclear@26 291 # include <unixio.h> /* for off_t */
nuclear@26 292 # endif
nuclear@26 293 # define z_off_t off_t
nuclear@26 294 #endif
nuclear@26 295 #ifndef SEEK_SET
nuclear@26 296 # define SEEK_SET 0 /* Seek from beginning of file. */
nuclear@26 297 # define SEEK_CUR 1 /* Seek from current position. */
nuclear@26 298 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
nuclear@26 299 #endif
nuclear@26 300 #ifndef z_off_t
nuclear@26 301 # define z_off_t long
nuclear@26 302 #endif
nuclear@26 303
nuclear@26 304 #if defined(__OS400__)
nuclear@26 305 # define NO_vsnprintf
nuclear@26 306 #endif
nuclear@26 307
nuclear@26 308 #if defined(__MVS__)
nuclear@26 309 # define NO_vsnprintf
nuclear@26 310 # ifdef FAR
nuclear@26 311 # undef FAR
nuclear@26 312 # endif
nuclear@26 313 #endif
nuclear@26 314
nuclear@26 315 /* MVS linker does not support external names larger than 8 bytes */
nuclear@26 316 #if defined(__MVS__)
nuclear@26 317 # pragma map(deflateInit_,"DEIN")
nuclear@26 318 # pragma map(deflateInit2_,"DEIN2")
nuclear@26 319 # pragma map(deflateEnd,"DEEND")
nuclear@26 320 # pragma map(deflateBound,"DEBND")
nuclear@26 321 # pragma map(inflateInit_,"ININ")
nuclear@26 322 # pragma map(inflateInit2_,"ININ2")
nuclear@26 323 # pragma map(inflateEnd,"INEND")
nuclear@26 324 # pragma map(inflateSync,"INSY")
nuclear@26 325 # pragma map(inflateSetDictionary,"INSEDI")
nuclear@26 326 # pragma map(compressBound,"CMBND")
nuclear@26 327 # pragma map(inflate_table,"INTABL")
nuclear@26 328 # pragma map(inflate_fast,"INFA")
nuclear@26 329 # pragma map(inflate_copyright,"INCOPY")
nuclear@26 330 #endif
nuclear@26 331
nuclear@26 332 #endif /* ZCONF_H */