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