zconf.h.in 14.0 KB
Newer Older
M
Mark Adler 已提交
1
/* zconf.h -- configuration of the zlib compression library
M
Mark Adler 已提交
2
 * Copyright (C) 1995-2011 Jean-loup Gailly.
M
Mark Adler 已提交
3
 * For conditions of distribution and use, see copyright notice in zlib.h
M
Mark Adler 已提交
4 5
 */

M
Mark Adler 已提交
6
/* @(#) $Id$ */
M
Mark Adler 已提交
7

M
Mark Adler 已提交
8 9
#ifndef ZCONF_H
#define ZCONF_H
M
Mark Adler 已提交
10 11

/*
M
Mark Adler 已提交
12 13
 * If you *really* need a unique prefix for all types and library functions,
 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
M
Mark Adler 已提交
14 15
 * Even better than compiling with -DZ_PREFIX would be to use configure to set
 * this permanently in zconf.h using "./configure --zprefix".
M
Mark Adler 已提交
16
 */
M
Mark Adler 已提交
17
#ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
M
Mark Adler 已提交
18
#  define Z_PREFIX_SET
M
Mark Adler 已提交
19 20 21 22 23 24 25 26 27 28 29

/* all linked symbols */
#  define _dist_code            z__dist_code
#  define _length_code          z__length_code
#  define _tr_align             z__tr_align
#  define _tr_flush_block       z__tr_flush_block
#  define _tr_init              z__tr_init
#  define _tr_stored_block      z__tr_stored_block
#  define _tr_tally             z__tr_tally
#  define adler32               z_adler32
#  define adler32_combine       z_adler32_combine
M
Mark Adler 已提交
30
#  define adler32_combine64     z_adler32_combine64
31 32 33 34 35
#  ifndef Z_SOLO
#    define compress              z_compress
#    define compress2             z_compress2
#    define compressBound         z_compressBound
#  endif
M
Mark Adler 已提交
36 37
#  define crc32                 z_crc32
#  define crc32_combine         z_crc32_combine
M
Mark Adler 已提交
38
#  define crc32_combine64       z_crc32_combine64
M
Mark Adler 已提交
39
#  define deflate               z_deflate
M
Mark Adler 已提交
40 41
#  define deflateBound          z_deflateBound
#  define deflateCopy           z_deflateCopy
M
Mark Adler 已提交
42 43
#  define deflateEnd            z_deflateEnd
#  define deflateInit2_         z_deflateInit2_
M
Mark Adler 已提交
44
#  define deflateInit_          z_deflateInit_
M
Mark Adler 已提交
45
#  define deflateParams         z_deflateParams
M
Mark Adler 已提交
46
#  define deflatePending        z_deflatePending
M
Mark Adler 已提交
47
#  define deflatePrime          z_deflatePrime
M
Mark Adler 已提交
48 49 50 51 52 53
#  define deflateReset          z_deflateReset
#  define deflateSetDictionary  z_deflateSetDictionary
#  define deflateSetHeader      z_deflateSetHeader
#  define deflateTune           z_deflateTune
#  define deflate_copyright     z_deflate_copyright
#  define get_crc_table         z_get_crc_table
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
#  ifndef Z_SOLO
#    define gz_error              z_gz_error
#    define gz_intmax             z_gz_intmax
#    define gz_strwinerror        z_gz_strwinerror
#    define gzbuffer              z_gzbuffer
#    define gzclearerr            z_gzclearerr
#    define gzclose               z_gzclose
#    define gzclose_r             z_gzclose_r
#    define gzclose_w             z_gzclose_w
#    define gzdirect              z_gzdirect
#    define gzdopen               z_gzdopen
#    define gzeof                 z_gzeof
#    define gzerror               z_gzerror
#    define gzflags               z_gzflags
#    define gzflush               z_gzflush
#    define gzgetc                z_gzgetc
#    define gzgetc_               z_gzgetc_
#    define gzgets                z_gzgets
#    define gzoffset              z_gzoffset
#    define gzoffset64            z_gzoffset64
#    define gzopen                z_gzopen
#    define gzopen64              z_gzopen64
#    define gzprintf              z_gzprintf
#    define gzputc                z_gzputc
#    define gzputs                z_gzputs
#    define gzread                z_gzread
#    define gzrewind              z_gzrewind
#    define gzseek                z_gzseek
#    define gzseek64              z_gzseek64
#    define gzsetparams           z_gzsetparams
#    define gztell                z_gztell
#    define gztell64              z_gztell64
#    define gzungetc              z_gzungetc
#    define gzwrite               z_gzwrite
#  endif
M
Mark Adler 已提交
89 90 91 92 93 94 95
#  define inflate               z_inflate
#  define inflateBack           z_inflateBack
#  define inflateBackEnd        z_inflateBackEnd
#  define inflateBackInit_      z_inflateBackInit_
#  define inflateCopy           z_inflateCopy
#  define inflateEnd            z_inflateEnd
#  define inflateGetHeader      z_inflateGetHeader
M
Mark Adler 已提交
96
#  define inflateInit2_         z_inflateInit2_
M
Mark Adler 已提交
97
#  define inflateInit_          z_inflateInit_
M
Mark Adler 已提交
98
#  define inflateMark           z_inflateMark
M
Mark Adler 已提交
99 100
#  define inflatePrime          z_inflatePrime
#  define inflateReset          z_inflateReset
M
Mark Adler 已提交
101
#  define inflateReset2         z_inflateReset2
M
Mark Adler 已提交
102 103 104
#  define inflateSetDictionary  z_inflateSetDictionary
#  define inflateSync           z_inflateSync
#  define inflateSyncPoint      z_inflateSyncPoint
M
Mark Adler 已提交
105
#  define inflateUndermine      z_inflateUndermine
106
#  define inflateResetKeep      z_inflateResetKeep
M
Mark Adler 已提交
107 108 109
#  define inflate_copyright     z_inflate_copyright
#  define inflate_fast          z_inflate_fast
#  define inflate_table         z_inflate_table
110 111 112
#  ifndef Z_SOLO
#    define uncompress            z_uncompress
#  endif
M
Mark Adler 已提交
113
#  define zError                z_zError
114 115 116 117
#  ifndef Z_SOLO
#    define zcalloc               z_zcalloc
#    define zcfree                z_zcfree
#  endif
M
Mark Adler 已提交
118 119
#  define zlibCompileFlags      z_zlibCompileFlags
#  define zlibVersion           z_zlibVersion
M
Mark Adler 已提交
120

