|
7ef7284…
|
drh
|
1 |
/* zconf.h -- configuration of the zlib compression library |
|
6ea30fb…
|
florian
|
2 |
* Copyright (C) 1995-2026 Jean-loup Gailly, Mark Adler |
|
7ef7284…
|
drh
|
3 |
* For conditions of distribution and use, see copyright notice in zlib.h |
|
7ef7284…
|
drh
|
4 |
*/ |
|
7ef7284…
|
drh
|
5 |
|
|
7ef7284…
|
drh
|
6 |
/* @(#) $Id$ */ |
|
7ef7284…
|
drh
|
7 |
|
|
7ef7284…
|
drh
|
8 |
#ifndef ZCONF_H |
|
7ef7284…
|
drh
|
9 |
#define ZCONF_H |
|
7ef7284…
|
drh
|
10 |
|
|
7ef7284…
|
drh
|
11 |
/* |
|
7ef7284…
|
drh
|
12 |
* If you *really* need a unique prefix for all types and library functions, |
|
7ef7284…
|
drh
|
13 |
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. |
|
7ef7284…
|
drh
|
14 |
* Even better than compiling with -DZ_PREFIX would be to use configure to set |
|
7ef7284…
|
drh
|
15 |
* this permanently in zconf.h using "./configure --zprefix". |
|
7ef7284…
|
drh
|
16 |
*/ |
|
7ef7284…
|
drh
|
17 |
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ |
|
7ef7284…
|
drh
|
18 |
# define Z_PREFIX_SET |
|
7ef7284…
|
drh
|
19 |
|
|
e38d5e1…
|
jan.nijtmans
|
20 |
/* all linked symbols and init macros */ |
|
7ef7284…
|
drh
|
21 |
# define _dist_code z__dist_code |
|
7ef7284…
|
drh
|
22 |
# define _length_code z__length_code |
|
7ef7284…
|
drh
|
23 |
# define _tr_align z__tr_align |
|
bb4776e…
|
jan.nijtmans
|
24 |
# define _tr_flush_bits z__tr_flush_bits |
|
7ef7284…
|
drh
|
25 |
# define _tr_flush_block z__tr_flush_block |
|
7ef7284…
|
drh
|
26 |
# define _tr_init z__tr_init |
|
7ef7284…
|
drh
|
27 |
# define _tr_stored_block z__tr_stored_block |
|
7ef7284…
|
drh
|
28 |
# define _tr_tally z__tr_tally |
|
7ef7284…
|
drh
|
29 |
# define adler32 z_adler32 |
|
7ef7284…
|
drh
|
30 |
# define adler32_combine z_adler32_combine |
|
7ef7284…
|
drh
|
31 |
# define adler32_combine64 z_adler32_combine64 |
|
e38d5e1…
|
jan.nijtmans
|
32 |
# define adler32_z z_adler32_z |
|
7ef7284…
|
drh
|
33 |
# ifndef Z_SOLO |
|
7ef7284…
|
drh
|
34 |
# define compress z_compress |
|
7ef7284…
|
drh
|
35 |
# define compress2 z_compress2 |
|
6ea30fb…
|
florian
|
36 |
# define compress_z z_compress_z |
|
6ea30fb…
|
florian
|
37 |
# define compress2_z z_compress2_z |
|
7ef7284…
|
drh
|
38 |
# define compressBound z_compressBound |
|
6ea30fb…
|
florian
|
39 |
# define compressBound_z z_compressBound_z |
|
7ef7284…
|
drh
|
40 |
# endif |
|
7ef7284…
|
drh
|
41 |
# define crc32 z_crc32 |
|
7ef7284…
|
drh
|
42 |
# define crc32_combine z_crc32_combine |
|
7ef7284…
|
drh
|
43 |
# define crc32_combine64 z_crc32_combine64 |
|
a9e589c…
|
florian
|
44 |
# define crc32_combine_gen z_crc32_combine_gen |
|
a9e589c…
|
florian
|
45 |
# define crc32_combine_gen64 z_crc32_combine_gen64 |
|
a9e589c…
|
florian
|
46 |
# define crc32_combine_op z_crc32_combine_op |
|
e38d5e1…
|
jan.nijtmans
|
47 |
# define crc32_z z_crc32_z |
|
7ef7284…
|
drh
|
48 |
# define deflate z_deflate |
|
7ef7284…
|
drh
|
49 |
# define deflateBound z_deflateBound |
|
6ea30fb…
|
florian
|
50 |
# define deflateBound_z z_deflateBound_z |
|
7ef7284…
|
drh
|
51 |
# define deflateCopy z_deflateCopy |
|
7ef7284…
|
drh
|
52 |
# define deflateEnd z_deflateEnd |
|
e38d5e1…
|
jan.nijtmans
|
53 |
# define deflateGetDictionary z_deflateGetDictionary |
|
e38d5e1…
|
jan.nijtmans
|
54 |
# define deflateInit z_deflateInit |
|
e38d5e1…
|
jan.nijtmans
|
55 |
# define deflateInit2 z_deflateInit2 |
|
7ef7284…
|
drh
|
56 |
# define deflateInit2_ z_deflateInit2_ |
|
7ef7284…
|
drh
|
57 |
# define deflateInit_ z_deflateInit_ |
|
7ef7284…
|
drh
|
58 |
# define deflateParams z_deflateParams |
|
7ef7284…
|
drh
|
59 |
# define deflatePending z_deflatePending |
|
7ef7284…
|
drh
|
60 |
# define deflatePrime z_deflatePrime |
|
7ef7284…
|
drh
|
61 |
# define deflateReset z_deflateReset |
|
7ef7284…
|
drh
|
62 |
# define deflateResetKeep z_deflateResetKeep |
|
7ef7284…
|
drh
|
63 |
# define deflateSetDictionary z_deflateSetDictionary |
|
7ef7284…
|
drh
|
64 |
# define deflateSetHeader z_deflateSetHeader |
|
7ef7284…
|
drh
|
65 |
# define deflateTune z_deflateTune |
|
6ea30fb…
|
florian
|
66 |
# define deflateUsed z_deflateUsed |
|
7ef7284…
|
drh
|
67 |
# define deflate_copyright z_deflate_copyright |
|
7ef7284…
|
drh
|
68 |
# define get_crc_table z_get_crc_table |
|
7ef7284…
|
drh
|
69 |
# ifndef Z_SOLO |
|
7ef7284…
|
drh
|
70 |
# define gz_error z_gz_error |
|
7ef7284…
|
drh
|
71 |
# define gz_intmax z_gz_intmax |
|
7ef7284…
|
drh
|
72 |
# define gz_strwinerror z_gz_strwinerror |
|
7ef7284…
|
drh
|
73 |
# define gzbuffer z_gzbuffer |
|
7ef7284…
|
drh
|
74 |
# define gzclearerr z_gzclearerr |
|
7ef7284…
|
drh
|
75 |
# define gzclose z_gzclose |
|
7ef7284…
|
drh
|
76 |
# define gzclose_r z_gzclose_r |
|
7ef7284…
|
drh
|
77 |
# define gzclose_w z_gzclose_w |
|
7ef7284…
|
drh
|
78 |
# define gzdirect z_gzdirect |
|
7ef7284…
|
drh
|
79 |
# define gzdopen z_gzdopen |
|
7ef7284…
|
drh
|
80 |
# define gzeof z_gzeof |
|
7ef7284…
|
drh
|
81 |
# define gzerror z_gzerror |
|
7ef7284…
|
drh
|
82 |
# define gzflush z_gzflush |
|
e38d5e1…
|
jan.nijtmans
|
83 |
# define gzfread z_gzfread |
|
e38d5e1…
|
jan.nijtmans
|
84 |
# define gzfwrite z_gzfwrite |
|
7ef7284…
|
drh
|
85 |
# define gzgetc z_gzgetc |
|
7ef7284…
|
drh
|
86 |
# define gzgetc_ z_gzgetc_ |
|
7ef7284…
|
drh
|
87 |
# define gzgets z_gzgets |
|
7ef7284…
|
drh
|
88 |
# define gzoffset z_gzoffset |
|
7ef7284…
|
drh
|
89 |
# define gzoffset64 z_gzoffset64 |
|
7ef7284…
|
drh
|
90 |
# define gzopen z_gzopen |
|
7ef7284…
|
drh
|
91 |
# define gzopen64 z_gzopen64 |
|
7ef7284…
|
drh
|
92 |
# ifdef _WIN32 |
|
7ef7284…
|
drh
|
93 |
# define gzopen_w z_gzopen_w |
|
7ef7284…
|
drh
|
94 |
# endif |
|
7ef7284…
|
drh
|
95 |
# define gzprintf z_gzprintf |
|
7ef7284…
|
drh
|
96 |
# define gzputc z_gzputc |
|
7ef7284…
|
drh
|
97 |
# define gzputs z_gzputs |
|
7ef7284…
|
drh
|
98 |
# define gzread z_gzread |
|
7ef7284…
|
drh
|
99 |
# define gzrewind z_gzrewind |
|
7ef7284…
|
drh
|
100 |
# define gzseek z_gzseek |
|
7ef7284…
|
drh
|
101 |
# define gzseek64 z_gzseek64 |
|
7ef7284…
|
drh
|
102 |
# define gzsetparams z_gzsetparams |
|
7ef7284…
|
drh
|
103 |
# define gztell z_gztell |
|
7ef7284…
|
drh
|
104 |
# define gztell64 z_gztell64 |
|
7ef7284…
|
drh
|
105 |
# define gzungetc z_gzungetc |
|
e38d5e1…
|
jan.nijtmans
|
106 |
# define gzvprintf z_gzvprintf |
|
7ef7284…
|
drh
|
107 |
# define gzwrite z_gzwrite |
|
7ef7284…
|
drh
|
108 |
# endif |
|
7ef7284…
|
drh
|
109 |
# define inflate z_inflate |
|
7ef7284…
|
drh
|
110 |
# define inflateBack z_inflateBack |
|
7ef7284…
|
drh
|
111 |
# define inflateBackEnd z_inflateBackEnd |
|
e38d5e1…
|
jan.nijtmans
|
112 |
# define inflateBackInit z_inflateBackInit |
|
7ef7284…
|
drh
|
113 |
# define inflateBackInit_ z_inflateBackInit_ |
|
e38d5e1…
|
jan.nijtmans
|
114 |
# define inflateCodesUsed z_inflateCodesUsed |
|
7ef7284…
|
drh
|
115 |
# define inflateCopy z_inflateCopy |
|
7ef7284…
|
drh
|
116 |
# define inflateEnd z_inflateEnd |
|
e38d5e1…
|
jan.nijtmans
|
117 |
# define inflateGetDictionary z_inflateGetDictionary |
|
7ef7284…
|
drh
|
118 |
# define inflateGetHeader z_inflateGetHeader |
|
e38d5e1…
|
jan.nijtmans
|
119 |
# define inflateInit z_inflateInit |
|
e38d5e1…
|
jan.nijtmans
|
120 |
# define inflateInit2 z_inflateInit2 |
|
7ef7284…
|
drh
|
121 |
# define inflateInit2_ z_inflateInit2_ |
|
7ef7284…
|
drh
|
122 |
# define inflateInit_ z_inflateInit_ |
|
7ef7284…
|
drh
|
123 |
# define inflateMark z_inflateMark |
|
7ef7284…
|
drh
|
124 |
# define inflatePrime z_inflatePrime |
|
7ef7284…
|
drh
|
125 |
# define inflateReset z_inflateReset |
|
7ef7284…
|
drh
|
126 |
# define inflateReset2 z_inflateReset2 |
|
e38d5e1…
|
jan.nijtmans
|
127 |
# define inflateResetKeep z_inflateResetKeep |
|
7ef7284…
|
drh
|
128 |
# define inflateSetDictionary z_inflateSetDictionary |
|
7ef7284…
|
drh
|
129 |
# define inflateSync z_inflateSync |
|
7ef7284…
|
drh
|
130 |
# define inflateSyncPoint z_inflateSyncPoint |
|
7ef7284…
|
drh
|
131 |
# define inflateUndermine z_inflateUndermine |
|
e38d5e1…
|
jan.nijtmans
|
132 |
# define inflateValidate z_inflateValidate |
|
7ef7284…
|
drh
|
133 |
# define inflate_copyright z_inflate_copyright |
|
7ef7284…
|
drh
|
134 |
# define inflate_fast z_inflate_fast |
|
7ef7284…
|
drh
|
135 |
# define inflate_table z_inflate_table |
|
6ea30fb…
|
florian
|
136 |
# define inflate_fixed z_inflate_fixed |
|
7ef7284…
|
drh
|
137 |
# ifndef Z_SOLO |
|
7ef7284…
|
drh
|
138 |
# define uncompress z_uncompress |
|
e38d5e1…
|
jan.nijtmans
|
139 |
# define uncompress2 z_uncompress2 |
|
6ea30fb…
|
florian
|
140 |
# define uncompress_z z_uncompress_z |
|
6ea30fb…
|
florian
|
141 |
# define uncompress2_z z_uncompress2_z |
|
7ef7284…
|
drh
|
142 |
# endif |
|
7ef7284…
|
drh
|
143 |
# define zError z_zError |
|
7ef7284…
|
drh
|
144 |
# ifndef Z_SOLO |
|
7ef7284…
|
drh
|
145 |
# define zcalloc z_zcalloc |
|
7ef7284…
|
drh
|
146 |
# define zcfree z_zcfree |
|
7ef7284…
|
drh
|
147 |
# endif |
|
7ef7284…
|
drh
|
148 |
# define zlibCompileFlags z_zlibCompileFlags |
|
7ef7284…
|
drh
|
149 |
# define zlibVersion z_zlibVersion |
|
7ef7284…
|
drh
|
150 |
|
|
7ef7284…
|
drh
|
151 |
/* all zlib typedefs in zlib.h and zconf.h */ |
|
7ef7284…
|
drh
|
152 |
# define Byte z_Byte |
|
7ef7284…
|
drh
|
153 |
# define Bytef z_Bytef |
|
7ef7284…
|
drh
|
154 |
# define alloc_func z_alloc_func |
|
7ef7284…
|
drh
|
155 |
# define charf z_charf |
|
7ef7284…
|
drh
|
156 |
# define free_func z_free_func |
|
7ef7284…
|
drh
|
157 |
# ifndef Z_SOLO |
|
7ef7284…
|
drh
|
158 |
# define gzFile z_gzFile |
|
7ef7284…
|
drh
|
159 |
# endif |
|
7ef7284…
|
drh
|
160 |
# define gz_header z_gz_header |
|
7ef7284…
|
drh
|
161 |
# define gz_headerp z_gz_headerp |
|
7ef7284…
|
drh
|
162 |
# define in_func z_in_func |
|
7ef7284…
|
drh
|
163 |
# define intf z_intf |
|
7ef7284…
|
drh
|
164 |
# define out_func z_out_func |
|
7ef7284…
|
drh
|
165 |
# define uInt z_uInt |
|
7ef7284…
|
drh
|
166 |
# define uIntf z_uIntf |
|
7ef7284…
|
drh
|
167 |
# define uLong z_uLong |
|
7ef7284…
|
drh
|
168 |
# define uLongf z_uLongf |
|
7ef7284…
|
drh
|
169 |
# define voidp z_voidp |
|
7ef7284…
|
drh
|
170 |
# define voidpc z_voidpc |
|
7ef7284…
|
drh
|
171 |
# define voidpf z_voidpf |
|
7ef7284…
|
drh
|
172 |
|
|
7ef7284…
|
drh
|
173 |
/* all zlib structs in zlib.h and zconf.h */ |
|
7ef7284…
|
drh
|
174 |
# define gz_header_s z_gz_header_s |
|
7ef7284…
|
drh
|
175 |
# define internal_state z_internal_state |
|
7ef7284…
|
drh
|
176 |
|
|
7ef7284…
|
drh
|
177 |
#endif |
|
7ef7284…
|
drh
|
178 |
|
|
7ef7284…
|
drh
|
179 |
#if defined(__MSDOS__) && !defined(MSDOS) |
|
7ef7284…
|
drh
|
180 |
# define MSDOS |
|
7ef7284…
|
drh
|
181 |
#endif |
|
7ef7284…
|
drh
|
182 |
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) |
|
7ef7284…
|
drh
|
183 |
# define OS2 |
|
7ef7284…
|
drh
|
184 |
#endif |
|
7ef7284…
|
drh
|
185 |
#if defined(_WINDOWS) && !defined(WINDOWS) |
|
7ef7284…
|
drh
|
186 |
# define WINDOWS |
|
7ef7284…
|
drh
|
187 |
#endif |
|
7ef7284…
|
drh
|
188 |
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) |
|
7ef7284…
|
drh
|
189 |
# ifndef WIN32 |
|
7ef7284…
|
drh
|
190 |
# define WIN32 |
|
7ef7284…
|
drh
|
191 |
# endif |
|
7ef7284…
|
drh
|
192 |
#endif |
|
7ef7284…
|
drh
|
193 |
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) |
|
7ef7284…
|
drh
|
194 |
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) |
|
7ef7284…
|
drh
|
195 |
# ifndef SYS16BIT |
|
7ef7284…
|
drh
|
196 |
# define SYS16BIT |
|
7ef7284…
|
drh
|
197 |
# endif |
|
7ef7284…
|
drh
|
198 |
# endif |
|
7ef7284…
|
drh
|
199 |
#endif |
|
7ef7284…
|
drh
|
200 |
|
|
7ef7284…
|
drh
|
201 |
/* |
|
7ef7284…
|
drh
|
202 |
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more |
|
7ef7284…
|
drh
|
203 |
* than 64k bytes at a time (needed on systems with 16-bit int). |
|
7ef7284…
|
drh
|
204 |
*/ |
|
7ef7284…
|
drh
|
205 |
#ifdef SYS16BIT |
|
7ef7284…
|
drh
|
206 |
# define MAXSEG_64K |
|
7ef7284…
|
drh
|
207 |
#endif |
|
7ef7284…
|
drh
|
208 |
#ifdef MSDOS |
|
7ef7284…
|
drh
|
209 |
# define UNALIGNED_OK |
|
7ef7284…
|
drh
|
210 |
#endif |
|
7ef7284…
|
drh
|
211 |
|
|
7ef7284…
|
drh
|
212 |
#ifdef __STDC_VERSION__ |
|
7ef7284…
|
drh
|
213 |
# ifndef STDC |
|
7ef7284…
|
drh
|
214 |
# define STDC |
|
7ef7284…
|
drh
|
215 |
# endif |
|
7ef7284…
|
drh
|
216 |
# if __STDC_VERSION__ >= 199901L |
|
7ef7284…
|
drh
|
217 |
# ifndef STDC99 |
|
7ef7284…
|
drh
|
218 |
# define STDC99 |
|
7ef7284…
|
drh
|
219 |
# endif |
|
7ef7284…
|
drh
|
220 |
# endif |
|
7ef7284…
|
drh
|
221 |
#endif |
|
7ef7284…
|
drh
|
222 |
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) |
|
7ef7284…
|
drh
|
223 |
# define STDC |
|
7ef7284…
|
drh
|
224 |
#endif |
|
7ef7284…
|
drh
|
225 |
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) |
|
7ef7284…
|
drh
|
226 |
# define STDC |
|
7ef7284…
|
drh
|
227 |
#endif |
|
7ef7284…
|
drh
|
228 |
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) |
|
7ef7284…
|
drh
|
229 |
# define STDC |
|
7ef7284…
|
drh
|
230 |
#endif |
|
7ef7284…
|
drh
|
231 |
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) |
|
7ef7284…
|
drh
|
232 |
# define STDC |
|
7ef7284…
|
drh
|
233 |
#endif |
|
7ef7284…
|
drh
|
234 |
|
|
7ef7284…
|
drh
|
235 |
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ |
|
7ef7284…
|
drh
|
236 |
# define STDC |
|
7ef7284…
|
drh
|
237 |
#endif |
|
7ef7284…
|
drh
|
238 |
|
|
7ef7284…
|
drh
|
239 |
#ifndef STDC |
|
7ef7284…
|
drh
|
240 |
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ |
|
7ef7284…
|
drh
|
241 |
# define const /* note: need a more gentle solution here */ |
|
7ef7284…
|
drh
|
242 |
# endif |
|
7ef7284…
|
drh
|
243 |
#endif |
|
7ef7284…
|
drh
|
244 |
|
|
6ea30fb…
|
florian
|
245 |
#ifndef z_const |
|
6ea30fb…
|
florian
|
246 |
# ifdef ZLIB_CONST |
|
6ea30fb…
|
florian
|
247 |
# define z_const const |
|
6ea30fb…
|
florian
|
248 |
# else |
|
6ea30fb…
|
florian
|
249 |
# define z_const |
|
6ea30fb…
|
florian
|
250 |
# endif |
|
e38d5e1…
|
jan.nijtmans
|
251 |
#endif |
|
e38d5e1…
|
jan.nijtmans
|
252 |
|
|
e38d5e1…
|
jan.nijtmans
|
253 |
#ifdef Z_SOLO |
|
f1f1d6c…
|
drh
|
254 |
# ifdef _WIN64 |
|
f1f1d6c…
|
drh
|
255 |
typedef unsigned long long z_size_t; |
|
f1f1d6c…
|
drh
|
256 |
# else |
|
f1f1d6c…
|
drh
|
257 |
typedef unsigned long z_size_t; |
|
f1f1d6c…
|
drh
|
258 |
# endif |
|
7ef7284…
|
drh
|
259 |
#else |
|
e38d5e1…
|
jan.nijtmans
|
260 |
# define z_longlong long long |
|
e38d5e1…
|
jan.nijtmans
|
261 |
# if defined(NO_SIZE_T) |
|
e38d5e1…
|
jan.nijtmans
|
262 |
typedef unsigned NO_SIZE_T z_size_t; |
|
e38d5e1…
|
jan.nijtmans
|
263 |
# elif defined(STDC) |
|
e38d5e1…
|
jan.nijtmans
|
264 |
# include <stddef.h> |
|
e38d5e1…
|
jan.nijtmans
|
265 |
typedef size_t z_size_t; |
|
e38d5e1…
|
jan.nijtmans
|
266 |
# else |
|
e38d5e1…
|
jan.nijtmans
|
267 |
typedef unsigned long z_size_t; |
|
e38d5e1…
|
jan.nijtmans
|
268 |
# endif |
|
e38d5e1…
|
jan.nijtmans
|
269 |
# undef z_longlong |
|
7ef7284…
|
drh
|
270 |
#endif |
|
7ef7284…
|
drh
|
271 |
|
|
7ef7284…
|
drh
|
272 |
/* Maximum value for memLevel in deflateInit2 */ |
|
7ef7284…
|
drh
|
273 |
#ifndef MAX_MEM_LEVEL |
|
7ef7284…
|
drh
|
274 |
# ifdef MAXSEG_64K |
|
7ef7284…
|
drh
|
275 |
# define MAX_MEM_LEVEL 8 |
|
7ef7284…
|
drh
|
276 |
# else |
|
7ef7284…
|
drh
|
277 |
# define MAX_MEM_LEVEL 9 |
|
7ef7284…
|
drh
|
278 |
# endif |
|
7ef7284…
|
drh
|
279 |
#endif |
|
7ef7284…
|
drh
|
280 |
|
|
7ef7284…
|
drh
|
281 |
/* Maximum value for windowBits in deflateInit2 and inflateInit2. |
|
7ef7284…
|
drh
|
282 |
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files |
|
7ef7284…
|
drh
|
283 |
* created by gzip. (Files created by minigzip can still be extracted by |
|
7ef7284…
|
drh
|
284 |
* gzip.) |
|
7ef7284…
|
drh
|
285 |
*/ |
|
7ef7284…
|
drh
|
286 |
#ifndef MAX_WBITS |
|
7ef7284…
|
drh
|
287 |
# define MAX_WBITS 15 /* 32K LZ77 window */ |
|
7ef7284…
|
drh
|
288 |
#endif |
|
7ef7284…
|
drh
|
289 |
|
|
7ef7284…
|
drh
|
290 |
/* The memory requirements for deflate are (in bytes): |
|
7ef7284…
|
drh
|
291 |
(1 << (windowBits+2)) + (1 << (memLevel+9)) |
|
7ef7284…
|
drh
|
292 |
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) |
|
7ef7284…
|
drh
|
293 |
plus a few kilobytes for small objects. For example, if you want to reduce |
|
7ef7284…
|
drh
|
294 |
the default memory requirements from 256K to 128K, compile with |
|
7ef7284…
|
drh
|
295 |
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" |
|
7ef7284…
|
drh
|
296 |
Of course this will generally degrade compression (there's no free lunch). |
|
7ef7284…
|
drh
|
297 |
|
|
7ef7284…
|
drh
|
298 |
The memory requirements for inflate are (in bytes) 1 << windowBits |
|
e38d5e1…
|
jan.nijtmans
|
299 |
that is, 32K for windowBits=15 (default value) plus about 7 kilobytes |
|
7ef7284…
|
drh
|
300 |
for small objects. |
|
7ef7284…
|
drh
|
301 |
*/ |
|
7ef7284…
|
drh
|
302 |
|
|
7ef7284…
|
drh
|
303 |
/* Type declarations */ |
|
7ef7284…
|
drh
|
304 |
|
|
7ef7284…
|
drh
|
305 |
#ifndef OF /* function prototypes */ |
|
7ef7284…
|
drh
|
306 |
# ifdef STDC |
|
7ef7284…
|
drh
|
307 |
# define OF(args) args |
|
7ef7284…
|
drh
|
308 |
# else |
|
7ef7284…
|
drh
|
309 |
# define OF(args) () |
|
7ef7284…
|
drh
|
310 |
# endif |
|
7ef7284…
|
drh
|
311 |
#endif |
|
7ef7284…
|
drh
|
312 |
|
|
7ef7284…
|
drh
|
313 |
/* The following definitions for FAR are needed only for MSDOS mixed |
|
7ef7284…
|
drh
|
314 |
* model programming (small or medium model with some far allocations). |
|
7ef7284…
|
drh
|
315 |
* This was tested only with MSC; for other MSDOS compilers you may have |
|
7ef7284…
|
drh
|
316 |
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model, |
|
7ef7284…
|
drh
|
317 |
* just define FAR to be empty. |
|
7ef7284…
|
drh
|
318 |
*/ |
|
7ef7284…
|
drh
|
319 |
#ifdef SYS16BIT |
|
7ef7284…
|
drh
|
320 |
# if defined(M_I86SM) || defined(M_I86MM) |
|
7ef7284…
|
drh
|
321 |
/* MSC small or medium model */ |
|
7ef7284…
|
drh
|
322 |
# define SMALL_MEDIUM |
|
7ef7284…
|
drh
|
323 |
# ifdef _MSC_VER |
|
7ef7284…
|
drh
|
324 |
# define FAR _far |
|
7ef7284…
|
drh
|
325 |
# else |
|
7ef7284…
|
drh
|
326 |
# define FAR far |
|
7ef7284…
|
drh
|
327 |
# endif |
|
7ef7284…
|
drh
|
328 |
# endif |
|
7ef7284…
|
drh
|
329 |
# if (defined(__SMALL__) || defined(__MEDIUM__)) |
|
7ef7284…
|
drh
|
330 |
/* Turbo C small or medium model */ |
|
7ef7284…
|
drh
|
331 |
# define SMALL_MEDIUM |
|
7ef7284…
|
drh
|
332 |
# ifdef __BORLANDC__ |
|
7ef7284…
|
drh
|
333 |
# define FAR _far |
|
7ef7284…
|
drh
|
334 |
# else |
|
7ef7284…
|
drh
|
335 |
# define FAR far |
|
7ef7284…
|
drh
|
336 |
# endif |
|
7ef7284…
|
drh
|
337 |
# endif |
|
7ef7284…
|
drh
|
338 |
#endif |
|
7ef7284…
|
drh
|
339 |
|
|
7ef7284…
|
drh
|
340 |
#if defined(WINDOWS) || defined(WIN32) |
|
7ef7284…
|
drh
|
341 |
/* If building or using zlib as a DLL, define ZLIB_DLL. |
|
7ef7284…
|
drh
|
342 |
* This is not mandatory, but it offers a little performance increase. |
|
7ef7284…
|
drh
|
343 |
*/ |
|
7ef7284…
|
drh
|
344 |
# ifdef ZLIB_DLL |
|
7ef7284…
|
drh
|
345 |
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) |
|
7ef7284…
|
drh
|
346 |
# ifdef ZLIB_INTERNAL |
|
7ef7284…
|
drh
|
347 |
# define ZEXTERN extern __declspec(dllexport) |
|
7ef7284…
|
drh
|
348 |
# else |
|
7ef7284…
|
drh
|
349 |
# define ZEXTERN extern __declspec(dllimport) |
|
7ef7284…
|
drh
|
350 |
# endif |
|
7ef7284…
|
drh
|
351 |
# endif |
|
7ef7284…
|
drh
|
352 |
# endif /* ZLIB_DLL */ |
|
7ef7284…
|
drh
|
353 |
/* If building or using zlib with the WINAPI/WINAPIV calling convention, |
|
7ef7284…
|
drh
|
354 |
* define ZLIB_WINAPI. |
|
7ef7284…
|
drh
|
355 |
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. |
|
7ef7284…
|
drh
|
356 |
*/ |
|
7ef7284…
|
drh
|
357 |
# ifdef ZLIB_WINAPI |
|
7ef7284…
|
drh
|
358 |
# ifdef FAR |
|
7ef7284…
|
drh
|
359 |
# undef FAR |
|
a9e589c…
|
florian
|
360 |
# endif |
|
a9e589c…
|
florian
|
361 |
# ifndef WIN32_LEAN_AND_MEAN |
|
a9e589c…
|
florian
|
362 |
# define WIN32_LEAN_AND_MEAN |
|
7ef7284…
|
drh
|
363 |
# endif |
|
7ef7284…
|
drh
|
364 |
# include <windows.h> |
|
7ef7284…
|
drh
|
365 |
/* No need for _export, use ZLIB.DEF instead. */ |
|
7ef7284…
|
drh
|
366 |
/* For complete Windows compatibility, use WINAPI, not __stdcall. */ |
|
7ef7284…
|
drh
|
367 |
# define ZEXPORT WINAPI |
|
7ef7284…
|
drh
|
368 |
# ifdef WIN32 |
|
7ef7284…
|
drh
|
369 |
# define ZEXPORTVA WINAPIV |
|
7ef7284…
|
drh
|
370 |
# else |
|
7ef7284…
|
drh
|
371 |
# define ZEXPORTVA FAR CDECL |
|
7ef7284…
|
drh
|
372 |
# endif |
|
7ef7284…
|
drh
|
373 |
# endif |
|
7ef7284…
|
drh
|
374 |
#endif |
|
7ef7284…
|
drh
|
375 |
|
|
7ef7284…
|
drh
|
376 |
#if defined (__BEOS__) |
|
7ef7284…
|
drh
|
377 |
# ifdef ZLIB_DLL |
|
7ef7284…
|
drh
|
378 |
# ifdef ZLIB_INTERNAL |
|
7ef7284…
|
drh
|
379 |
# define ZEXPORT __declspec(dllexport) |
|
7ef7284…
|
drh
|
380 |
# define ZEXPORTVA __declspec(dllexport) |
|
7ef7284…
|
drh
|
381 |
# else |
|
7ef7284…
|
drh
|
382 |
# define ZEXPORT __declspec(dllimport) |
|
7ef7284…
|
drh
|
383 |
# define ZEXPORTVA __declspec(dllimport) |
|
7ef7284…
|
drh
|
384 |
# endif |
|
7ef7284…
|
drh
|
385 |
# endif |
|
7ef7284…
|
drh
|
386 |
#endif |
|
7ef7284…
|
drh
|
387 |
|
|
7ef7284…
|
drh
|
388 |
#ifndef ZEXTERN |
|
7ef7284…
|
drh
|
389 |
# define ZEXTERN extern |
|
7ef7284…
|
drh
|
390 |
#endif |
|
7ef7284…
|
drh
|
391 |
#ifndef ZEXPORT |
|
7ef7284…
|
drh
|
392 |
# define ZEXPORT |
|
7ef7284…
|
drh
|
393 |
#endif |
|
7ef7284…
|
drh
|
394 |
#ifndef ZEXPORTVA |
|
7ef7284…
|
drh
|
395 |
# define ZEXPORTVA |
|
7ef7284…
|
drh
|
396 |
#endif |
|
7ef7284…
|
drh
|
397 |
|
|
7ef7284…
|
drh
|
398 |
#ifndef FAR |
|
7ef7284…
|
drh
|
399 |
# define FAR |
|
7ef7284…
|
drh
|
400 |
#endif |
|
7ef7284…
|
drh
|
401 |
|
|
7ef7284…
|
drh
|
402 |
#if !defined(__MACTYPES__) |
|
7ef7284…
|
drh
|
403 |
typedef unsigned char Byte; /* 8 bits */ |
|
7ef7284…
|
drh
|
404 |
#endif |
|
7ef7284…
|
drh
|
405 |
typedef unsigned int uInt; /* 16 bits or more */ |
|
7ef7284…
|
drh
|
406 |
typedef unsigned long uLong; /* 32 bits or more */ |
|
7ef7284…
|
drh
|
407 |
|
|
7ef7284…
|
drh
|
408 |
#ifdef SMALL_MEDIUM |
|
7ef7284…
|
drh
|
409 |
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ |
|
7ef7284…
|
drh
|
410 |
# define Bytef Byte FAR |
|
7ef7284…
|
drh
|
411 |
#else |
|
7ef7284…
|
drh
|
412 |
typedef Byte FAR Bytef; |
|
7ef7284…
|
drh
|
413 |
#endif |
|
7ef7284…
|
drh
|
414 |
typedef char FAR charf; |
|
7ef7284…
|
drh
|
415 |
typedef int FAR intf; |
|
7ef7284…
|
drh
|
416 |
typedef uInt FAR uIntf; |
|
7ef7284…
|
drh
|
417 |
typedef uLong FAR uLongf; |
|
7ef7284…
|
drh
|
418 |
|
|
7ef7284…
|
drh
|
419 |
#ifdef STDC |
|
7ef7284…
|
drh
|
420 |
typedef void const *voidpc; |
|
7ef7284…
|
drh
|
421 |
typedef void FAR *voidpf; |
|
7ef7284…
|
drh
|
422 |
typedef void *voidp; |
|
7ef7284…
|
drh
|
423 |
#else |
|
7ef7284…
|
drh
|
424 |
typedef Byte const *voidpc; |
|
7ef7284…
|
drh
|
425 |
typedef Byte FAR *voidpf; |
|
7ef7284…
|
drh
|
426 |
typedef Byte *voidp; |
|
7ef7284…
|
drh
|
427 |
#endif |
|
7ef7284…
|
drh
|
428 |
|
|
7ef7284…
|
drh
|
429 |
#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) |
|
7ef7284…
|
drh
|
430 |
# include <limits.h> |
|
7ef7284…
|
drh
|
431 |
# if (UINT_MAX == 0xffffffffUL) |
|
7ef7284…
|
drh
|
432 |
# define Z_U4 unsigned |
|
bb4776e…
|
jan.nijtmans
|
433 |
# elif (ULONG_MAX == 0xffffffffUL) |
|
bb4776e…
|
jan.nijtmans
|
434 |
# define Z_U4 unsigned long |
|
bb4776e…
|
jan.nijtmans
|
435 |
# elif (USHRT_MAX == 0xffffffffUL) |
|
bb4776e…
|
jan.nijtmans
|
436 |
# define Z_U4 unsigned short |
|
7ef7284…
|
drh
|
437 |
# endif |
|
7ef7284…
|
drh
|
438 |
#endif |
|
7ef7284…
|
drh
|
439 |
|
|
7ef7284…
|
drh
|
440 |
#ifdef Z_U4 |
|
7ef7284…
|
drh
|
441 |
typedef Z_U4 z_crc_t; |
|
7ef7284…
|
drh
|
442 |
#else |
|
7ef7284…
|
drh
|
443 |
typedef unsigned long z_crc_t; |
|
7ef7284…
|
drh
|
444 |
#endif |
|
7ef7284…
|
drh
|
445 |
|
|
6ea30fb…
|
florian
|
446 |
#if HAVE_UNISTD_H-0 /* may be set to #if 1 by ./configure */ |
|
7ef7284…
|
drh
|
447 |
# define Z_HAVE_UNISTD_H |
|
7ef7284…
|
drh
|
448 |
#endif |
|
7ef7284…
|
drh
|
449 |
|
|
6ea30fb…
|
florian
|
450 |
#if HAVE_STDARG_H-0 /* may be set to #if 1 by ./configure */ |
|
7ef7284…
|
drh
|
451 |
# define Z_HAVE_STDARG_H |
|
7ef7284…
|
drh
|
452 |
#endif |
|
7ef7284…
|
drh
|
453 |
|
|
7ef7284…
|
drh
|
454 |
#ifdef STDC |
|
7ef7284…
|
drh
|
455 |
# ifndef Z_SOLO |
|
7ef7284…
|
drh
|
456 |
# include <sys/types.h> /* for off_t */ |
|
7ef7284…
|
drh
|
457 |
# endif |
|
7ef7284…
|
drh
|
458 |
#endif |
|
7ef7284…
|
drh
|
459 |
|
|
bb4776e…
|
jan.nijtmans
|
460 |
#if defined(STDC) || defined(Z_HAVE_STDARG_H) |
|
bb4776e…
|
jan.nijtmans
|
461 |
# ifndef Z_SOLO |
|
bb4776e…
|
jan.nijtmans
|
462 |
# include <stdarg.h> /* for va_list */ |
|
bb4776e…
|
jan.nijtmans
|
463 |
# endif |
|
bb4776e…
|
jan.nijtmans
|
464 |
#endif |
|
bb4776e…
|
jan.nijtmans
|
465 |
|
|
7ef7284…
|
drh
|
466 |
#ifdef _WIN32 |
|
bb4776e…
|
jan.nijtmans
|
467 |
# ifndef Z_SOLO |
|
bb4776e…
|
jan.nijtmans
|
468 |
# include <stddef.h> /* for wchar_t */ |
|
bb4776e…
|
jan.nijtmans
|
469 |
# endif |
|
7ef7284…
|
drh
|
470 |
#endif |
|
7ef7284…
|
drh
|
471 |
|
|
7ef7284…
|
drh
|
472 |
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and |
|
7ef7284…
|
drh
|
473 |
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even |
|
7ef7284…
|
drh
|
474 |
* though the former does not conform to the LFS document), but considering |
|
7ef7284…
|
drh
|
475 |
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as |
|
7ef7284…
|
drh
|
476 |
* equivalently requesting no 64-bit operations |
|
7ef7284…
|
drh
|
477 |
*/ |
|
bb4776e…
|
jan.nijtmans
|
478 |
#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 |
|
7ef7284…
|
drh
|
479 |
# undef _LARGEFILE64_SOURCE |
|
7ef7284…
|
drh
|
480 |
#endif |
|
7ef7284…
|
drh
|
481 |
|
|
a9e589c…
|
florian
|
482 |
#ifndef Z_HAVE_UNISTD_H |
|
6ea30fb…
|
florian
|
483 |
# if defined(__WATCOMC__) || defined(__GO32__) || \ |
|
6ea30fb…
|
florian
|
484 |
(defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)) |
|
a9e589c…
|
florian
|
485 |
# define Z_HAVE_UNISTD_H |
|
a9e589c…
|
florian
|
486 |
# endif |
|
7ef7284…
|
drh
|
487 |
#endif |
|
7ef7284…
|
drh
|
488 |
#ifndef Z_SOLO |
|
a9e589c…
|
florian
|
489 |
# if defined(Z_HAVE_UNISTD_H) |
|
7ef7284…
|
drh
|
490 |
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ |
|
7ef7284…
|
drh
|
491 |
# ifdef VMS |
|
7ef7284…
|
drh
|
492 |
# include <unixio.h> /* for off_t */ |
|
7ef7284…
|
drh
|
493 |
# endif |
|
7ef7284…
|
drh
|
494 |
# ifndef z_off_t |
|
7ef7284…
|
drh
|
495 |
# define z_off_t off_t |
|
7ef7284…
|
drh
|
496 |
# endif |
|
7ef7284…
|
drh
|
497 |
# endif |
|
7ef7284…
|
drh
|
498 |
#endif |
|
7ef7284…
|
drh
|
499 |
|
|
7ef7284…
|
drh
|
500 |
#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 |
|
7ef7284…
|
drh
|
501 |
# define Z_LFS64 |
|
7ef7284…
|
drh
|
502 |
#endif |
|
7ef7284…
|
drh
|
503 |
|
|
7ef7284…
|
drh
|
504 |
#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) |
|
7ef7284…
|
drh
|
505 |
# define Z_LARGE64 |
|
7ef7284…
|
drh
|
506 |
#endif |
|
7ef7284…
|
drh
|
507 |
|
|
7ef7284…
|
drh
|
508 |
#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) |
|
7ef7284…
|
drh
|
509 |
# define Z_WANT64 |
|
7ef7284…
|
drh
|
510 |
#endif |
|
7ef7284…
|
drh
|
511 |
|
|
7ef7284…
|
drh
|
512 |
#if !defined(SEEK_SET) && !defined(Z_SOLO) |
|
7ef7284…
|
drh
|
513 |
# define SEEK_SET 0 /* Seek from beginning of file. */ |
|
7ef7284…
|
drh
|
514 |
# define SEEK_CUR 1 /* Seek from current position. */ |
|
7ef7284…
|
drh
|
515 |
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ |
|
7ef7284…
|
drh
|
516 |
#endif |
|
7ef7284…
|
drh
|
517 |
|
|
7ef7284…
|
drh
|
518 |
#ifndef z_off_t |
|
6ea30fb…
|
florian
|
519 |
# define z_off_t long long |
|
7ef7284…
|
drh
|
520 |
#endif |
|
7ef7284…
|
drh
|
521 |
|
|
7ef7284…
|
drh
|
522 |
#if !defined(_WIN32) && defined(Z_LARGE64) |
|
7ef7284…
|
drh
|
523 |
# define z_off64_t off64_t |
|
6ea30fb…
|
florian
|
524 |
#elif defined(__MINGW32__) |
|
6ea30fb…
|
florian
|
525 |
# define z_off64_t long long |
|
6ea30fb…
|
florian
|
526 |
#elif defined(_WIN32) && !defined(__GNUC__) |
|
6ea30fb…
|
florian
|
527 |
# define z_off64_t __int64 |
|
6ea30fb…
|
florian
|
528 |
#elif defined(__GO32__) |
|
6ea30fb…
|
florian
|
529 |
# define z_off64_t offset_t |
|
7ef7284…
|
drh
|
530 |
#else |
|
6ea30fb…
|
florian
|
531 |
# define z_off64_t z_off_t |
|
7ef7284…
|
drh
|
532 |
#endif |
|
7ef7284…
|
drh
|
533 |
|
|
7ef7284…
|
drh
|
534 |
/* MVS linker does not support external names larger than 8 bytes */ |
|
7ef7284…
|
drh
|
535 |
#if defined(__MVS__) |
|
7ef7284…
|
drh
|
536 |
#pragma map(deflateInit_,"DEIN") |
|
7ef7284…
|
drh
|
537 |
#pragma map(deflateInit2_,"DEIN2") |
|
7ef7284…
|
drh
|
538 |
#pragma map(deflateEnd,"DEEND") |
|
7ef7284…
|
drh
|
539 |
#pragma map(deflateBound,"DEBND") |
|
7ef7284…
|
drh
|
540 |
#pragma map(inflateInit_,"ININ") |
|
7ef7284…
|
drh
|
541 |
#pragma map(inflateInit2_,"ININ2") |
|
7ef7284…
|
drh
|
542 |
#pragma map(inflateEnd,"INEND") |
|
7ef7284…
|
drh
|
543 |
#pragma map(inflateSync,"INSY") |
|
7ef7284…
|
drh
|
544 |
#pragma map(inflateSetDictionary,"INSEDI") |
|
7ef7284…
|
drh
|
545 |
#pragma map(compressBound,"CMBND") |
|
7ef7284…
|
drh
|
546 |
#pragma map(inflate_table,"INTABL") |
|
7ef7284…
|
drh
|
547 |
#pragma map(inflate_fast,"INFA") |
|
7ef7284…
|
drh
|
548 |
#pragma map(inflate_copyright,"INCOPY") |
|
7ef7284…
|
drh
|
549 |
#endif |
|
7ef7284…
|
drh
|
550 |
|
|
7ef7284…
|
drh
|
551 |
#endif /* ZCONF_H */ |