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