M
Mark Adler 已提交
121 122 123
/* all zlib typedefs in zlib.h and zconf.h */
#  define Byte                  z_Byte
#  define Bytef                 z_Bytef
M
Mark Adler 已提交
124
#  define alloc_func            z_alloc_func
M
Mark Adler 已提交
125
#  define charf                 z_charf
M
Mark Adler 已提交
126
#  define free_func             z_free_func
127 128 129 130 131
#  ifndef Z_SOLO
#    define gzFile                z_gzFile
#    define gz_header             z_gz_header
#    define gz_headerp            z_gz_headerp
#  endif
M
Mark Adler 已提交
132
#  define in_func               z_in_func
M
Mark Adler 已提交
133
#  define intf                  z_intf
M
Mark Adler 已提交
134
#  define out_func              z_out_func
M
Mark Adler 已提交
135 136
#  define uInt                  z_uInt
#  define uIntf                 z_uIntf
M
Mark Adler 已提交
137
#  define uLong                 z_uLong
M
Mark Adler 已提交
138 139
#  define uLongf                z_uLongf
#  define voidp                 z_voidp
M
Mark Adler 已提交
140 141 142 143
#  define voidpc                z_voidpc
#  define voidpf                z_voidpf

/* all zlib structs in zlib.h and zconf.h */
144 145 146
#  ifndef Z_SOLO
#    define gz_header_s           z_gz_header_s
#  endif
M
Mark Adler 已提交
147 148
#  define internal_state        z_internal_state

M
Mark Adler 已提交
149
#endif
M
Mark Adler 已提交
150

M
Mark Adler 已提交
151 152 153 154 155 156 157 158 159
#if defined(__MSDOS__) && !defined(MSDOS)
#  define MSDOS
#endif
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
#  define OS2
#endif
#if defined(_WINDOWS) && !defined(WINDOWS)
#  define WINDOWS
#endif
M
Mark Adler 已提交
160 161 162 163
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
#  ifndef WIN32
#    define WIN32
#  endif
M
Mark Adler 已提交
164
#endif
M
Mark Adler 已提交
165 166 167 168 169
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
#    ifndef SYS16BIT
#      define SYS16BIT
#    endif
M
Mark Adler 已提交
170
#  endif
M
Mark Adler 已提交
171
#endif
M
Mark Adler 已提交
172 173 174 175 176

