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