sl@0
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// This file contains the C interface for all the APIs provided by the
|
sl@0
|
15 |
// compression Library on Symbian. The actual functionlaity of all the
|
sl@0
|
16 |
// API's are divided over two different libraries, libzcore.dll and libz.dll
|
sl@0
|
17 |
// All the API's are exported from this library and will be the only interface
|
sl@0
|
18 |
// for the user of compression library
|
sl@0
|
19 |
//
|
sl@0
|
20 |
//
|
sl@0
|
21 |
|
sl@0
|
22 |
#ifndef SYMBIAN_EZLIB_EXCLUDE_GZ_FUNCTIONS
|
sl@0
|
23 |
#include "libzgzio.h"
|
sl@0
|
24 |
#endif
|
sl@0
|
25 |
|
sl@0
|
26 |
#include "libzcore.h"
|
sl@0
|
27 |
|
sl@0
|
28 |
|
sl@0
|
29 |
//=================================================================
|
sl@0
|
30 |
|
sl@0
|
31 |
EXPORT_C uLong adler32(uLong adler,const Bytef * buf,uInt len)
|
sl@0
|
32 |
{
|
sl@0
|
33 |
return(adler32_r(adler, buf, len));
|
sl@0
|
34 |
}
|
sl@0
|
35 |
|
sl@0
|
36 |
//=================================================================
|
sl@0
|
37 |
|
sl@0
|
38 |
EXPORT_C int compress (Bytef * dest, uLongf * destLen,
|
sl@0
|
39 |
const Bytef * source, uLong sourceLen)
|
sl@0
|
40 |
{
|
sl@0
|
41 |
return (compress_r(dest, destLen, source, sourceLen));
|
sl@0
|
42 |
}
|
sl@0
|
43 |
|
sl@0
|
44 |
//=================================================================
|
sl@0
|
45 |
|
sl@0
|
46 |
EXPORT_C int compress2 (Bytef * dest, uLongf * destLen,
|
sl@0
|
47 |
const Bytef * source,uLong sourceLen, int level)
|
sl@0
|
48 |
{
|
sl@0
|
49 |
return (compress2_r(dest, destLen, source, sourceLen, level));
|
sl@0
|
50 |
}
|
sl@0
|
51 |
|
sl@0
|
52 |
//=================================================================
|
sl@0
|
53 |
EXPORT_C uLong compressBound (uLong sourceLen)
|
sl@0
|
54 |
{
|
sl@0
|
55 |
return(compressBound_r(sourceLen));
|
sl@0
|
56 |
}
|
sl@0
|
57 |
|
sl@0
|
58 |
//=================================================================
|
sl@0
|
59 |
EXPORT_C unsigned long crc32( unsigned long crc,
|
sl@0
|
60 |
const unsigned char FAR * buf, unsigned len)
|
sl@0
|
61 |
{
|
sl@0
|
62 |
return (crc32_r(crc, buf, len));
|
sl@0
|
63 |
}
|
sl@0
|
64 |
|
sl@0
|
65 |
//=================================================================
|
sl@0
|
66 |
EXPORT_C int deflate (z_streamp strm, int flush)
|
sl@0
|
67 |
{
|
sl@0
|
68 |
return(deflate_r(strm, flush));
|
sl@0
|
69 |
}
|
sl@0
|
70 |
|
sl@0
|
71 |
//=================================================================
|
sl@0
|
72 |
EXPORT_C uLong deflateBound(z_streamp strm, uLong sourceLen)
|
sl@0
|
73 |
{
|
sl@0
|
74 |
return (deflateBound_r(strm, sourceLen));
|
sl@0
|
75 |
}
|
sl@0
|
76 |
|
sl@0
|
77 |
//=================================================================
|
sl@0
|
78 |
EXPORT_C int deflateCopy (z_streamp dest, z_streamp source)
|
sl@0
|
79 |
{
|
sl@0
|
80 |
return (deflateCopy_r(dest, source));
|
sl@0
|
81 |
}
|
sl@0
|
82 |
|
sl@0
|
83 |
//=================================================================
|
sl@0
|
84 |
EXPORT_C int deflateEnd (z_streamp strm)
|
sl@0
|
85 |
{
|
sl@0
|
86 |
return (deflateEnd_r(strm));
|
sl@0
|
87 |
}
|
sl@0
|
88 |
|
sl@0
|
89 |
//=================================================================
|
sl@0
|
90 |
EXPORT_C int deflateInit2_(z_streamp strm, int level, int method,
|
sl@0
|
91 |
int windowBits, int memLevel, int strategy,
|
sl@0
|
92 |
const char * version, int stream_size)
|
sl@0
|
93 |
{
|
sl@0
|
94 |
return (deflateInit2__r(strm, level, method, windowBits, memLevel, strategy, version, stream_size));
|
sl@0
|
95 |
}
|
sl@0
|
96 |
|
sl@0
|
97 |
//=================================================================
|
sl@0
|
98 |
EXPORT_C int deflateInit_( z_streamp strm, int level,
|
sl@0
|
99 |
const char * version, int stream_size)
|
sl@0
|
100 |
{
|
sl@0
|
101 |
return(deflateInit__r(strm, level, version,stream_size));
|
sl@0
|
102 |
}
|
sl@0
|
103 |
|
sl@0
|
104 |
//=================================================================
|
sl@0
|
105 |
EXPORT_C int deflateParams(z_streamp strm, int level, int strategy)
|
sl@0
|
106 |
{
|
sl@0
|
107 |
return (deflateParams_r(strm, level, strategy));
|
sl@0
|
108 |
}
|
sl@0
|
109 |
|
sl@0
|
110 |
//=================================================================
|
sl@0
|
111 |
EXPORT_C int deflateReset (z_streamp strm)
|
sl@0
|
112 |
{
|
sl@0
|
113 |
return (deflateReset_r(strm));
|
sl@0
|
114 |
}
|
sl@0
|
115 |
|
sl@0
|
116 |
//=================================================================
|
sl@0
|
117 |
EXPORT_C int deflateSetDictionary (z_streamp strm, const Bytef * dictionary,uInt dictLength)
|
sl@0
|
118 |
{
|
sl@0
|
119 |
return (deflateSetDictionary_r(strm, dictionary, dictLength ));
|
sl@0
|
120 |
}
|
sl@0
|
121 |
|
sl@0
|
122 |
|
sl@0
|
123 |
//=================================================================
|
sl@0
|
124 |
EXPORT_C const unsigned long FAR * get_crc_table()
|
sl@0
|
125 |
{
|
sl@0
|
126 |
return (get_crc_table_r());
|
sl@0
|
127 |
}
|
sl@0
|
128 |
#ifndef SYMBIAN_EZLIB_EXCLUDE_GZ_FUNCTIONS
|
sl@0
|
129 |
//=================================================================
|
sl@0
|
130 |
EXPORT_C int gzclose (gzFile file)
|
sl@0
|
131 |
{
|
sl@0
|
132 |
return (gzclose_r(file));
|
sl@0
|
133 |
}
|
sl@0
|
134 |
|
sl@0
|
135 |
//=================================================================
|
sl@0
|
136 |
EXPORT_C void gzclearerr (gzFile file)
|
sl@0
|
137 |
{
|
sl@0
|
138 |
gzclearerr_r(file);
|
sl@0
|
139 |
return;
|
sl@0
|
140 |
}
|
sl@0
|
141 |
|
sl@0
|
142 |
//=================================================================
|
sl@0
|
143 |
EXPORT_C gzFile gzdopen (int fd, const char * mode)
|
sl@0
|
144 |
{
|
sl@0
|
145 |
return (gzdopen_r(fd, mode));
|
sl@0
|
146 |
}
|
sl@0
|
147 |
|
sl@0
|
148 |
//=================================================================
|
sl@0
|
149 |
EXPORT_C int gzdirect (gzFile file)
|
sl@0
|
150 |
{
|
sl@0
|
151 |
return ( gzdirect_r(file) );
|
sl@0
|
152 |
}
|
sl@0
|
153 |
|
sl@0
|
154 |
//=================================================================
|
sl@0
|
155 |
EXPORT_C int gzeof (gzFile file)
|
sl@0
|
156 |
{
|
sl@0
|
157 |
return (gzeof_r(file));
|
sl@0
|
158 |
}
|
sl@0
|
159 |
|
sl@0
|
160 |
//=================================================================
|
sl@0
|
161 |
EXPORT_C const char * gzerror (gzFile file, int * errnum)
|
sl@0
|
162 |
{
|
sl@0
|
163 |
return (gzerror_r(file, errnum));
|
sl@0
|
164 |
}
|
sl@0
|
165 |
|
sl@0
|
166 |
//=================================================================
|
sl@0
|
167 |
EXPORT_C int gzflush (gzFile file,int flush)
|
sl@0
|
168 |
{
|
sl@0
|
169 |
return ( gzflush_r(file, flush) );
|
sl@0
|
170 |
}
|
sl@0
|
171 |
|
sl@0
|
172 |
//=================================================================
|
sl@0
|
173 |
EXPORT_C int gzgetc(gzFile file)
|
sl@0
|
174 |
{
|
sl@0
|
175 |
return ( gzgetc_r(file) );
|
sl@0
|
176 |
}
|
sl@0
|
177 |
|
sl@0
|
178 |
//=================================================================
|
sl@0
|
179 |
EXPORT_C char * gzgets(gzFile file, char * buf, int len)
|
sl@0
|
180 |
{
|
sl@0
|
181 |
return ( gzgets_r(file, buf, len) );
|
sl@0
|
182 |
}
|
sl@0
|
183 |
|
sl@0
|
184 |
//=================================================================
|
sl@0
|
185 |
EXPORT_C gzFile gzopen (const char * path, const char * mode)
|
sl@0
|
186 |
{
|
sl@0
|
187 |
return ( gzopen_r (path, mode) );
|
sl@0
|
188 |
}
|
sl@0
|
189 |
|
sl@0
|
190 |
|
sl@0
|
191 |
//=================================================================
|
sl@0
|
192 |
EXPORT_C int gzprintf (gzFile file, const char *format, /*args*/ ...)
|
sl@0
|
193 |
{
|
sl@0
|
194 |
va_list va;
|
sl@0
|
195 |
va_start(va, format);
|
sl@0
|
196 |
return (gzprintf_r(file, format , va));
|
sl@0
|
197 |
}
|
sl@0
|
198 |
|
sl@0
|
199 |
|
sl@0
|
200 |
//=================================================================
|
sl@0
|
201 |
EXPORT_C int gzputc(gzFile file, int c)
|
sl@0
|
202 |
{
|
sl@0
|
203 |
return ( gzputc_r (file, c) );
|
sl@0
|
204 |
}
|
sl@0
|
205 |
|
sl@0
|
206 |
//=================================================================
|
sl@0
|
207 |
EXPORT_C int gzputs(gzFile file, const char * s)
|
sl@0
|
208 |
{
|
sl@0
|
209 |
return (gzputs_r(file, s) );
|
sl@0
|
210 |
}
|
sl@0
|
211 |
|
sl@0
|
212 |
//=================================================================
|
sl@0
|
213 |
EXPORT_C int gzread (gzFile file, voidp buf,unsigned len)
|
sl@0
|
214 |
{
|
sl@0
|
215 |
return ( gzread_r(file, buf, len) );
|
sl@0
|
216 |
}
|
sl@0
|
217 |
|
sl@0
|
218 |
//=================================================================
|
sl@0
|
219 |
EXPORT_C int gzrewind (gzFile file)
|
sl@0
|
220 |
{
|
sl@0
|
221 |
return ( gzrewind_r(file) );
|
sl@0
|
222 |
}
|
sl@0
|
223 |
|
sl@0
|
224 |
//=================================================================
|
sl@0
|
225 |
EXPORT_C z_off_t gzseek (gzFile file, z_off_t offset, int whence)
|
sl@0
|
226 |
{
|
sl@0
|
227 |
return (gzseek_r (file, offset, whence) );
|
sl@0
|
228 |
}
|
sl@0
|
229 |
|
sl@0
|
230 |
//=================================================================
|
sl@0
|
231 |
EXPORT_C int gzsetparams (gzFile file, int level, int strategy)
|
sl@0
|
232 |
{
|
sl@0
|
233 |
return ( gzsetparams_r (file, level, strategy ) );
|
sl@0
|
234 |
}
|
sl@0
|
235 |
|
sl@0
|
236 |
//=================================================================
|
sl@0
|
237 |
EXPORT_C z_off_t gztell (gzFile file)
|
sl@0
|
238 |
{
|
sl@0
|
239 |
return ( gztell_r(file) );
|
sl@0
|
240 |
}
|
sl@0
|
241 |
|
sl@0
|
242 |
//=================================================================
|
sl@0
|
243 |
EXPORT_C int gzungetc (int c, gzFile file)
|
sl@0
|
244 |
{
|
sl@0
|
245 |
return (gzungetc_r (c, file) );
|
sl@0
|
246 |
}
|
sl@0
|
247 |
|
sl@0
|
248 |
//=================================================================
|
sl@0
|
249 |
EXPORT_C int gzwrite (gzFile file,voidpc buf, unsigned len)
|
sl@0
|
250 |
{
|
sl@0
|
251 |
return ( gzwrite_r (file , buf, len) );
|
sl@0
|
252 |
}
|
sl@0
|
253 |
#endif //end SYMBIAN_EZLIB_EXCLUDE_GZ_FUNCTIONS
|
sl@0
|
254 |
|
sl@0
|
255 |
//=================================================================
|
sl@0
|
256 |
EXPORT_C int inflate(z_streamp strm,int flush)
|
sl@0
|
257 |
{
|
sl@0
|
258 |
return ( inflate_r(strm, flush) );
|
sl@0
|
259 |
}
|
sl@0
|
260 |
|
sl@0
|
261 |
//=================================================================
|
sl@0
|
262 |
EXPORT_C int inflateEnd(z_streamp strm)
|
sl@0
|
263 |
{
|
sl@0
|
264 |
return ( inflateEnd_r(strm) );
|
sl@0
|
265 |
}
|
sl@0
|
266 |
|
sl@0
|
267 |
//=================================================================
|
sl@0
|
268 |
EXPORT_C int inflateInit2_(z_streamp strm, int windowBits,
|
sl@0
|
269 |
const char * version, int stream_size)
|
sl@0
|
270 |
{
|
sl@0
|
271 |
return (inflateInit2__r(strm, windowBits, version, stream_size ));
|
sl@0
|
272 |
}
|
sl@0
|
273 |
|
sl@0
|
274 |
//=================================================================
|
sl@0
|
275 |
EXPORT_C int inflateInit_(z_streamp strm, const char * version,
|
sl@0
|
276 |
int stream_size)
|
sl@0
|
277 |
{
|
sl@0
|
278 |
return ( inflateInit__r(strm, version, stream_size) );
|
sl@0
|
279 |
}
|
sl@0
|
280 |
|
sl@0
|
281 |
//=================================================================
|
sl@0
|
282 |
EXPORT_C int inflateReset(z_streamp strm)
|
sl@0
|
283 |
{
|
sl@0
|
284 |
return ( inflateReset_r(strm) );
|
sl@0
|
285 |
}
|
sl@0
|
286 |
|
sl@0
|
287 |
//=================================================================
|
sl@0
|
288 |
EXPORT_C int inflateSetDictionary(z_streamp strm,
|
sl@0
|
289 |
const Bytef * dictionary, uInt dictLength)
|
sl@0
|
290 |
{
|
sl@0
|
291 |
return(inflateSetDictionary_r(strm, dictionary, dictLength));
|
sl@0
|
292 |
}
|
sl@0
|
293 |
|
sl@0
|
294 |
//=================================================================
|
sl@0
|
295 |
EXPORT_C int inflateSync(z_streamp strm)
|
sl@0
|
296 |
{
|
sl@0
|
297 |
return ( inflateSync_r(strm) );
|
sl@0
|
298 |
}
|
sl@0
|
299 |
|
sl@0
|
300 |
//=================================================================
|
sl@0
|
301 |
EXPORT_C int inflateSyncPoint(z_streamp strm)
|
sl@0
|
302 |
{
|
sl@0
|
303 |
return ( inflateSyncPoint_r(strm) );
|
sl@0
|
304 |
}
|
sl@0
|
305 |
|
sl@0
|
306 |
//=================================================================
|
sl@0
|
307 |
EXPORT_C int uncompress (Bytef * dest,uLongf * destLen,
|
sl@0
|
308 |
const Bytef * source, uLong sourceLen)
|
sl@0
|
309 |
{
|
sl@0
|
310 |
return ( uncompress_r(dest, destLen, source, sourceLen) );
|
sl@0
|
311 |
}
|
sl@0
|
312 |
|
sl@0
|
313 |
//=================================================================
|
sl@0
|
314 |
EXPORT_C const char * zlibVersion()
|
sl@0
|
315 |
{
|
sl@0
|
316 |
return ( zlibVersion_r() );
|
sl@0
|
317 |
}
|
sl@0
|
318 |
|
sl@0
|
319 |
//=================================================================
|
sl@0
|
320 |
EXPORT_C const char * zError(int err)
|
sl@0
|
321 |
{
|
sl@0
|
322 |
return ( zError_r(err) );
|
sl@0
|
323 |
}
|
sl@0
|
324 |
|
sl@0
|
325 |
//=================================================================
|
sl@0
|
326 |
EXPORT_C uLong adler32_combine(uLong adler1, uLong adler2, z_off_t len2)
|
sl@0
|
327 |
{
|
sl@0
|
328 |
return ( adler32_combine_r (adler1, adler2, len2) );
|
sl@0
|
329 |
}
|
sl@0
|
330 |
|
sl@0
|
331 |
//=================================================================
|
sl@0
|
332 |
EXPORT_C uLong crc32_combine (uLong crc1, uLong crc2, z_off_t len2)
|
sl@0
|
333 |
{
|
sl@0
|
334 |
return ( crc32_combine_r (crc1, crc2, len2) );
|
sl@0
|
335 |
}
|
sl@0
|
336 |
|
sl@0
|
337 |
//=================================================================
|
sl@0
|
338 |
EXPORT_C uLong zlibCompileFlags ()
|
sl@0
|
339 |
{
|
sl@0
|
340 |
return ( zlibCompileFlags_r () );
|
sl@0
|
341 |
}
|
sl@0
|
342 |
|
sl@0
|
343 |
//=================================================================
|
sl@0
|
344 |
EXPORT_C int deflateSetHeader (z_streamp strm, gz_headerp head)
|
sl@0
|
345 |
{
|
sl@0
|
346 |
return ( deflateSetHeader_r (strm, head) );
|
sl@0
|
347 |
}
|
sl@0
|
348 |
|
sl@0
|
349 |
//=================================================================
|
sl@0
|
350 |
EXPORT_C int deflatePrime (z_streamp strm, int bits, int value)
|
sl@0
|
351 |
{
|
sl@0
|
352 |
return ( deflatePrime_r (strm, bits, value) );
|
sl@0
|
353 |
}
|
sl@0
|
354 |
|
sl@0
|
355 |
//=================================================================
|
sl@0
|
356 |
EXPORT_C int deflateTune (z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain)
|
sl@0
|
357 |
{
|
sl@0
|
358 |
return ( deflateTune_r (strm, good_length, max_lazy, nice_length, max_chain) );
|
sl@0
|
359 |
}
|
sl@0
|
360 |
|
sl@0
|
361 |
//=================================================================
|
sl@0
|
362 |
EXPORT_C int inflateCopy (z_streamp dest, z_streamp source)
|
sl@0
|
363 |
{
|
sl@0
|
364 |
return ( inflateCopy_r (dest, source) );
|
sl@0
|
365 |
}
|
sl@0
|
366 |
|
sl@0
|
367 |
//=================================================================
|
sl@0
|
368 |
EXPORT_C int inflatePrime (z_streamp strm, int bits, int value)
|
sl@0
|
369 |
{
|
sl@0
|
370 |
return ( inflatePrime_r (strm, bits, value) );
|
sl@0
|
371 |
}
|
sl@0
|
372 |
|
sl@0
|
373 |
//=================================================================
|
sl@0
|
374 |
EXPORT_C int inflateGetHeader (z_streamp strm, gz_headerp head)
|
sl@0
|
375 |
{
|
sl@0
|
376 |
return ( inflateGetHeader_r (strm, head) );
|
sl@0
|
377 |
}
|
sl@0
|
378 |
|
sl@0
|
379 |
//=================================================================
|
sl@0
|
380 |
EXPORT_C int inflateBackInit_ (z_streamp strm, int windowBits, unsigned char FAR *window,
|
sl@0
|
381 |
const char *version,
|
sl@0
|
382 |
int stream_size)
|
sl@0
|
383 |
{
|
sl@0
|
384 |
return ( inflateBackInit__r (strm, windowBits, window, version, stream_size) );
|
sl@0
|
385 |
}
|
sl@0
|
386 |
|
sl@0
|
387 |
//=================================================================
|
sl@0
|
388 |
EXPORT_C int inflateBack (z_streamp strm, in_func in, void FAR *in_desc,
|
sl@0
|
389 |
out_func out, void FAR *out_desc)
|
sl@0
|
390 |
{
|
sl@0
|
391 |
return ( inflateBack_r (strm, in, in_desc,out, out_desc) );
|
sl@0
|
392 |
}
|
sl@0
|
393 |
|
sl@0
|
394 |
|
sl@0
|
395 |
//=================================================================
|
sl@0
|
396 |
EXPORT_C int inflateBackEnd (z_streamp strm)
|
sl@0
|
397 |
{
|
sl@0
|
398 |
return ( inflateBackEnd_r (strm) );
|
sl@0
|
399 |
}
|