/*
 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
 * than 64k bytes at a time (needed on systems with 16-bit int).
 */
M
Mark Adler 已提交
177
#ifdef SYS16BIT
M
Mark Adler 已提交
178 179
#  define MAXSEG_64K
#endif
M
Mark Adler 已提交
180 181 182 183
#ifdef MSDOS
#  define UNALIGNED_OK
#endif

M
Mark Adler 已提交
184
#ifdef __STDC_VERSION__
M
Mark Adler 已提交
185 186 187
#  ifndef STDC
#    define STDC
#  endif
M
Mark Adler 已提交
188 189 190 191
#  if __STDC_VERSION__ >= 199901L
#    ifndef STDC99
#      define STDC99
#    endif
M
Mark Adler 已提交
192 193
#  endif
#endif
M
Mark Adler 已提交
194 195 196 197 198 199 200 201 202 203 204 205
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
#  define STDC
#endif
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
#  define STDC
#endif
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
#  define STDC
#endif
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
#  define STDC
#endif
M
Mark Adler 已提交
206

M
Mark Adler 已提交
207 208 209 210
#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
#  define STDC
#endif

M
Mark Adler 已提交
211 212
#ifndef STDC
#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
M
Mark Adler 已提交
213
#    define const       /* note: need a more gentle solution here */
M
Mark Adler 已提交
214
#  endif
M
Mark Adler 已提交
215 216
#endif

217 218 219 220 221 222
#if defined(ZLIB_CONST) && !defined(z_const)
#  define z_const const
#else
#  define z_const
#endif

M
Mark Adler 已提交
223
/* Some Mac compilers merge all .h files incorrectly: */
M
Mark Adler 已提交
224
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
M
Mark Adler 已提交
225
#  define NO_DUMMY_DECL
M
Mark Adler 已提交
226
#endif
M
Mark Adler 已提交
227

M
Mark Adler 已提交
228
/* Maximum value for memLevel in deflateInit2 */
M
Mark Adler 已提交
229 230 231 232 233 234 235 236
#ifndef MAX_MEM_LEVEL
#  ifdef MAXSEG_64K
#    define MAX_MEM_LEVEL 8
#  else
#    define MAX_MEM_LEVEL 9
#  endif
#endif

M
Mark Adler 已提交
237 238 239 240 241
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
 * created by gzip. (Files created by minigzip can still be extracted by
 * gzip.)
 */
M
Mark Adler 已提交
242 243
#ifndef MAX_WBITS
#  define MAX_WBITS   15 /* 32K LZ77 window */
M
Mark Adler 已提交
244 245
#endif

M
Mark Adler 已提交
246
/* The memory requirements for deflate are (in bytes):
M
Mark Adler 已提交
247
            (1 << (windowBits+2)) +  (1 << (memLevel+9))
M
Mark Adler 已提交
248 249 250 251 252 253 254 255 256 257 258
 that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
 plus a few kilobytes for small objects. For example, if you want to reduce
 the default memory requirements from 256K to 128K, compile with
     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
 Of course this will generally degrade compression (there's no free lunch).

   The memory requirements for inflate are (in bytes) 1 << windowBits
 that is, 32K for windowBits=15 (default value) plus a few kilobytes
 for small objects.
*/

M
Mark Adler 已提交
259
                        /* Type declarations */
M
Mark Adler 已提交
260

M
Mark Adler 已提交
261
#ifndef OF /* function prototypes */
M
Mark Adler 已提交
262
#  ifdef STDC
M
Mark Adler 已提交
263
#    define OF(args)  args
M
Mark Adler 已提交
264
#  else
M
Mark Adler 已提交
265
#    define OF(args)  ()
M
Mark Adler 已提交
266 267 268
#  endif
#endif

M
Mark Adler 已提交
269 270 271 272 273 274 275 276
#ifndef ON /* function prototypes for stdarg */
#  if defined(STDC) || defined(Z_HAVE_STDARG_H)
#    define ON(args)  args
#  else
#    define ON(args)  ()
#  endif
#endif

