rev |
line source |
nuclear@2
|
1 /* zconf.h -- configuration of the zlib compression library
|
nuclear@2
|
2 * Copyright (C) 1995-2005 Jean-loup Gailly.
|
nuclear@2
|
3 * For conditions of distribution and use, see copyright notice in zlib.h
|
nuclear@2
|
4 */
|
nuclear@2
|
5
|
nuclear@2
|
6 /* @(#) $Id$ */
|
nuclear@2
|
7
|
nuclear@2
|
8 #ifndef ZCONF_H
|
nuclear@2
|
9 #define ZCONF_H
|
nuclear@2
|
10
|
nuclear@2
|
11 /*
|
nuclear@2
|
12 * If you *really* need a unique prefix for all types and library functions,
|
nuclear@2
|
13 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
|
nuclear@2
|
14 */
|
nuclear@2
|
15 #ifdef Z_PREFIX
|
nuclear@2
|
16 # define deflateInit_ z_deflateInit_
|
nuclear@2
|
17 # define deflate z_deflate
|
nuclear@2
|
18 # define deflateEnd z_deflateEnd
|
nuclear@2
|
19 # define inflateInit_ z_inflateInit_
|
nuclear@2
|
20 # define inflate z_inflate
|
nuclear@2
|
21 # define inflateEnd z_inflateEnd
|
nuclear@2
|
22 # define deflateInit2_ z_deflateInit2_
|
nuclear@2
|
23 # define deflateSetDictionary z_deflateSetDictionary
|
nuclear@2
|
24 # define deflateCopy z_deflateCopy
|
nuclear@2
|
25 # define deflateReset z_deflateReset
|
nuclear@2
|
26 # define deflateParams z_deflateParams
|
nuclear@2
|
27 # define deflateBound z_deflateBound
|
nuclear@2
|
28 # define deflatePrime z_deflatePrime
|
nuclear@2
|
29 # define inflateInit2_ z_inflateInit2_
|
nuclear@2
|
30 # define inflateSetDictionary z_inflateSetDictionary
|
nuclear@2
|
31 # define inflateSync z_inflateSync
|
nuclear@2
|
32 # define inflateSyncPoint z_inflateSyncPoint
|
nuclear@2
|
33 # define inflateCopy z_inflateCopy
|
nuclear@2
|
34 # define inflateReset z_inflateReset
|
nuclear@2
|
35 # define inflateBack z_inflateBack
|
nuclear@2
|
36 # define inflateBackEnd z_inflateBackEnd
|
nuclear@2
|
37 # define compress z_compress
|
nuclear@2
|
38 # define compress2 z_compress2
|
nuclear@2
|
39 # define compressBound z_compressBound
|
nuclear@2
|
40 # define uncompress z_uncompress
|
nuclear@2
|
41 # define adler32 z_adler32
|
nuclear@2
|
42 # define crc32 z_crc32
|
nuclear@2
|
43 # define get_crc_table z_get_crc_table
|
nuclear@2
|
44 # define zError z_zError
|
nuclear@2
|
45
|
nuclear@2
|
46 # define alloc_func z_alloc_func
|
nuclear@2
|
47 # define free_func z_free_func
|
nuclear@2
|
48 # define in_func z_in_func
|
nuclear@2
|
49 # define out_func z_out_func
|
nuclear@2
|
50 # define Byte z_Byte
|
nuclear@2
|
51 # define uInt z_uInt
|
nuclear@2
|
52 # define uLong z_uLong
|
nuclear@2
|
53 # define Bytef z_Bytef
|
nuclear@2
|
54 # define charf z_charf
|
nuclear@2
|
55 # define intf z_intf
|
nuclear@2
|
56 # define uIntf z_uIntf
|
nuclear@2
|
57 # define uLongf z_uLongf
|
nuclear@2
|
58 # define voidpf z_voidpf
|
nuclear@2
|
59 # define voidp z_voidp
|
nuclear@2
|
60 #endif
|
nuclear@2
|
61
|
nuclear@2
|
62 #if defined(__MSDOS__) && !defined(MSDOS)
|
nuclear@2
|
63 # define MSDOS
|
nuclear@2
|
64 #endif
|
nuclear@2
|
65 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
|
nuclear@2
|
66 # define OS2
|
nuclear@2
|
67 #endif
|
nuclear@2
|
68 #if defined(_WINDOWS) && !defined(WINDOWS)
|
nuclear@2
|
69 # define WINDOWS
|
nuclear@2
|
70 #endif
|
nuclear@2
|
71 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
|
nuclear@2
|
72 # ifndef WIN32
|
nuclear@2
|
73 # define WIN32
|
nuclear@2
|
74 # endif
|
nuclear@2
|
75 #endif
|
nuclear@2
|
76 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
|
nuclear@2
|
77 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
|
nuclear@2
|
78 # ifndef SYS16BIT
|
nuclear@2
|
79 # define SYS16BIT
|
nuclear@2
|
80 # endif
|
nuclear@2
|
81 # endif
|
nuclear@2
|
82 #endif
|
nuclear@2
|
83
|
nuclear@2
|
84 /*
|
nuclear@2
|
85 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
|
nuclear@2
|
86 * than 64k bytes at a time (needed on systems with 16-bit int).
|
nuclear@2
|
87 */
|
nuclear@2
|
88 #ifdef SYS16BIT
|
nuclear@2
|
89 # define MAXSEG_64K
|
nuclear@2
|
90 #endif
|
nuclear@2
|
91 #ifdef MSDOS
|
nuclear@2
|
92 # define UNALIGNED_OK
|
nuclear@2
|
93 #endif
|
nuclear@2
|
94
|
nuclear@2
|
95 #ifdef __STDC_VERSION__
|
nuclear@2
|
96 # ifndef STDC
|
nuclear@2
|
97 # define STDC
|
nuclear@2
|
98 # endif
|
nuclear@2
|
99 # if __STDC_VERSION__ >= 199901L
|
nuclear@2
|
100 # ifndef STDC99
|
nuclear@2
|
101 # define STDC99
|
nuclear@2
|
102 # endif
|
nuclear@2
|
103 # endif
|
nuclear@2
|
104 #endif
|
nuclear@2
|
105 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
|
nuclear@2
|
106 # define STDC
|
nuclear@2
|
107 #endif
|
nuclear@2
|
108 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
|
nuclear@2
|
109 # define STDC
|
nuclear@2
|
110 #endif
|
nuclear@2
|
111 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
|
nuclear@2
|
112 # define STDC
|
nuclear@2
|
113 #endif
|
nuclear@2
|
114 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
|
nuclear@2
|
115 # define STDC
|
nuclear@2
|
116 #endif
|
nuclear@2
|
117
|
nuclear@2
|
118 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
|
nuclear@2
|
119 # define STDC
|
nuclear@2
|
120 #endif
|
nuclear@2
|
121
|
nuclear@2
|
122 #ifndef STDC
|
nuclear@2
|
123 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
|
nuclear@2
|
124 # define const /* note: need a more gentle solution here */
|
nuclear@2
|
125 # endif
|
nuclear@2
|
126 #endif
|
nuclear@2
|
127
|
nuclear@2
|
128 /* Some Mac compilers merge all .h files incorrectly: */
|
nuclear@2
|
129 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
|
nuclear@2
|
130 # define NO_DUMMY_DECL
|
nuclear@2
|
131 #endif
|
nuclear@2
|
132
|
nuclear@2
|
133 /* Maximum value for memLevel in deflateInit2 */
|
nuclear@2
|
134 #ifndef MAX_MEM_LEVEL
|
nuclear@2
|
135 # ifdef MAXSEG_64K
|
nuclear@2
|
136 # define MAX_MEM_LEVEL 8
|
nuclear@2
|
137 # else
|
nuclear@2
|
138 # define MAX_MEM_LEVEL 9
|
nuclear@2
|
139 # endif
|
nuclear@2
|
140 #endif
|
nuclear@2
|
141
|
nuclear@2
|
142 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
|
nuclear@2
|
143 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
|
nuclear@2
|
144 * created by gzip. (Files created by minigzip can still be extracted by
|
nuclear@2
|
145 * gzip.)
|
nuclear@2
|
146 */
|
nuclear@2
|
147 #ifndef MAX_WBITS
|
nuclear@2
|
148 # define MAX_WBITS 15 /* 32K LZ77 window */
|
nuclear@2
|
149 #endif
|
nuclear@2
|
150
|
nuclear@2
|
151 /* The memory requirements for deflate are (in bytes):
|
nuclear@2
|
152 (1 << (windowBits+2)) + (1 << (memLevel+9))
|
nuclear@2
|
153 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
|
nuclear@2
|
154 plus a few kilobytes for small objects. For example, if you want to reduce
|
nuclear@2
|
155 the default memory requirements from 256K to 128K, compile with
|
nuclear@2
|
156 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
|
nuclear@2
|
157 Of course this will generally degrade compression (there's no free lunch).
|
nuclear@2
|
158
|
nuclear@2
|
159 The memory requirements for inflate are (in bytes) 1 << windowBits
|
nuclear@2
|
160 that is, 32K for windowBits=15 (default value) plus a few kilobytes
|
nuclear@2
|
161 for small objects.
|
nuclear@2
|
162 */
|
nuclear@2
|
163
|
nuclear@2
|
164 /* Type declarations */
|
nuclear@2
|
165
|
nuclear@2
|
166 #ifndef OF /* function prototypes */
|
nuclear@2
|
167 # ifdef STDC
|
nuclear@2
|
168 # define OF(args) args
|
nuclear@2
|
169 # else
|
nuclear@2
|
170 # define OF(args) ()
|
nuclear@2
|
171 # endif
|
nuclear@2
|
172 #endif
|
nuclear@2
|
173
|
nuclear@2
|
174 /* The following definitions for FAR are needed only for MSDOS mixed
|
nuclear@2
|
175 * model programming (small or medium model with some far allocations).
|
nuclear@2
|
176 * This was tested only with MSC; for other MSDOS compilers you may have
|
nuclear@2
|
177 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
|
nuclear@2
|
178 * just define FAR to be empty.
|
nuclear@2
|
179 */
|
nuclear@2
|
180 #ifdef SYS16BIT
|
nuclear@2
|
181 # if defined(M_I86SM) || defined(M_I86MM)
|
nuclear@2
|
182 /* MSC small or medium model */
|
nuclear@2
|
183 # define SMALL_MEDIUM
|
nuclear@2
|
184 # ifdef _MSC_VER
|
nuclear@2
|
185 # define FAR _far
|
nuclear@2
|
186 # else
|
nuclear@2
|
187 # define FAR far
|
nuclear@2
|
188 # endif
|
nuclear@2
|
189 # endif
|
nuclear@2
|
190 # if (defined(__SMALL__) || defined(__MEDIUM__))
|
nuclear@2
|
191 /* Turbo C small or medium model */
|
nuclear@2
|
192 # define SMALL_MEDIUM
|
nuclear@2
|
193 # ifdef __BORLANDC__
|
nuclear@2
|
194 # define FAR _far
|
nuclear@2
|
195 # else
|
nuclear@2
|
196 # define FAR far
|
nuclear@2
|
197 # endif
|
nuclear@2
|
198 # endif
|
nuclear@2
|
199 #endif
|
nuclear@2
|
200
|
nuclear@2
|
201 #if defined(WINDOWS) || defined(WIN32)
|
nuclear@2
|
202 /* If building or using zlib as a DLL, define ZLIB_DLL.
|
nuclear@2
|
203 * This is not mandatory, but it offers a little performance increase.
|
nuclear@2
|
204 */
|
nuclear@2
|
205 # ifdef ZLIB_DLL
|
nuclear@2
|
206 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
|
nuclear@2
|
207 # ifdef ZLIB_INTERNAL
|
nuclear@2
|
208 # define ZEXTERN extern __declspec(dllexport)
|
nuclear@2
|
209 # else
|
nuclear@2
|
210 # define ZEXTERN extern __declspec(dllimport)
|
nuclear@2
|
211 # endif
|
nuclear@2
|
212 # endif
|
nuclear@2
|
213 # endif /* ZLIB_DLL */
|
nuclear@2
|
214 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
|
nuclear@2
|
215 * define ZLIB_WINAPI.
|
nuclear@2
|
216 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
|
nuclear@2
|
217 */
|
nuclear@2
|
218 # ifdef ZLIB_WINAPI
|
nuclear@2
|
219 # ifdef FAR
|
nuclear@2
|
220 # undef FAR
|
nuclear@2
|
221 # endif
|
nuclear@2
|
222 # include <windows.h>
|
nuclear@2
|
223 /* No need for _export, use ZLIB.DEF instead. */
|
nuclear@2
|
224 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
nuclear@2
|
225 # define ZEXPORT WINAPI
|
nuclear@2
|
226 # ifdef WIN32
|
nuclear@2
|
227 # define ZEXPORTVA WINAPIV
|
nuclear@2
|
228 # else
|
nuclear@2
|
229 # define ZEXPORTVA FAR CDECL
|
nuclear@2
|
230 # endif
|
nuclear@2
|
231 # endif
|
nuclear@2
|
232 #endif
|
nuclear@2
|
233
|
nuclear@2
|
234 #if defined (__BEOS__)
|
nuclear@2
|
235 # ifdef ZLIB_DLL
|
nuclear@2
|
236 # ifdef ZLIB_INTERNAL
|
nuclear@2
|
237 # define ZEXPORT __declspec(dllexport)
|
nuclear@2
|
238 # define ZEXPORTVA __declspec(dllexport)
|
nuclear@2
|
239 # else
|
nuclear@2
|
240 # define ZEXPORT __declspec(dllimport)
|
nuclear@2
|
241 # define ZEXPORTVA __declspec(dllimport)
|
nuclear@2
|
242 # endif
|
nuclear@2
|
243 # endif
|
nuclear@2
|
244 #endif
|
nuclear@2
|
245
|
nuclear@2
|
246 #ifndef ZEXTERN
|
nuclear@2
|
247 # define ZEXTERN extern
|
nuclear@2
|
248 #endif
|
nuclear@2
|
249 #ifndef ZEXPORT
|
nuclear@2
|
250 # define ZEXPORT
|
nuclear@2
|
251 #endif
|
nuclear@2
|
252 #ifndef ZEXPORTVA
|
nuclear@2
|
253 # define ZEXPORTVA
|
nuclear@2
|
254 #endif
|
nuclear@2
|
255
|
nuclear@2
|
256 #ifndef FAR
|
nuclear@2
|
257 # define FAR
|
nuclear@2
|
258 #endif
|
nuclear@2
|
259
|
nuclear@2
|
260 #if !defined(__MACTYPES__)
|
nuclear@2
|
261 typedef unsigned char Byte; /* 8 bits */
|
nuclear@2
|
262 #endif
|
nuclear@2
|
263 typedef unsigned int uInt; /* 16 bits or more */
|
nuclear@2
|
264 typedef unsigned long uLong; /* 32 bits or more */
|
nuclear@2
|
265
|
nuclear@2
|
266 #ifdef SMALL_MEDIUM
|
nuclear@2
|
267 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
|
nuclear@2
|
268 # define Bytef Byte FAR
|
nuclear@2
|
269 #else
|
nuclear@2
|
270 typedef Byte FAR Bytef;
|
nuclear@2
|
271 #endif
|
nuclear@2
|
272 typedef char FAR charf;
|
nuclear@2
|
273 typedef int FAR intf;
|
nuclear@2
|
274 typedef uInt FAR uIntf;
|
nuclear@2
|
275 typedef uLong FAR uLongf;
|
nuclear@2
|
276
|
nuclear@2
|
277 #ifdef STDC
|
nuclear@2
|
278 typedef void const *voidpc;
|
nuclear@2
|
279 typedef void FAR *voidpf;
|
nuclear@2
|
280 typedef void *voidp;
|
nuclear@2
|
281 #else
|
nuclear@2
|
282 typedef Byte const *voidpc;
|
nuclear@2
|
283 typedef Byte FAR *voidpf;
|
nuclear@2
|
284 typedef Byte *voidp;
|
nuclear@2
|
285 #endif
|
nuclear@2
|
286
|
nuclear@2
|
287 #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
|
nuclear@2
|
288 # include <sys/types.h> /* for off_t */
|
nuclear@2
|
289 # include <unistd.h> /* for SEEK_* and off_t */
|
nuclear@2
|
290 # ifdef VMS
|
nuclear@2
|
291 # include <unixio.h> /* for off_t */
|
nuclear@2
|
292 # endif
|
nuclear@2
|
293 # define z_off_t off_t
|
nuclear@2
|
294 #endif
|
nuclear@2
|
295 #ifndef SEEK_SET
|
nuclear@2
|
296 # define SEEK_SET 0 /* Seek from beginning of file. */
|
nuclear@2
|
297 # define SEEK_CUR 1 /* Seek from current position. */
|
nuclear@2
|
298 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
|
nuclear@2
|
299 #endif
|
nuclear@2
|
300 #ifndef z_off_t
|
nuclear@2
|
301 # define z_off_t long
|
nuclear@2
|
302 #endif
|
nuclear@2
|
303
|
nuclear@2
|
304 #if defined(__OS400__)
|
nuclear@2
|
305 # define NO_vsnprintf
|
nuclear@2
|
306 #endif
|
nuclear@2
|
307
|
nuclear@2
|
308 #if defined(__MVS__)
|
nuclear@2
|
309 # define NO_vsnprintf
|
nuclear@2
|
310 # ifdef FAR
|
nuclear@2
|
311 # undef FAR
|
nuclear@2
|
312 # endif
|
nuclear@2
|
313 #endif
|
nuclear@2
|
314
|
nuclear@2
|
315 /* MVS linker does not support external names larger than 8 bytes */
|
nuclear@2
|
316 #if defined(__MVS__)
|
nuclear@2
|
317 # pragma map(deflateInit_,"DEIN")
|
nuclear@2
|
318 # pragma map(deflateInit2_,"DEIN2")
|
nuclear@2
|
319 # pragma map(deflateEnd,"DEEND")
|
nuclear@2
|
320 # pragma map(deflateBound,"DEBND")
|
nuclear@2
|
321 # pragma map(inflateInit_,"ININ")
|
nuclear@2
|
322 # pragma map(inflateInit2_,"ININ2")
|
nuclear@2
|
323 # pragma map(inflateEnd,"INEND")
|
nuclear@2
|
324 # pragma map(inflateSync,"INSY")
|
nuclear@2
|
325 # pragma map(inflateSetDictionary,"INSEDI")
|
nuclear@2
|
326 # pragma map(compressBound,"CMBND")
|
nuclear@2
|
327 # pragma map(inflate_table,"INTABL")
|
nuclear@2
|
328 # pragma map(inflate_fast,"INFA")
|
nuclear@2
|
329 # pragma map(inflate_copyright,"INCOPY")
|
nuclear@2
|
330 #endif
|
nuclear@2
|
331
|
nuclear@2
|
332 #endif /* ZCONF_H */
|