1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-1998 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
6 /* @(#) $Id$ */
8 #ifndef _ZCONF_H
9 #define _ZCONF_H
11 /*
12 * If you *really* need a unique prefix for all types and library functions,
13 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
14 */
15 #ifdef Z_PREFIX
16 # define deflateInit_ z_deflateInit_
17 # define deflate z_deflate
18 # define deflateEnd z_deflateEnd
19 # define inflateInit_ z_inflateInit_
20 # define inflate z_inflate
21 # define inflateEnd z_inflateEnd
22 # define deflateInit2_ z_deflateInit2_
23 # define deflateSetDictionary z_deflateSetDictionary
24 # define deflateCopy z_deflateCopy
25 # define deflateReset z_deflateReset
26 # define deflateParams z_deflateParams
27 # define inflateInit2_ z_inflateInit2_
28 # define inflateSetDictionary z_inflateSetDictionary
29 # define inflateSync z_inflateSync
30 # define inflateSyncPoint z_inflateSyncPoint
31 # define inflateReset z_inflateReset
32 # define compress z_compress
33 # define compress2 z_compress2
34 # define uncompress z_uncompress
35 # define adler32 z_adler32
36 # define crc32 z_crc32
37 # define get_crc_table z_get_crc_table
39 # define Byte z_Byte
40 # define uInt z_uInt
41 # define uLong z_uLong
42 # define Bytef z_Bytef
43 # define charf z_charf
44 # define intf z_intf
45 # define uIntf z_uIntf
46 # define uLongf z_uLongf
47 # define voidpf z_voidpf
48 # define voidp z_voidp
49 #endif
51 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
52 # define WIN32
53 #endif
54 #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
55 # ifndef __32BIT__
56 # define __32BIT__
57 # endif
58 #endif
59 #if defined(__MSDOS__) && !defined(MSDOS)
60 # define MSDOS
61 #endif
63 /*
64 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
65 * than 64k bytes at a time (needed on systems with 16-bit int).
66 */
67 #if defined(MSDOS) && !defined(__32BIT__)
68 # define MAXSEG_64K
69 #endif
70 #ifdef MSDOS
71 # define UNALIGNED_OK
72 #endif
74 /* RRDtool will not compile without them anyway */
75 #define STDC
77 #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
78 # define STDC
79 #endif
80 #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
81 # ifndef STDC
82 # define STDC
83 # endif
84 #endif
86 #ifndef STDC
87 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
88 # define const
89 # endif
90 #endif
92 /* Some Mac compilers merge all .h files incorrectly: */
93 #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
94 # define NO_DUMMY_DECL
95 #endif
97 /* Old Borland C incorrectly complains about missing returns: */
98 #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
99 # define NEED_DUMMY_RETURN
100 #endif
103 /* Maximum value for memLevel in deflateInit2 */
104 #ifndef MAX_MEM_LEVEL
105 # ifdef MAXSEG_64K
106 # define MAX_MEM_LEVEL 8
107 # else
108 # define MAX_MEM_LEVEL 9
109 # endif
110 #endif
112 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
113 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
114 * created by gzip. (Files created by minigzip can still be extracted by
115 * gzip.)
116 */
117 #ifndef MAX_WBITS
118 # define MAX_WBITS 15 /* 32K LZ77 window */
119 #endif
121 /* The memory requirements for deflate are (in bytes):
122 (1 << (windowBits+2)) + (1 << (memLevel+9))
123 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
124 plus a few kilobytes for small objects. For example, if you want to reduce
125 the default memory requirements from 256K to 128K, compile with
126 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
127 Of course this will generally degrade compression (there's no free lunch).
129 The memory requirements for inflate are (in bytes) 1 << windowBits
130 that is, 32K for windowBits=15 (default value) plus a few kilobytes
131 for small objects.
132 */
134 /* Type declarations */
136 #ifndef OF /* function prototypes */
137 # ifdef STDC
138 # define OF(args) args
139 # else
140 # define OF(args) ()
141 # endif
142 #endif
144 /* The following definitions for FAR are needed only for MSDOS mixed
145 * model programming (small or medium model with some far allocations).
146 * This was tested only with MSC; for other MSDOS compilers you may have
147 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
148 * just define FAR to be empty.
149 */
150 #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
151 /* MSC small or medium model */
152 # define SMALL_MEDIUM
153 # ifdef _MSC_VER
154 # define FAR _far
155 # else
156 # define FAR far
157 # endif
158 #endif
159 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
160 # ifndef __32BIT__
161 # define SMALL_MEDIUM
162 # define FAR _far
163 # endif
164 #endif
166 /* Compile with -DZLIB_DLL for Windows DLL support */
167 #if defined(ZLIB_DLL)
168 # if defined(_WINDOWS) || defined(WINDOWS)
169 # ifdef FAR
170 # undef FAR
171 # endif
172 # include <windows.h>
173 # define ZEXPORT WINAPI
174 # ifdef WIN32
175 # define ZEXPORTVA WINAPIV
176 # else
177 # define ZEXPORTVA FAR _cdecl _export
178 # endif
179 # endif
180 # if defined (__BORLANDC__)
181 # if (__BORLANDC__ >= 0x0500) && defined (WIN32)
182 # include <windows.h>
183 # define ZEXPORT __declspec(dllexport) WINAPI
184 # define ZEXPORTRVA __declspec(dllexport) WINAPIV
185 # else
186 # if defined (_Windows) && defined (__DLL__)
187 # define ZEXPORT _export
188 # define ZEXPORTVA _export
189 # endif
190 # endif
191 # endif
192 #endif
194 #if defined (__BEOS__)
195 # if defined (ZLIB_DLL)
196 # define ZEXTERN extern __declspec(dllexport)
197 # else
198 # define ZEXTERN extern __declspec(dllimport)
199 # endif
200 #endif
202 #ifndef ZEXPORT
203 # define ZEXPORT
204 #endif
205 #ifndef ZEXPORTVA
206 # define ZEXPORTVA
207 #endif
208 #ifndef ZEXTERN
209 # define ZEXTERN extern
210 #endif
212 #ifndef FAR
213 # define FAR
214 #endif
216 #if !defined(MACOS) && !defined(TARGET_OS_MAC)
217 typedef unsigned char Byte; /* 8 bits */
218 #endif
219 typedef unsigned int uInt; /* 16 bits or more */
220 typedef unsigned long uLong; /* 32 bits or more */
222 #ifdef SMALL_MEDIUM
223 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
224 # define Bytef Byte FAR
225 #else
226 typedef Byte FAR Bytef;
227 #endif
228 typedef char FAR charf;
229 typedef int FAR intf;
230 typedef uInt FAR uIntf;
231 typedef uLong FAR uLongf;
233 #ifdef STDC
234 typedef void FAR *voidpf;
235 typedef void *voidp;
236 #else
237 typedef Byte FAR *voidpf;
238 typedef Byte *voidp;
239 #endif
241 #ifdef HAVE_UNISTD_H
242 # include <sys/types.h> /* for off_t */
243 # include <unistd.h> /* for SEEK_* and off_t */
244 # define z_off_t off_t
245 #endif
246 #ifndef SEEK_SET
247 # define SEEK_SET 0 /* Seek from beginning of file. */
248 # define SEEK_CUR 1 /* Seek from current position. */
249 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
250 #endif
251 #ifndef z_off_t
252 # define z_off_t long
253 #endif
255 /* MVS linker does not support external names larger than 8 bytes */
256 #if defined(__MVS__)
257 # pragma map(deflateInit_,"DEIN")
258 # pragma map(deflateInit2_,"DEIN2")
259 # pragma map(deflateEnd,"DEEND")
260 # pragma map(inflateInit_,"ININ")
261 # pragma map(inflateInit2_,"ININ2")
262 # pragma map(inflateEnd,"INEND")
263 # pragma map(inflateSync,"INSY")
264 # pragma map(inflateSetDictionary,"INSEDI")
265 # pragma map(inflate_blocks,"INBL")
266 # pragma map(inflate_blocks_new,"INBLNE")
267 # pragma map(inflate_blocks_free,"INBLFR")
268 # pragma map(inflate_blocks_reset,"INBLRE")
269 # pragma map(inflate_codes_free,"INCOFR")
270 # pragma map(inflate_codes,"INCO")
271 # pragma map(inflate_fast,"INFA")
272 # pragma map(inflate_flush,"INFLU")
273 # pragma map(inflate_mask,"INMA")
274 # pragma map(inflate_set_dictionary,"INSEDI2")
275 # pragma map(inflate_copyright,"INCOPY")
276 # pragma map(inflate_trees_bits,"INTRBI")
277 # pragma map(inflate_trees_dynamic,"INTRDY")
278 # pragma map(inflate_trees_fixed,"INTRFI")
279 # pragma map(inflate_trees_free,"INTRFR")
280 #endif
282 #endif /* _ZCONF_H */