M
Mark Adler 已提交
277 278 279 280 281 282
/* The following definitions for FAR are needed only for MSDOS mixed
 * model programming (small or medium model with some far allocations).
 * This was tested only with MSC; for other MSDOS compilers you may have
 * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
 * just define FAR to be empty.
 */
M
Mark Adler 已提交
283 284 285 286 287 288 289 290 291
#ifdef SYS16BIT
#  if defined(M_I86SM) || defined(M_I86MM)
     /* MSC small or medium model */
#    define SMALL_MEDIUM
#    ifdef _MSC_VER
#      define FAR _far
#    else
#      define FAR far
#    endif
M
Mark Adler 已提交
292
#  endif
M
Mark Adler 已提交
293 294
#  if (defined(__SMALL__) || defined(__MEDIUM__))
     /* Turbo C small or medium model */
M
Mark Adler 已提交
295
#    define SMALL_MEDIUM
M
Mark Adler 已提交
296 297 298 299 300
#    ifdef __BORLANDC__
#      define FAR _far
#    else
#      define FAR far
#    endif
M
Mark Adler 已提交
301
#  endif
M
Mark Adler 已提交
302
#endif
M
Mark Adler 已提交
303

M
Mark Adler 已提交
304 305 306
#if defined(WINDOWS) || defined(WIN32)
   /* If building or using zlib as a DLL, define ZLIB_DLL.
    * This is not mandatory, but it offers a little performance increase.
M
Mark Adler 已提交
307
    */
M
Mark Adler 已提交
308 309
#  ifdef ZLIB_DLL
#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
M
Mark Adler 已提交
310 311 312 313
#      ifdef ZLIB_INTERNAL
#        define ZEXTERN extern __declspec(dllexport)
#      else
#        define ZEXTERN extern __declspec(dllimport)
M
Mark Adler 已提交
314
#      endif
M
Mark Adler 已提交
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
#    endif
#  endif  /* ZLIB_DLL */
   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
    * define ZLIB_WINAPI.
    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
    */
#  ifdef ZLIB_WINAPI
#    ifdef FAR
#      undef FAR
#    endif
#    include <windows.h>
     /* No need for _export, use ZLIB.DEF instead. */
     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
#    define ZEXPORT WINAPI
#    ifdef WIN32
#      define ZEXPORTVA WINAPIV
M
Mark Adler 已提交
331
#    else
M
Mark Adler 已提交
332
#      define ZEXPORTVA FAR CDECL
M
Mark Adler 已提交
333 334 335 336 337
#    endif
#  endif
#endif

#if defined (__BEOS__)
M
Mark Adler 已提交
338 339 340 341 342 343 344 345
#  ifdef ZLIB_DLL
#    ifdef ZLIB_INTERNAL
#      define ZEXPORT   __declspec(dllexport)
#      define ZEXPORTVA __declspec(dllexport)
#    else
#      define ZEXPORT   __declspec(dllimport)
#      define ZEXPORTVA __declspec(dllimport)
#    endif
M
Mark Adler 已提交
346
#  endif
M
Mark Adler 已提交
347 348
#endif

M
Mark Adler 已提交
349 350 351
#ifndef ZEXTERN
#  define ZEXTERN extern
#endif
M
Mark Adler 已提交
352 353 354 355 356 357
#ifndef ZEXPORT
#  define ZEXPORT
#endif
#ifndef ZEXPORTVA
#  define ZEXPORTVA
#endif
M
Mark Adler 已提交
358

M
Mark Adler 已提交
359
#ifndef FAR
M
Mark Adler 已提交
360
#  define FAR
M
Mark Adler 已提交
361
#endif
M
Mark Adler 已提交
362

M
Mark Adler 已提交
363
#if !defined(__MACTYPES__)
M
Mark Adler 已提交
364
typedef unsigned char  Byte;  /* 8 bits */
M
Mark Adler 已提交
365
#endif
M
Mark Adler 已提交
366 367 368
typedef unsigned int   uInt;  /* 16 bits or more */
typedef unsigned long  uLong; /* 32 bits or more */

