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