1 /* zconf.h -- configuration of the zlib compression library
2  * Copyright (C) 1995-2012 Jean-loup Gailly.
3  * For conditions of distribution and use, see copyright notice in zlib.h
4  */
5 
6 /* @(#) $Id$ */
7 
8 #ifndef ZCONF_H
9 #define ZCONF_H
10 
11 //#define NN_ZLIB_HAS_FIO
12 
13 /*
14  * If you *really* need a unique prefix for all types and library functions,
15  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
16  * Even better than compiling with -DZ_PREFIX would be to use configure to set
17  * this permanently in zconf.h using "./configure --zprefix".
18  */
19 #ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
20 #  define Z_PREFIX_SET
21 
22 /* all linked symbols */
23 #  define _dist_code            nncxZlib__dist_code
24 #  define _length_code          nncxZlib__length_code
25 #  define _tr_align             nncxZlib__tr_align
26 #  define _tr_flush_block       nncxZlib__tr_flush_block
27 #  define _tr_init              nncxZlib__tr_init
28 #  define _tr_stored_block      nncxZlib__tr_stored_block
29 #  define _tr_tally             nncxZlib__tr_tally
30 #  define adler32               nncxZlib_adler32
31 #  define adler32_combine       nncxZlib_adler32_combine
32 #  define adler32_combine64     nncxZlib_adler32_combine64
33 #  ifndef Z_SOLO
34 #    define compress              nncxZlib_compress
35 #    define compress2             nncxZlib_compress2
36 #    define compressBound         nncxZlib_compressBound
37 #  endif
38 #  define crc32                 nncxZlib_crc32
39 #  define crc32_combine         nncxZlib_crc32_combine
40 #  define crc32_combine64       nncxZlib_crc32_combine64
41 #  define deflate               nncxZlib_deflate
42 #  define deflateBound          nncxZlib_deflateBound
43 #  define deflateCopy           nncxZlib_deflateCopy
44 #  define deflateEnd            nncxZlib_deflateEnd
45 #  define deflateInit2_         nncxZlib_deflateInit2_
46 #  define deflateInit_          nncxZlib_deflateInit_
47 #  define deflateParams         nncxZlib_deflateParams
48 #  define deflatePending        nncxZlib_deflatePending
49 #  define deflatePrime          nncxZlib_deflatePrime
50 #  define deflateReset          nncxZlib_deflateReset
51 #  define deflateResetKeep      nncxZlib_deflateResetKeep
52 #  define deflateSetDictionary  nncxZlib_deflateSetDictionary
53 #  define deflateSetHeader      nncxZlib_deflateSetHeader
54 #  define deflateTune           nncxZlib_deflateTune
55 #  define deflate_copyright     nncxZlib_deflate_copyright
56 #  define get_crc_table         nncxZlib_get_crc_table
57 #  ifndef Z_SOLO
58 #    define gz_error              nncxZlib_gz_error
59 #    define gz_intmax             nncxZlib_gz_intmax
60 #    define gz_strwinerror        nncxZlib_gz_strwinerror
61 #    define gzbuffer              nncxZlib_gzbuffer
62 #    define gzclearerr            nncxZlib_gzclearerr
63 #    define gzclose               nncxZlib_gzclose
64 #    define gzclose_r             nncxZlib_gzclose_r
65 #    define gzclose_w             nncxZlib_gzclose_w
66 #    define gzdirect              nncxZlib_gzdirect
67 #    define gzdopen               nncxZlib_gzdopen
68 #    define gzeof                 nncxZlib_gzeof
69 #    define gzerror               nncxZlib_gzerror
70 #    define gzflush               nncxZlib_gzflush
71 #    define gzgetc                nncxZlib_gzgetc
72 #    define gzgetc_               nncxZlib_gzgetc_
73 #    define gzgets                nncxZlib_gzgets
74 #    define gzoffset              nncxZlib_gzoffset
75 #    define gzoffset64            nncxZlib_gzoffset64
76 #    define gzopen                nncxZlib_gzopen
77 #    define gzopen64              nncxZlib_gzopen64
78 #    ifdef _WIN32
79 #      define gzopen_w              nncxZlib_gzopen_w
80 #    endif
81 #    define gzprintf              nncxZlib_gzprintf
82 #    define gzputc                nncxZlib_gzputc
83 #    define gzputs                nncxZlib_gzputs
84 #    define gzread                nncxZlib_gzread
85 #    define gzrewind              nncxZlib_gzrewind
86 #    define gzseek                nncxZlib_gzseek
87 #    define gzseek64              nncxZlib_gzseek64
88 #    define gzsetparams           nncxZlib_gzsetparams
89 #    define gztell                nncxZlib_gztell
90 #    define gztell64              nncxZlib_gztell64
91 #    define gzungetc              nncxZlib_gzungetc
92 #    define gzwrite               nncxZlib_gzwrite
93 #  endif
94 #  define inflate               nncxZlib_inflate
95 #  define inflateBack           nncxZlib_inflateBack
96 #  define inflateBackEnd        nncxZlib_inflateBackEnd
97 #  define inflateBackInit_      nncxZlib_inflateBackInit_
98 #  define inflateCopy           nncxZlib_inflateCopy
99 #  define inflateEnd            nncxZlib_inflateEnd
100 #  define inflateGetHeader      nncxZlib_inflateGetHeader
101 #  define inflateInit2_         nncxZlib_inflateInit2_
102 #  define inflateInit_          nncxZlib_inflateInit_
103 #  define inflateMark           nncxZlib_inflateMark
104 #  define inflatePrime          nncxZlib_inflatePrime
105 #  define inflateReset          nncxZlib_inflateReset
106 #  define inflateReset2         nncxZlib_inflateReset2
107 #  define inflateSetDictionary  nncxZlib_inflateSetDictionary
108 #  define inflateSync           nncxZlib_inflateSync
109 #  define inflateSyncPoint      nncxZlib_inflateSyncPoint
110 #  define inflateUndermine      nncxZlib_inflateUndermine
111 #  define inflateResetKeep      nncxZlib_inflateResetKeep
112 #  define inflate_copyright     nncxZlib_inflate_copyright
113 #  define inflate_fast          nncxZlib_inflate_fast
114 #  define inflate_table         nncxZlib_inflate_table
115 #  ifndef Z_SOLO
116 #    define uncompress            nncxZlib_uncompress
117 #  endif
118 #  define zError                nncxZlib_zError
119 #  ifndef Z_SOLO
120 #    define zcalloc               nncxZlib_zcalloc
121 #    define zcfree                nncxZlib_zcfree
122 #  endif
123 #  define zlibCompileFlags      nncxZlib_zlibCompileFlags
124 #  define zlibVersion           nncxZlib_zlibVersion
125 
126 /* all zlib typedefs in zlib.h and zconf.h */
127 #  define Byte                  nncxZlib_Byte
128 #  define Bytef                 nncxZlib_Bytef
129 #  define alloc_func            nncxZlib_alloc_func
130 #  define charf                 nncxZlib_charf
131 #  define free_func             nncxZlib_free_func
132 #  ifndef Z_SOLO
133 #    define gzFile                nncxZlib_gzFile
134 #  endif
135 #  define gz_header             nncxZlib_gz_header
136 #  define gz_headerp            nncxZlib_gz_headerp
137 #  define in_func               nncxZlib_in_func
138 #  define intf                  nncxZlib_intf
139 #  define out_func              nncxZlib_out_func
140 #  define uInt                  nncxZlib_uInt
141 #  define uIntf                 nncxZlib_uIntf
142 #  define uLong                 nncxZlib_uLong
143 #  define uLongf                nncxZlib_uLongf
144 #  define voidp                 nncxZlib_voidp
145 #  define voidpc                nncxZlib_voidpc
146 #  define voidpf                nncxZlib_voidpf
147 
148 /* all zlib structs in zlib.h and zconf.h */
149 #  define gz_header_s           nncxZlib_gz_header_s
150 #  define internal_state        nncxZlib_internal_state
151 
152 /* internal */
153 #  define z_errmsg              nncxZlib_z_errmsg
154 #  define _tr_flush_bits        nncxZlib__tr_flush_bits
155 
156 #endif
157 
158 #if defined(__MSDOS__) && !defined(MSDOS)
159 #  define MSDOS
160 #endif
161 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
162 #  define OS2
163 #endif
164 #if defined(_WINDOWS) && !defined(WINDOWS)
165 #  define WINDOWS
166 #endif
167 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
168 #  ifndef WIN32
169 #    define WIN32
170 #  endif
171 #endif
172 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
173 #  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
174 #    ifndef SYS16BIT
175 #      define SYS16BIT
176 #    endif
177 #  endif
178 #endif
179 
180 /*
181  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
182  * than 64 KB at a time (needed on systems with 16-bit int).
183  */
184 #ifdef SYS16BIT
185 #  define MAXSEG_64K
186 #endif
187 #ifdef MSDOS
188 #  define UNALIGNED_OK
189 #endif
190 
191 #ifdef __STDC_VERSION__
192 #  ifndef STDC
193 #    define STDC
194 #  endif
195 #  if __STDC_VERSION__ >= 199901L
196 #    ifndef STDC99
197 #      define STDC99
198 #    endif
199 #  endif
200 #endif
201 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
202 #  define STDC
203 #endif
204 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
205 #  define STDC
206 #endif
207 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
208 #  define STDC
209 #endif
210 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
211 #  define STDC
212 #endif
213 
214 #if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
215 #  define STDC
216 #endif
217 
218 #ifndef STDC
219 #  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
220 #    define const       /* note: need a more gentle solution here */
221 #  endif
222 #endif
223 
224 #if defined(ZLIB_CONST) && !defined(z_const)
225 #  define z_const const
226 #else
227 #  define z_const
228 #endif
229 
230 /* Some Mac compilers merge all .h files incorrectly: */
231 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
232 #  define NO_DUMMY_DECL
233 #endif
234 
235 /* Maximum value for memLevel in deflateInit2 */
236 #ifndef MAX_MEM_LEVEL
237 #  ifdef MAXSEG_64K
238 #    define MAX_MEM_LEVEL 8
239 #  else
240 #    define MAX_MEM_LEVEL 9
241 #  endif
242 #endif
243 
244 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
245  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
246  * created by gzip. (Files created by minigzip can still be extracted by
247  * gzip.)
248  */
249 #ifndef MAX_WBITS
250 #  define MAX_WBITS   15 /* 32K LZ77 window */
251 #endif
252 
253 /* The memory requirements for deflate are (in bytes):
254             (1 << (windowBits+2)) +  (1 << (memLevel+9))
255  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
256  plus a few kilobytes for small objects. For example, if you want to reduce
257  the default memory requirements from 256K to 128K, compile with
258      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
259  Of course this will generally degrade compression (there's no free lunch).
260 
261    The memory requirements for inflate are (in bytes) 1 << windowBits
262  that is, 32K for windowBits=15 (default value) plus a few kilobytes
263  for small objects.
264 */
265 
266                         /* Type declarations */
267 
268 #ifndef OF /* function prototypes */
269 #  ifdef STDC
270 #    define OF(args)  args
271 #  else
272 #    define OF(args)  ()
273 #  endif
274 #endif
275 
276 #ifndef Z_ARG /* function prototypes for stdarg */
277 #  if defined(STDC) || defined(Z_HAVE_STDARG_H)
278 #    define Z_ARG(args)  args
279 #  else
280 #    define Z_ARG(args)  ()
281 #  endif
282 #endif
283 
284 /* The following definitions for FAR are needed only for MSDOS mixed
285  * model programming (small or medium model with some far allocations).
286  * This was tested only with MSC; for other MSDOS compilers you may have
287  * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
288  * just define FAR to be empty.
289  */
290 #ifdef SYS16BIT
291 #  if defined(M_I86SM) || defined(M_I86MM)
292      /* MSC small or medium model */
293 #    define SMALL_MEDIUM
294 #    ifdef _MSC_VER
295 #      define FAR _far
296 #    else
297 #      define FAR far
298 #    endif
299 #  endif
300 #  if (defined(__SMALL__) || defined(__MEDIUM__))
301      /* Turbo C small or medium model */
302 #    define SMALL_MEDIUM
303 #    ifdef __BORLANDC__
304 #      define FAR _far
305 #    else
306 #      define FAR far
307 #    endif
308 #  endif
309 #endif
310 
311 #if defined(WINDOWS) || defined(WIN32)
312    /* If building or using zlib as a DLL, define ZLIB_DLL.
313     * This is not mandatory, but it offers a little performance increase.
314     */
315 #  ifdef ZLIB_DLL
316 #    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
317 #      ifdef ZLIB_INTERNAL
318 #        define ZEXTERN extern __declspec(dllexport)
319 #      else
320 #        define ZEXTERN extern __declspec(dllimport)
321 #      endif
322 #    endif
323 #  endif  /* ZLIB_DLL */
324    /* If building or using zlib with the WINAPI/WINAPIV calling convention,
325     * define ZLIB_WINAPI.
326     * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
327     */
328 #  ifdef ZLIB_WINAPI
329 #    ifdef FAR
330 #      undef FAR
331 #    endif
332 #    include <windows.h>
333      /* No need for _export, use ZLIB.DEF instead. */
334      /* For complete Windows compatibility, use WINAPI, not __stdcall. */
335 #    define ZEXPORT WINAPI
336 #    ifdef WIN32
337 #      define ZEXPORTVA WINAPIV
338 #    else
339 #      define ZEXPORTVA FAR CDECL
340 #    endif
341 #  endif
342 #endif
343 
344 #if defined (__BEOS__)
345 #  ifdef ZLIB_DLL
346 #    ifdef ZLIB_INTERNAL
347 #      define ZEXPORT   __declspec(dllexport)
348 #      define ZEXPORTVA __declspec(dllexport)
349 #    else
350 #      define ZEXPORT   __declspec(dllimport)
351 #      define ZEXPORTVA __declspec(dllimport)
352 #    endif
353 #  endif
354 #endif
355 
356 #ifndef ZEXTERN
357 #  define ZEXTERN extern
358 #endif
359 #ifndef ZEXPORT
360 #  define ZEXPORT
361 #endif
362 #ifndef ZEXPORTVA
363 #  define ZEXPORTVA
364 #endif
365 
366 #ifndef FAR
367 #  define FAR
368 #endif
369 
370 #if !defined(__MACTYPES__)
371 typedef unsigned char  Byte;  /* 8 bits */
372 #endif
373 typedef unsigned int   uInt;  /* 16 bits or more */
374 typedef unsigned long  uLong; /* 32 bits or more */
375 
376 #ifdef SMALL_MEDIUM
377    /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
378 #  define Bytef Byte FAR
379 #else
380    typedef Byte  FAR Bytef;
381 #endif
382 typedef char  FAR charf;
383 typedef int   FAR intf;
384 typedef uInt  FAR uIntf;
385 typedef uLong FAR uLongf;
386 
387 #ifdef STDC
388    typedef void const *voidpc;
389    typedef void FAR   *voidpf;
390    typedef void       *voidp;
391 #else
392    typedef Byte const *voidpc;
393    typedef Byte FAR   *voidpf;
394    typedef Byte       *voidp;
395 #endif
396 
397 #define Z_U4 unsigned   /* ./configure put the #define Z_U4 here */
398 
399 #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
400 #  include <limits.h>
401 #  if (UINT_MAX == 0xffffffffUL)
402 #    define Z_U4 unsigned
403 #  else
404 #    if (ULONG_MAX == 0xffffffffUL)
405 #      define Z_U4 unsigned long
406 #    else
407 #      if (USHRT_MAX == 0xffffffffUL)
408 #        define Z_U4 unsigned short
409 #      endif
410 #    endif
411 #  endif
412 #endif
413 
414 #ifdef Z_U4
415    typedef Z_U4 z_crc_t;
416 #else
417    typedef unsigned long z_crc_t;
418 #endif
419 
420 #ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
421 #  define Z_HAVE_UNISTD_H
422 #endif
423 
424 #if 1    /* was set to #if 1 by ./configure */
425 #  define Z_HAVE_STDARG_H
426 #endif
427 
428 #ifdef STDC
429 #  ifndef Z_SOLO
430 #    ifdef NN_ZLIB_HAS_FIO
431 #      include <sys/types.h>      /* for off_t */
432 #    endif
433 #  endif
434 #endif
435 
436 #ifdef _WIN32
437 #  include <stddef.h>           /* for wchar_t */
438 #endif
439 
440 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
441  * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
442  * though the former does not conform to the LFS document), but considering
443  * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
444  * equivalently requesting no 64-bit operations
445  */
446 #if defined(LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
447 #  undef _LARGEFILE64_SOURCE
448 #endif
449 
450 #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
451 #  define Z_HAVE_UNISTD_H
452 #endif
453 #ifndef Z_SOLO
454 #  if defined(Z_HAVE_UNISTD_H) || defined(LARGEFILE64_SOURCE)
455 #    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
456 #    ifdef VMS
457 #      include <unixio.h>       /* for off_t */
458 #    endif
459 #    ifndef z_off_t
460 #      define z_off_t off_t
461 #    endif
462 #  endif
463 #endif
464 
465 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
466 #  define Z_LFS64
467 #endif
468 
469 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
470 #  define Z_LARGE64
471 #endif
472 
473 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
474 #  define Z_WANT64
475 #endif
476 
477 #if !defined(SEEK_SET) && !defined(Z_SOLO)
478 #  define SEEK_SET        0       /* Seek from beginning of file.  */
479 #  define SEEK_CUR        1       /* Seek from current position.  */
480 #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
481 #endif
482 
483 #ifndef z_off_t
484 #  define z_off_t long
485 #endif
486 
487 #if !defined(_WIN32) && defined(Z_LARGE64)
488 #  define z_off64_t off64_t
489 #else
490 #  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
491 #    define z_off64_t __int64
492 #  else
493 #    define z_off64_t z_off_t
494 #  endif
495 #endif
496 
497 /* MVS linker does not support external names larger than 8 bytes */
498 #if defined(__MVS__)
499   #pragma map(deflateInit_,"DEIN")
500   #pragma map(deflateInit2_,"DEIN2")
501   #pragma map(deflateEnd,"DEEND")
502   #pragma map(deflateBound,"DEBND")
503   #pragma map(inflateInit_,"ININ")
504   #pragma map(inflateInit2_,"ININ2")
505   #pragma map(inflateEnd,"INEND")
506   #pragma map(inflateSync,"INSY")
507   #pragma map(inflateSetDictionary,"INSEDI")
508   #pragma map(compressBound,"CMBND")
509   #pragma map(inflate_table,"INTABL")
510   #pragma map(inflate_fast,"INFA")
511   #pragma map(inflate_copyright,"INCOPY")
512 #endif
513 
514 #endif /* ZCONF_H */
515