security/nss/lib/zlib/zconf.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* zconf.h -- configuration of the zlib compression library
michael@0 2 * Copyright (C) 1995-2010 Jean-loup Gailly.
michael@0 3 * For conditions of distribution and use, see copyright notice in zlib.h
michael@0 4 */
michael@0 5
michael@0 6 /* @(#) $Id$ */
michael@0 7
michael@0 8 #ifndef ZCONF_H
michael@0 9 #define ZCONF_H
michael@0 10
michael@0 11 /*
michael@0 12 * If you *really* need a unique prefix for all types and library functions,
michael@0 13 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
michael@0 14 * Even better than compiling with -DZ_PREFIX would be to use configure to set
michael@0 15 * this permanently in zconf.h using "./configure --zprefix".
michael@0 16 */
michael@0 17 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
michael@0 18
michael@0 19 /* all linked symbols */
michael@0 20 # define _dist_code z__dist_code
michael@0 21 # define _length_code z__length_code
michael@0 22 # define _tr_align z__tr_align
michael@0 23 # define _tr_flush_block z__tr_flush_block
michael@0 24 # define _tr_init z__tr_init
michael@0 25 # define _tr_stored_block z__tr_stored_block
michael@0 26 # define _tr_tally z__tr_tally
michael@0 27 # define adler32 z_adler32
michael@0 28 # define adler32_combine z_adler32_combine
michael@0 29 # define adler32_combine64 z_adler32_combine64
michael@0 30 # define compress z_compress
michael@0 31 # define compress2 z_compress2
michael@0 32 # define compressBound z_compressBound
michael@0 33 # define crc32 z_crc32
michael@0 34 # define crc32_combine z_crc32_combine
michael@0 35 # define crc32_combine64 z_crc32_combine64
michael@0 36 # define deflate z_deflate
michael@0 37 # define deflateBound z_deflateBound
michael@0 38 # define deflateCopy z_deflateCopy
michael@0 39 # define deflateEnd z_deflateEnd
michael@0 40 # define deflateInit2_ z_deflateInit2_
michael@0 41 # define deflateInit_ z_deflateInit_
michael@0 42 # define deflateParams z_deflateParams
michael@0 43 # define deflatePrime z_deflatePrime
michael@0 44 # define deflateReset z_deflateReset
michael@0 45 # define deflateSetDictionary z_deflateSetDictionary
michael@0 46 # define deflateSetHeader z_deflateSetHeader
michael@0 47 # define deflateTune z_deflateTune
michael@0 48 # define deflate_copyright z_deflate_copyright
michael@0 49 # define get_crc_table z_get_crc_table
michael@0 50 # define gz_error z_gz_error
michael@0 51 # define gz_intmax z_gz_intmax
michael@0 52 # define gz_strwinerror z_gz_strwinerror
michael@0 53 # define gzbuffer z_gzbuffer
michael@0 54 # define gzclearerr z_gzclearerr
michael@0 55 # define gzclose z_gzclose
michael@0 56 # define gzclose_r z_gzclose_r
michael@0 57 # define gzclose_w z_gzclose_w
michael@0 58 # define gzdirect z_gzdirect
michael@0 59 # define gzdopen z_gzdopen
michael@0 60 # define gzeof z_gzeof
michael@0 61 # define gzerror z_gzerror
michael@0 62 # define gzflush z_gzflush
michael@0 63 # define gzgetc z_gzgetc
michael@0 64 # define gzgets z_gzgets
michael@0 65 # define gzoffset z_gzoffset
michael@0 66 # define gzoffset64 z_gzoffset64
michael@0 67 # define gzopen z_gzopen
michael@0 68 # define gzopen64 z_gzopen64
michael@0 69 # define gzprintf z_gzprintf
michael@0 70 # define gzputc z_gzputc
michael@0 71 # define gzputs z_gzputs
michael@0 72 # define gzread z_gzread
michael@0 73 # define gzrewind z_gzrewind
michael@0 74 # define gzseek z_gzseek
michael@0 75 # define gzseek64 z_gzseek64
michael@0 76 # define gzsetparams z_gzsetparams
michael@0 77 # define gztell z_gztell
michael@0 78 # define gztell64 z_gztell64
michael@0 79 # define gzungetc z_gzungetc
michael@0 80 # define gzwrite z_gzwrite
michael@0 81 # define inflate z_inflate
michael@0 82 # define inflateBack z_inflateBack
michael@0 83 # define inflateBackEnd z_inflateBackEnd
michael@0 84 # define inflateBackInit_ z_inflateBackInit_
michael@0 85 # define inflateCopy z_inflateCopy
michael@0 86 # define inflateEnd z_inflateEnd
michael@0 87 # define inflateGetHeader z_inflateGetHeader
michael@0 88 # define inflateInit2_ z_inflateInit2_
michael@0 89 # define inflateInit_ z_inflateInit_
michael@0 90 # define inflateMark z_inflateMark
michael@0 91 # define inflatePrime z_inflatePrime
michael@0 92 # define inflateReset z_inflateReset
michael@0 93 # define inflateReset2 z_inflateReset2
michael@0 94 # define inflateSetDictionary z_inflateSetDictionary
michael@0 95 # define inflateSync z_inflateSync
michael@0 96 # define inflateSyncPoint z_inflateSyncPoint
michael@0 97 # define inflateUndermine z_inflateUndermine
michael@0 98 # define inflate_copyright z_inflate_copyright
michael@0 99 # define inflate_fast z_inflate_fast
michael@0 100 # define inflate_table z_inflate_table
michael@0 101 # define uncompress z_uncompress
michael@0 102 # define zError z_zError
michael@0 103 # define zcalloc z_zcalloc
michael@0 104 # define zcfree z_zcfree
michael@0 105 # define zlibCompileFlags z_zlibCompileFlags
michael@0 106 # define zlibVersion z_zlibVersion
michael@0 107
michael@0 108 /* all zlib typedefs in zlib.h and zconf.h */
michael@0 109 # define Byte z_Byte
michael@0 110 # define Bytef z_Bytef
michael@0 111 # define alloc_func z_alloc_func
michael@0 112 # define charf z_charf
michael@0 113 # define free_func z_free_func
michael@0 114 # define gzFile z_gzFile
michael@0 115 # define gz_header z_gz_header
michael@0 116 # define gz_headerp z_gz_headerp
michael@0 117 # define in_func z_in_func
michael@0 118 # define intf z_intf
michael@0 119 # define out_func z_out_func
michael@0 120 # define uInt z_uInt
michael@0 121 # define uIntf z_uIntf
michael@0 122 # define uLong z_uLong
michael@0 123 # define uLongf z_uLongf
michael@0 124 # define voidp z_voidp
michael@0 125 # define voidpc z_voidpc
michael@0 126 # define voidpf z_voidpf
michael@0 127
michael@0 128 /* all zlib structs in zlib.h and zconf.h */
michael@0 129 # define gz_header_s z_gz_header_s
michael@0 130 # define internal_state z_internal_state
michael@0 131
michael@0 132 #endif
michael@0 133
michael@0 134 #if defined(__MSDOS__) && !defined(MSDOS)
michael@0 135 # define MSDOS
michael@0 136 #endif
michael@0 137 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
michael@0 138 # define OS2
michael@0 139 #endif
michael@0 140 #if defined(_WINDOWS) && !defined(WINDOWS)
michael@0 141 # define WINDOWS
michael@0 142 #endif
michael@0 143 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
michael@0 144 # ifndef WIN32
michael@0 145 # define WIN32
michael@0 146 # endif
michael@0 147 #endif
michael@0 148 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
michael@0 149 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
michael@0 150 # ifndef SYS16BIT
michael@0 151 # define SYS16BIT
michael@0 152 # endif
michael@0 153 # endif
michael@0 154 #endif
michael@0 155
michael@0 156 /*
michael@0 157 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
michael@0 158 * than 64k bytes at a time (needed on systems with 16-bit int).
michael@0 159 */
michael@0 160 #ifdef SYS16BIT
michael@0 161 # define MAXSEG_64K
michael@0 162 #endif
michael@0 163 #ifdef MSDOS
michael@0 164 # define UNALIGNED_OK
michael@0 165 #endif
michael@0 166
michael@0 167 #ifdef __STDC_VERSION__
michael@0 168 # ifndef STDC
michael@0 169 # define STDC
michael@0 170 # endif
michael@0 171 # if __STDC_VERSION__ >= 199901L
michael@0 172 # ifndef STDC99
michael@0 173 # define STDC99
michael@0 174 # endif
michael@0 175 # endif
michael@0 176 #endif
michael@0 177 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
michael@0 178 # define STDC
michael@0 179 #endif
michael@0 180 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
michael@0 181 # define STDC
michael@0 182 #endif
michael@0 183 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
michael@0 184 # define STDC
michael@0 185 #endif
michael@0 186 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
michael@0 187 # define STDC
michael@0 188 #endif
michael@0 189
michael@0 190 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
michael@0 191 # define STDC
michael@0 192 #endif
michael@0 193
michael@0 194 #ifndef STDC
michael@0 195 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
michael@0 196 # define const /* note: need a more gentle solution here */
michael@0 197 # endif
michael@0 198 #endif
michael@0 199
michael@0 200 /* Some Mac compilers merge all .h files incorrectly: */
michael@0 201 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
michael@0 202 # define NO_DUMMY_DECL
michael@0 203 #endif
michael@0 204
michael@0 205 /* Maximum value for memLevel in deflateInit2 */
michael@0 206 #ifndef MAX_MEM_LEVEL
michael@0 207 # ifdef MAXSEG_64K
michael@0 208 # define MAX_MEM_LEVEL 8
michael@0 209 # else
michael@0 210 # define MAX_MEM_LEVEL 9
michael@0 211 # endif
michael@0 212 #endif
michael@0 213
michael@0 214 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
michael@0 215 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
michael@0 216 * created by gzip. (Files created by minigzip can still be extracted by
michael@0 217 * gzip.)
michael@0 218 */
michael@0 219 #ifndef MAX_WBITS
michael@0 220 # define MAX_WBITS 15 /* 32K LZ77 window */
michael@0 221 #endif
michael@0 222
michael@0 223 /* The memory requirements for deflate are (in bytes):
michael@0 224 (1 << (windowBits+2)) + (1 << (memLevel+9))
michael@0 225 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
michael@0 226 plus a few kilobytes for small objects. For example, if you want to reduce
michael@0 227 the default memory requirements from 256K to 128K, compile with
michael@0 228 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
michael@0 229 Of course this will generally degrade compression (there's no free lunch).
michael@0 230
michael@0 231 The memory requirements for inflate are (in bytes) 1 << windowBits
michael@0 232 that is, 32K for windowBits=15 (default value) plus a few kilobytes
michael@0 233 for small objects.
michael@0 234 */
michael@0 235
michael@0 236 /* Type declarations */
michael@0 237
michael@0 238 #ifndef OF /* function prototypes */
michael@0 239 # ifdef STDC
michael@0 240 # define OF(args) args
michael@0 241 # else
michael@0 242 # define OF(args) ()
michael@0 243 # endif
michael@0 244 #endif
michael@0 245
michael@0 246 /* The following definitions for FAR are needed only for MSDOS mixed
michael@0 247 * model programming (small or medium model with some far allocations).
michael@0 248 * This was tested only with MSC; for other MSDOS compilers you may have
michael@0 249 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
michael@0 250 * just define FAR to be empty.
michael@0 251 */
michael@0 252 #ifdef SYS16BIT
michael@0 253 # if defined(M_I86SM) || defined(M_I86MM)
michael@0 254 /* MSC small or medium model */
michael@0 255 # define SMALL_MEDIUM
michael@0 256 # ifdef _MSC_VER
michael@0 257 # define FAR _far
michael@0 258 # else
michael@0 259 # define FAR far
michael@0 260 # endif
michael@0 261 # endif
michael@0 262 # if (defined(__SMALL__) || defined(__MEDIUM__))
michael@0 263 /* Turbo C small or medium model */
michael@0 264 # define SMALL_MEDIUM
michael@0 265 # ifdef __BORLANDC__
michael@0 266 # define FAR _far
michael@0 267 # else
michael@0 268 # define FAR far
michael@0 269 # endif
michael@0 270 # endif
michael@0 271 #endif
michael@0 272
michael@0 273 #if defined(WINDOWS) || defined(WIN32)
michael@0 274 /* If building or using zlib as a DLL, define ZLIB_DLL.
michael@0 275 * This is not mandatory, but it offers a little performance increase.
michael@0 276 */
michael@0 277 # ifdef ZLIB_DLL
michael@0 278 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
michael@0 279 # ifdef ZLIB_INTERNAL
michael@0 280 # define ZEXTERN extern __declspec(dllexport)
michael@0 281 # else
michael@0 282 # define ZEXTERN extern __declspec(dllimport)
michael@0 283 # endif
michael@0 284 # endif
michael@0 285 # endif /* ZLIB_DLL */
michael@0 286 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
michael@0 287 * define ZLIB_WINAPI.
michael@0 288 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
michael@0 289 */
michael@0 290 # ifdef ZLIB_WINAPI
michael@0 291 # ifdef FAR
michael@0 292 # undef FAR
michael@0 293 # endif
michael@0 294 # include <windows.h>
michael@0 295 /* No need for _export, use ZLIB.DEF instead. */
michael@0 296 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
michael@0 297 # define ZEXPORT WINAPI
michael@0 298 # ifdef WIN32
michael@0 299 # define ZEXPORTVA WINAPIV
michael@0 300 # else
michael@0 301 # define ZEXPORTVA FAR CDECL
michael@0 302 # endif
michael@0 303 # endif
michael@0 304 #endif
michael@0 305
michael@0 306 #if defined (__BEOS__)
michael@0 307 # ifdef ZLIB_DLL
michael@0 308 # ifdef ZLIB_INTERNAL
michael@0 309 # define ZEXPORT __declspec(dllexport)
michael@0 310 # define ZEXPORTVA __declspec(dllexport)
michael@0 311 # else
michael@0 312 # define ZEXPORT __declspec(dllimport)
michael@0 313 # define ZEXPORTVA __declspec(dllimport)
michael@0 314 # endif
michael@0 315 # endif
michael@0 316 #endif
michael@0 317
michael@0 318 #ifndef ZEXTERN
michael@0 319 # define ZEXTERN extern
michael@0 320 #endif
michael@0 321 #ifndef ZEXPORT
michael@0 322 # define ZEXPORT
michael@0 323 #endif
michael@0 324 #ifndef ZEXPORTVA
michael@0 325 # define ZEXPORTVA
michael@0 326 #endif
michael@0 327
michael@0 328 #ifndef FAR
michael@0 329 # define FAR
michael@0 330 #endif
michael@0 331
michael@0 332 #if !defined(__MACTYPES__)
michael@0 333 typedef unsigned char Byte; /* 8 bits */
michael@0 334 #endif
michael@0 335 typedef unsigned int uInt; /* 16 bits or more */
michael@0 336 typedef unsigned long uLong; /* 32 bits or more */
michael@0 337
michael@0 338 #ifdef SMALL_MEDIUM
michael@0 339 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
michael@0 340 # define Bytef Byte FAR
michael@0 341 #else
michael@0 342 typedef Byte FAR Bytef;
michael@0 343 #endif
michael@0 344 typedef char FAR charf;
michael@0 345 typedef int FAR intf;
michael@0 346 typedef uInt FAR uIntf;
michael@0 347 typedef uLong FAR uLongf;
michael@0 348
michael@0 349 #ifdef STDC
michael@0 350 typedef void const *voidpc;
michael@0 351 typedef void FAR *voidpf;
michael@0 352 typedef void *voidp;
michael@0 353 #else
michael@0 354 typedef Byte const *voidpc;
michael@0 355 typedef Byte FAR *voidpf;
michael@0 356 typedef Byte *voidp;
michael@0 357 #endif
michael@0 358
michael@0 359 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
michael@0 360 # define Z_HAVE_UNISTD_H
michael@0 361 #endif
michael@0 362
michael@0 363 #ifdef STDC
michael@0 364 # include <sys/types.h> /* for off_t */
michael@0 365 #endif
michael@0 366
michael@0 367 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
michael@0 368 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
michael@0 369 * though the former does not conform to the LFS document), but considering
michael@0 370 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
michael@0 371 * equivalently requesting no 64-bit operations
michael@0 372 */
michael@0 373 #if -_LARGEFILE64_SOURCE - -1 == 1
michael@0 374 # undef _LARGEFILE64_SOURCE
michael@0 375 #endif
michael@0 376
michael@0 377 #if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
michael@0 378 # include <unistd.h> /* for SEEK_* and off_t */
michael@0 379 # ifdef VMS
michael@0 380 # include <unixio.h> /* for off_t */
michael@0 381 # endif
michael@0 382 # ifndef z_off_t
michael@0 383 # define z_off_t off_t
michael@0 384 # endif
michael@0 385 #endif
michael@0 386
michael@0 387 #ifndef SEEK_SET
michael@0 388 # define SEEK_SET 0 /* Seek from beginning of file. */
michael@0 389 # define SEEK_CUR 1 /* Seek from current position. */
michael@0 390 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
michael@0 391 #endif
michael@0 392
michael@0 393 #ifndef z_off_t
michael@0 394 # define z_off_t long
michael@0 395 #endif
michael@0 396
michael@0 397 #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
michael@0 398 # define z_off64_t off64_t
michael@0 399 #else
michael@0 400 # define z_off64_t z_off_t
michael@0 401 #endif
michael@0 402
michael@0 403 #if defined(__OS400__)
michael@0 404 # define NO_vsnprintf
michael@0 405 #endif
michael@0 406
michael@0 407 #if defined(__MVS__)
michael@0 408 # define NO_vsnprintf
michael@0 409 #endif
michael@0 410
michael@0 411 /* MVS linker does not support external names larger than 8 bytes */
michael@0 412 #if defined(__MVS__)
michael@0 413 #pragma map(deflateInit_,"DEIN")
michael@0 414 #pragma map(deflateInit2_,"DEIN2")
michael@0 415 #pragma map(deflateEnd,"DEEND")
michael@0 416 #pragma map(deflateBound,"DEBND")
michael@0 417 #pragma map(inflateInit_,"ININ")
michael@0 418 #pragma map(inflateInit2_,"ININ2")
michael@0 419 #pragma map(inflateEnd,"INEND")
michael@0 420 #pragma map(inflateSync,"INSY")
michael@0 421 #pragma map(inflateSetDictionary,"INSEDI")
michael@0 422 #pragma map(compressBound,"CMBND")
michael@0 423 #pragma map(inflate_table,"INTABL")
michael@0 424 #pragma map(inflate_fast,"INFA")
michael@0 425 #pragma map(inflate_copyright,"INCOPY")
michael@0 426 #endif
michael@0 427
michael@0 428 #endif /* ZCONF_H */

mercurial