M
Mark Adler 已提交
369 370
#ifdef SMALL_MEDIUM
   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
M
Mark Adler 已提交
371 372 373 374
#  define Bytef Byte FAR
#else
   typedef Byte  FAR Bytef;
#endif
M
Mark Adler 已提交
375 376 377
typedef char  FAR charf;
typedef int   FAR intf;
typedef uInt  FAR uIntf;
M
Mark Adler 已提交
378 379 380
typedef uLong FAR uLongf;

#ifdef STDC
M
Mark Adler 已提交
381
   typedef void const *voidpc;
M
Mark Adler 已提交
382 383
   typedef void FAR   *voidpf;
   typedef void       *voidp;
M
Mark Adler 已提交
384
#else
M
Mark Adler 已提交
385
   typedef Byte const *voidpc;
M
Mark Adler 已提交
386 387
   typedef Byte FAR   *voidpf;
   typedef Byte       *voidp;
M
Mark Adler 已提交
388 389
#endif

M
Mark Adler 已提交
390
#ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
M
Mark Adler 已提交
391 392 393
#  define Z_HAVE_UNISTD_H
#endif

M
Mark Adler 已提交
394 395 396 397
#ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */
#  define Z_HAVE_STDARG_H
#endif

M
Mark Adler 已提交
398
#ifdef STDC
399 400 401
#  ifndef Z_SOLO
#    include <sys/types.h>      /* for off_t */
#  endif
M
Mark Adler 已提交
402 403
#endif

M
Mark Adler 已提交
404 405 406 407 408 409 410 411 412 413
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
 * though the former does not conform to the LFS document), but considering
 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
 * equivalently requesting no 64-bit operations
 */
#if -_LARGEFILE64_SOURCE - -1 == 1
#  undef _LARGEFILE64_SOURCE
#endif

M
Mark Adler 已提交
414 415 416 417
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
#  define Z_LARGE
#endif

418
#if (defined(Z_HAVE_UNISTD_H) || defined(Z_LARGE)) && !defined(Z_SOLO)
M
Mark Adler 已提交
419 420 421 422 423 424 425 426
#  include <unistd.h>       /* for SEEK_* and off_t */
#  ifdef VMS
#    include <unixio.h>     /* for off_t */
#  endif
#  ifndef z_off_t
#    define z_off_t off_t
#  endif
#endif
M
Mark Adler 已提交
427

428
#if !defined(SEEK_SET) && !defined(Z_SOLO)
M
Mark Adler 已提交
429 430
#  define SEEK_SET        0       /* Seek from beginning of file.  */
#  define SEEK_CUR        1       /* Seek from current position.  */
M
Mark Adler 已提交
431
#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
M
Mark Adler 已提交
432
#endif
M
Mark Adler 已提交
433

M
Mark Adler 已提交
434
#ifndef z_off_t
M
Mark Adler 已提交
435
#  define z_off_t long
M
Mark Adler 已提交
436
#endif
M
Mark Adler 已提交
437

438
#if !defined(_WIN32) && (defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0)
M
Mark Adler 已提交
439 440
#  define z_off64_t off64_t
#else
441 442 443
#  if defined(_WIN32)
#    define z_off64_t __int64
#  else
M
Mark Adler 已提交
444 445
#  define z_off64_t z_off_t
#endif
446
#endif
M
Mark Adler 已提交
447

M
Mark Adler 已提交
448 449
/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
M
Mark Adler 已提交
450 451 452 453 454 455 456 457 458 459 460 461 462
  #pragma map(deflateInit_,"DEIN")
  #pragma map(deflateInit2_,"DEIN2")
  #pragma map(deflateEnd,"DEEND")
  #pragma map(deflateBound,"DEBND")
  #pragma map(inflateInit_,"ININ")
  #pragma map(inflateInit2_,"ININ2")
  #pragma map(inflateEnd,"INEND")
  #pragma map(inflateSync,"INSY")
  #pragma map(inflateSetDictionary,"INSEDI")
  #pragma map(compressBound,"CMBND")
  #pragma map(inflate_table,"INTABL")
  #pragma map(inflate_fast,"INFA")
  #pragma map(inflate_copyright,"INCOPY")
M
Mark Adler 已提交
463 464
#endif

M
Mark Adler 已提交
465
#endif /* ZCONF_H */