00001 /*-------------------------------------------------------------------- 00002 © Portions copyright (c) 2005-06 Nokia Corporation. All rights reserved. 00003 *--------------------------------------------------------------------*/ 00004 /* zlib.h -- interface of the 'zlib' general purpose compression library 00005 version 1.2.3, July 18th, 2005 00006 00007 Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler 00008 00009 This software is provided 'as-is', without any express or implied 00010 warranty. In no event will the authors be held liable for any damages 00011 arising from the use of this software. 00012 00013 Permission is granted to anyone to use this software for any purpose, 00014 including commercial applications, and to alter it and redistribute it 00015 freely, subject to the following restrictions: 00016 00017 1. The origin of this software must not be misrepresented; you must not 00018 claim that you wrote the original software. If you use this software 00019 in a product, an acknowledgment in the product documentation would be 00020 appreciated but is not required. 00021 2. Altered source versions must be plainly marked as such, and must not be 00022 misrepresented as being the original software. 00023 3. This notice may not be removed or altered from any source distribution. 00024 00025 Jean-loup Gailly Mark Adler 00026 [email protected] [email protected] 00027 00028 00029 The data format used by the zlib library is described by RFCs (Request for 00030 Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt 00031 (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). 00032 */ 00033 00034 #ifndef ZLIB_H 00035 #define ZLIB_H 00036 00037 #include <zconf.h> 00038 #ifdef __SYMBIAN32__ 00039 #include <_ansi.h> 00040 #endif 00041 #ifdef __cplusplus 00042 extern "C" { 00043 #endif 00044 00045 #define ZLIB_VERSION "1.2.3" 00046 #define ZLIB_VERNUM 0x1230 00047 00048 /* 00049 The 'zlib' compression library provides in-memory compression and 00050 decompression functions, including integrity checks of the uncompressed 00051 data. This version of the library supports only one compression method 00052 (deflation) but other algorithms will be added later and will have the same 00053 stream interface. 00054 00055 Compression can be done in a single step if the buffers are large 00056 enough (for example if an input file is mmap'ed), or can be done by 00057 repeated calls of the compression function. In the latter case, the 00058 application must provide more input and/or consume the output 00059 (providing more output space) before each call. 00060 00061 The compressed data format used by default by the in-memory functions is 00062 the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped 00063 around a deflate stream, which is itself documented in RFC 1951. 00064 00065 The library also supports reading and writing files in gzip (.gz) format 00066 with an interface similar to that of stdio using the functions that start 00067 with "gz". The gzip format is different from the zlib format. gzip is a 00068 gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. 00069 00070 This library can optionally read and write gzip streams in memory as well. 00071 00072 The zlib format was designed to be compact and fast for use in memory 00073 and on communications channels. The gzip format was designed for single- 00074 file compression on file systems, has a larger header than zlib to maintain 00075 directory information, and uses a different, slower check method than zlib. 00076 00077 The library does not install any signal handler. The decoder checks 00078 the consistency of the compressed data, so the library should never 00079 crash even in case of corrupted input. 00080 */ 00081 00082 typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); 00083 typedef void (*free_func) OF((voidpf opaque, voidpf address)); 00084 00085 struct internal_state; 00086 00087 typedef struct z_stream_s { 00088 Bytef *next_in; /* next input byte */ 00089 uInt avail_in; /* number of bytes available at next_in */ 00090 uLong total_in; /* total nb of input bytes read so far */ 00091 00092 Bytef *next_out; /* next output byte should be put there */ 00093 uInt avail_out; /* remaining free space at next_out */ 00094 uLong total_out; /* total nb of bytes output so far */ 00095 00096 char *msg; /* last error message, NULL if no error */ 00097 struct internal_state FAR *state; /* not visible by applications */ 00098 00099 alloc_func zalloc; /* used to allocate the internal state */ 00100 free_func zfree; /* used to free the internal state */ 00101 voidpf opaque; /* private data object passed to zalloc and zfree */ 00102 00103 int data_type; /* best guess about the data type: binary or text */ 00104 uLong adler; /* adler32 value of the uncompressed data */ 00105 uLong reserved; /* reserved for future use */ 00106 } z_stream; 00107 00108 typedef z_stream FAR *z_streamp; 00109 00110 /* 00111 gzip header information passed to and from zlib routines. See RFC 1952 00112 for more details on the meanings of these fields. 00113 */ 00114 typedef struct gz_header_s { 00115 int text; /* true if compressed data believed to be text */ 00116 uLong time; /* modification time */ 00117 int xflags; /* extra flags (not used when writing a gzip file) */ 00118 int os; /* operating system */ 00119 Bytef *extra; /* pointer to extra field or Z_NULL if none */ 00120 uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ 00121 uInt extra_max; /* space at extra (only when reading header) */ 00122 Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ 00123 uInt name_max; /* space at name (only when reading header) */ 00124 Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ 00125 uInt comm_max; /* space at comment (only when reading header) */ 00126 int hcrc; /* true if there was or will be a header crc */ 00127 int done; /* true when done reading gzip header (not used 00128 when writing a gzip file) */ 00129 } gz_header; 00130 00131 typedef gz_header FAR *gz_headerp; 00132 00133 /* 00134 The application must update next_in and avail_in when avail_in has 00135 dropped to zero. It must update next_out and avail_out when avail_out 00136 has dropped to zero. The application must initialize zalloc, zfree and 00137 opaque before calling the init function. All other fields are set by the 00138 compression library and must not be updated by the application. 00139 00140 The opaque value provided by the application will be passed as the first 00141 parameter for calls of zalloc and zfree. This can be useful for custom 00142 memory management. The compression library attaches no meaning to the 00143 opaque value. 00144 00145 zalloc must return Z_NULL if there is not enough memory for the object. 00146 If zlib is used in a multi-threaded application, zalloc and zfree must be 00147 thread safe. 00148 00149 On 16-bit systems, the functions zalloc and zfree must be able to allocate 00150 exactly 65536 bytes, but will not be required to allocate more than this 00151 if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, 00152 pointers returned by zalloc for objects of exactly 65536 bytes *must* 00153 have their offset normalized to zero. The default allocation function 00154 provided by this library ensures this (see zutil.c). To reduce memory 00155 requirements and avoid any allocation of 64K objects, at the expense of 00156 compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). 00157 00158 The fields total_in and total_out can be used for statistics or 00159 progress reports. After compression, total_in holds the total size of 00160 the uncompressed data and may be saved for use in the decompressor 00161 (particularly if the decompressor wants to decompress everything in 00162 a single step). 00163 */ 00164 00165 /* constants */ 00166 00167 #define Z_NO_FLUSH 0 00168 #define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ 00169 #define Z_SYNC_FLUSH 2 00170 #define Z_FULL_FLUSH 3 00171 #define Z_FINISH 4 00172 #define Z_BLOCK 5 00173 /* Allowed flush values; see deflate() and inflate() below for details */ 00174 00175 #define Z_OK 0 00176 #define Z_STREAM_END 1 00177 #define Z_NEED_DICT 2 00178 #define Z_ERRNO (-1) 00179 #define Z_STREAM_ERROR (-2) 00180 #define Z_DATA_ERROR (-3) 00181 #define Z_MEM_ERROR (-4) 00182 #define Z_BUF_ERROR (-5) 00183 #define Z_VERSION_ERROR (-6) 00184 /* Return codes for the compression/decompression functions. Negative 00185 * values are errors, positive values are used for special but normal events. 00186 */ 00187 00188 #define Z_NO_COMPRESSION 0 00189 #define Z_BEST_SPEED 1 00190 #define Z_BEST_COMPRESSION 9 00191 #define Z_DEFAULT_COMPRESSION (-1) 00192 /* compression levels */ 00193 00194 #define Z_FILTERED 1 00195 #define Z_HUFFMAN_ONLY 2 00196 #define Z_RLE 3 00197 #define Z_FIXED 4 00198 #define Z_DEFAULT_STRATEGY 0 00199 /* compression strategy; see deflateInit2() below for details */ 00200 00201 #define Z_BINARY 0 00202 #define Z_TEXT 1 00203 #define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ 00204 #define Z_UNKNOWN 2 00205 /* Possible values of the data_type field (though see inflate()) */ 00206 00207 #define Z_DEFLATED 8 00208 /* The deflate compression method (the only one supported in this version) */ 00209 00210 #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ 00211 00212 #define zlib_version zlibVersion() 00213 /* for compatibility with versions < 1.0.2 */ 00214 00215 /* basic functions */ 00216 #ifdef __SYMBIAN32__ 00217 IMPORT_C const char * zlibVersion OF((void)); 00218 #else 00219 ZEXTERN const char * ZEXPORT zlibVersion OF((void)); 00220 //__SYMBIAN32__ 00221 #endif 00222 00223 /* The application can compare zlibVersion and ZLIB_VERSION for consistency. 00224 If the first character differs, the library code actually used is 00225 not compatible with the zlib.h header file used by the application. 00226 This check is automatically made by deflateInit and inflateInit. 00227 */ 00228 00229 00230 00231 #ifdef __SYMBIAN32__ 00232 IMPORT_C int deflate OF((z_streamp strm, int flush)); 00233 #else 00234 ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); 00235 //__SYMBIAN32__ 00236 #endif 00237 00238 /* 00239 deflate compresses as much data as possible, and stops when the input 00240 buffer becomes empty or the output buffer becomes full. It may introduce some 00241 output latency (reading input without producing any output) except when 00242 forced to flush. 00243 00244 The detailed semantics are as follows. deflate performs one or both of the 00245 following actions: 00246 00247 - Compress more input starting at next_in and update next_in and avail_in 00248 accordingly. If not all input can be processed (because there is not 00249 enough room in the output buffer), next_in and avail_in are updated and 00250 processing will resume at this point for the next call of deflate(). 00251 00252 - Provide more output starting at next_out and update next_out and avail_out 00253 accordingly. This action is forced if the parameter flush is non zero. 00254 Forcing flush frequently degrades the compression ratio, so this parameter 00255 should be set only when necessary (in interactive applications). 00256 Some output may be provided even if flush is not set. 00257 00258 Before the call of deflate(), the application should ensure that at least 00259 one of the actions is possible, by providing more input and/or consuming 00260 more output, and updating avail_in or avail_out accordingly; avail_out 00261 should never be zero before the call. The application can consume the 00262 compressed output when it wants, for example when the output buffer is full 00263 (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK 00264 and with zero avail_out, it must be called again after making room in the 00265 output buffer because there might be more output pending. 00266 00267 Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to 00268 decide how much data to accumualte before producing output, in order to 00269 maximize compression. 00270 00271 If the parameter flush is set to Z_SYNC_FLUSH, all pending output is 00272 flushed to the output buffer and the output is aligned on a byte boundary, so 00273 that the decompressor can get all input data available so far. (In particular 00274 avail_in is zero after the call if enough output space has been provided 00275 before the call.) Flushing may degrade compression for some compression 00276 algorithms and so it should be used only when necessary. 00277 00278 If flush is set to Z_FULL_FLUSH, all output is flushed as with 00279 Z_SYNC_FLUSH, and the compression state is reset so that decompression can 00280 restart from this point if previous compressed data has been damaged or if 00281 random access is desired. Using Z_FULL_FLUSH too often can seriously degrade 00282 compression. 00283 00284 If deflate returns with avail_out == 0, this function must be called again 00285 with the same value of the flush parameter and more output space (updated 00286 avail_out), until the flush is complete (deflate returns with non-zero 00287 avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that 00288 avail_out is greater than six to avoid repeated flush markers due to 00289 avail_out == 0 on return. 00290 00291 If the parameter flush is set to Z_FINISH, pending input is processed, 00292 pending output is flushed and deflate returns with Z_STREAM_END if there 00293 was enough output space; if deflate returns with Z_OK, this function must be 00294 called again with Z_FINISH and more output space (updated avail_out) but no 00295 more input data, until it returns with Z_STREAM_END or an error. After 00296 deflate has returned Z_STREAM_END, the only possible operations on the 00297 stream are deflateReset or deflateEnd. 00298 00299 Z_FINISH can be used immediately after deflateInit if all the compression 00300 is to be done in a single step. In this case, avail_out must be at least 00301 the value returned by deflateBound (see below). If deflate does not return 00302 Z_STREAM_END, then it must be called again as described above. 00303 00304 deflate() sets strm->adler to the adler32 checksum of all input read 00305 so far (that is, total_in bytes). 00306 00307 deflate() may update strm->data_type if it can make a good guess about 00308 the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered 00309 binary. This field is only for information purposes and does not affect 00310 the compression algorithm in any manner. 00311 00312 deflate() returns Z_OK if some progress has been made (more input 00313 processed or more output produced), Z_STREAM_END if all input has been 00314 consumed and all output has been produced (only when flush is set to 00315 Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example 00316 if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible 00317 (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not 00318 fatal, and deflate() can be called again with more input and more output 00319 space to continue compressing. 00320 */ 00321 00322 #ifdef __SYMBIAN32__ 00323 IMPORT_C int deflateEnd OF((z_streamp strm)); 00324 #else 00325 ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); 00326 //__SYMBIAN32__ 00327 #endif 00328 00329 /* 00330 All dynamically allocated data structures for this stream are freed. 00331 This function discards any unprocessed input and does not flush any 00332 pending output. 00333 00334 deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the 00335 stream state was inconsistent, Z_DATA_ERROR if the stream was freed 00336 prematurely (some input or output was discarded). In the error case, 00337 msg may be set but then points to a static string (which must not be 00338 deallocated). 00339 */ 00340 00341 00342 00343 00344 #ifdef __SYMBIAN32__ 00345 IMPORT_C int inflate OF((z_streamp strm, int flush)); 00346 #else 00347 ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); 00348 //__SYMBIAN32__ 00349 #endif 00350 00351 /* 00352 inflate decompresses as much data as possible, and stops when the input 00353 buffer becomes empty or the output buffer becomes full. It may introduce 00354 some output latency (reading input without producing any output) except when 00355 forced to flush. 00356 00357 The detailed semantics are as follows. inflate performs one or both of the 00358 following actions: 00359 00360 - Decompress more input starting at next_in and update next_in and avail_in 00361 accordingly. If not all input can be processed (because there is not 00362 enough room in the output buffer), next_in is updated and processing 00363 will resume at this point for the next call of inflate(). 00364 00365 - Provide more output starting at next_out and update next_out and avail_out 00366 accordingly. inflate() provides as much output as possible, until there 00367 is no more input data or no more space in the output buffer (see below 00368 about the flush parameter). 00369 00370 Before the call of inflate(), the application should ensure that at least 00371 one of the actions is possible, by providing more input and/or consuming 00372 more output, and updating the next_* and avail_* values accordingly. 00373 The application can consume the uncompressed output when it wants, for 00374 example when the output buffer is full (avail_out == 0), or after each 00375 call of inflate(). If inflate returns Z_OK and with zero avail_out, it 00376 must be called again after making room in the output buffer because there 00377 might be more output pending. 00378 00379 The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, 00380 Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much 00381 output as possible to the output buffer. Z_BLOCK requests that inflate() stop 00382 if and when it gets to the next deflate block boundary. When decoding the 00383 zlib or gzip format, this will cause inflate() to return immediately after 00384 the header and before the first block. When doing a raw inflate, inflate() 00385 will go ahead and process the first block, and will return when it gets to 00386 the end of that block, or when it runs out of data. 00387 00388 The Z_BLOCK option assists in appending to or combining deflate streams. 00389 Also to assist in this, on return inflate() will set strm->data_type to the 00390 number of unused bits in the last byte taken from strm->next_in, plus 64 00391 if inflate() is currently decoding the last block in the deflate stream, 00392 plus 128 if inflate() returned immediately after decoding an end-of-block 00393 code or decoding the complete header up to just before the first byte of the 00394 deflate stream. The end-of-block will not be indicated until all of the 00395 uncompressed data from that block has been written to strm->next_out. The 00396 number of unused bits may in general be greater than seven, except when 00397 bit 7 of data_type is set, in which case the number of unused bits will be 00398 less than eight. 00399 00400 inflate() should normally be called until it returns Z_STREAM_END or an 00401 error. However if all decompression is to be performed in a single step 00402 (a single call of inflate), the parameter flush should be set to 00403 Z_FINISH. In this case all pending input is processed and all pending 00404 output is flushed; avail_out must be large enough to hold all the 00405 uncompressed data. (The size of the uncompressed data may have been saved 00406 by the compressor for this purpose.) The next operation on this stream must 00407 be inflateEnd to deallocate the decompression state. The use of Z_FINISH 00408 is never required, but can be used to inform inflate that a faster approach 00409 may be used for the single inflate() call. 00410 00411 In this implementation, inflate() always flushes as much output as 00412 possible to the output buffer, and always uses the faster approach on the 00413 first call. So the only effect of the flush parameter in this implementation 00414 is on the return value of inflate(), as noted below, or when it returns early 00415 because Z_BLOCK is used. 00416 00417 If a preset dictionary is needed after this call (see inflateSetDictionary 00418 below), inflate sets strm->adler to the adler32 checksum of the dictionary 00419 chosen by the compressor and returns Z_NEED_DICT; otherwise it sets 00420 strm->adler to the adler32 checksum of all output produced so far (that is, 00421 total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described 00422 below. At the end of the stream, inflate() checks that its computed adler32 00423 checksum is equal to that saved by the compressor and returns Z_STREAM_END 00424 only if the checksum is correct. 00425 00426 inflate() will decompress and check either zlib-wrapped or gzip-wrapped 00427 deflate data. The header type is detected automatically. Any information 00428 contained in the gzip header is not retained, so applications that need that 00429 information should instead use raw inflate, see inflateInit2() below, or 00430 inflateBack() and perform their own processing of the gzip header and 00431 trailer. 00432 00433 inflate() returns Z_OK if some progress has been made (more input processed 00434 or more output produced), Z_STREAM_END if the end of the compressed data has 00435 been reached and all uncompressed output has been produced, Z_NEED_DICT if a 00436 preset dictionary is needed at this point, Z_DATA_ERROR if the input data was 00437 corrupted (input stream not conforming to the zlib format or incorrect check 00438 value), Z_STREAM_ERROR if the stream structure was inconsistent (for example 00439 if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, 00440 Z_BUF_ERROR if no progress is possible or if there was not enough room in the 00441 output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and 00442 inflate() can be called again with more input and more output space to 00443 continue decompressing. If Z_DATA_ERROR is returned, the application may then 00444 call inflateSync() to look for a good compression block if a partial recovery 00445 of the data is desired. 00446 */ 00447 00448 #ifdef __SYMBIAN32__ 00449 IMPORT_C int inflateEnd OF((z_streamp strm)); 00450 #else 00451 ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); 00452 //__SYMBIAN32__ 00453 #endif 00454 00455 /* 00456 All dynamically allocated data structures for this stream are freed. 00457 This function discards any unprocessed input and does not flush any 00458 pending output. 00459 00460 inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state 00461 was inconsistent. In the error case, msg may be set but then points to a 00462 static string (which must not be deallocated). 00463 */ 00464 00465 /* Advanced functions */ 00466 00467 /* 00468 The following functions are needed only in some special applications. 00469 */ 00470 00471 00472 #ifdef __SYMBIAN32__ 00473 IMPORT_C int deflateSetDictionary OF((z_streamp strm, 00474 const Bytef *dictionary, 00475 uInt dictLength)); 00476 #else 00477 ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, 00478 const Bytef *dictionary, 00479 uInt dictLength)); 00480 //__SYMBIAN32__ 00481 #endif 00482 00483 /* 00484 Initializes the compression dictionary from the given byte sequence 00485 without producing any compressed output. This function must be called 00486 immediately after deflateInit, deflateInit2 or deflateReset, before any 00487 call of deflate. The compressor and decompressor must use exactly the same 00488 dictionary (see inflateSetDictionary). 00489 00490 The dictionary should consist of strings (byte sequences) that are likely 00491 to be encountered later in the data to be compressed, with the most commonly 00492 used strings preferably put towards the end of the dictionary. Using a 00493 dictionary is most useful when the data to be compressed is short and can be 00494 predicted with good accuracy; the data can then be compressed better than 00495 with the default empty dictionary. 00496 00497 Depending on the size of the compression data structures selected by 00498 deflateInit or deflateInit2, a part of the dictionary may in effect be 00499 discarded, for example if the dictionary is larger than the window size in 00500 deflate or deflate2. Thus the strings most likely to be useful should be 00501 put at the end of the dictionary, not at the front. In addition, the 00502 current implementation of deflate will use at most the window size minus 00503 262 bytes of the provided dictionary. 00504 00505 Upon return of this function, strm->adler is set to the adler32 value 00506 of the dictionary; the decompressor may later use this value to determine 00507 which dictionary has been used by the compressor. (The adler32 value 00508 applies to the whole dictionary even if only a subset of the dictionary is 00509 actually used by the compressor.) If a raw deflate was requested, then the 00510 adler32 value is not computed and strm->adler is not set. 00511 00512 deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a 00513 parameter is invalid (such as NULL dictionary) or the stream state is 00514 inconsistent (for example if deflate has already been called for this stream 00515 or if the compression method is bsort). deflateSetDictionary does not 00516 perform any compression: this will be done by deflate(). 00517 */ 00518 #ifdef __SYMBIAN32__ 00519 IMPORT_C int deflateCopy OF((z_streamp dest, 00520 z_streamp source)); 00521 #else 00522 00523 ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, 00524 z_streamp source)); 00525 //__SYMBIAN32__ 00526 #endif 00527 00528 /* 00529 Sets the destination stream as a complete copy of the source stream. 00530 00531 This function can be useful when several compression strategies will be 00532 tried, for example when there are several ways of pre-processing the input 00533 data with a filter. The streams that will be discarded should then be freed 00534 by calling deflateEnd. Note that deflateCopy duplicates the internal 00535 compression state which can be quite large, so this strategy is slow and 00536 can consume lots of memory. 00537 00538 deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not 00539 enough memory, Z_STREAM_ERROR if the source stream state was inconsistent 00540 (such as zalloc being NULL). msg is left unchanged in both source and 00541 destination. 00542 */ 00543 #ifdef __SYMBIAN32__ 00544 IMPORT_C int deflateReset OF((z_streamp strm)); 00545 #else 00546 ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); 00547 //__SYMBIAN32__ 00548 #endif 00549 00550 /* 00551 This function is equivalent to deflateEnd followed by deflateInit, 00552 but does not free and reallocate all the internal compression state. 00553 The stream will keep the same compression level and any other attributes 00554 that may have been set by deflateInit2. 00555 00556 deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source 00557 stream state was inconsistent (such as zalloc or state being NULL). 00558 */ 00559 #ifdef __SYMBIAN32__ 00560 IMPORT_C int deflateParams OF((z_streamp strm, 00561 int level, 00562 int strategy)); 00563 #else 00564 ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, 00565 int level, 00566 int strategy)); 00567 //__SYMBIAN32__ 00568 #endif 00569 00570 /* 00571 Dynamically update the compression level and compression strategy. The 00572 interpretation of level and strategy is as in deflateInit2. This can be 00573 used to switch between compression and straight copy of the input data, or 00574 to switch to a different kind of input data requiring a different 00575 strategy. If the compression level is changed, the input available so far 00576 is compressed with the old level (and may be flushed); the new level will 00577 take effect only at the next call of deflate(). 00578 00579 Before the call of deflateParams, the stream state must be set as for 00580 a call of deflate(), since the currently available input may have to 00581 be compressed and flushed. In particular, strm->avail_out must be non-zero. 00582 00583 deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source 00584 stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR 00585 if strm->avail_out was zero. 00586 */ 00587 00588 #ifdef __SYMBIAN32__ 00589 IMPORT_C uLong deflateBound OF((z_streamp strm, 00590 uLong sourceLen)); 00591 #else 00592 00593 ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, 00594 uLong sourceLen)); 00595 //__SYMBIAN32__ 00596 #endif 00597 00598 /* 00599 deflateBound() returns an upper bound on the compressed size after 00600 deflation of sourceLen bytes. It must be called after deflateInit() 00601 or deflateInit2(). This would be used to allocate an output buffer 00602 for deflation in a single pass, and so would be called before deflate(). 00603 */ 00604 00605 00606 00607 #ifdef __SYMBIAN32__ 00608 IMPORT_C int inflateSetDictionary OF((z_streamp strm, 00609 const Bytef *dictionary, 00610 uInt dictLength)); 00611 #else 00612 ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, 00613 const Bytef *dictionary, 00614 uInt dictLength)); 00615 //__SYMBIAN32__ 00616 #endif 00617 00618 /* 00619 Initializes the decompression dictionary from the given uncompressed byte 00620 sequence. This function must be called immediately after a call of inflate, 00621 if that call returned Z_NEED_DICT. The dictionary chosen by the compressor 00622 can be determined from the adler32 value returned by that call of inflate. 00623 The compressor and decompressor must use exactly the same dictionary (see 00624 deflateSetDictionary). For raw inflate, this function can be called 00625 immediately after inflateInit2() or inflateReset() and before any call of 00626 inflate() to set the dictionary. The application must insure that the 00627 dictionary that was used for compression is provided. 00628 00629 inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a 00630 parameter is invalid (such as NULL dictionary) or the stream state is 00631 inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the 00632 expected one (incorrect adler32 value). inflateSetDictionary does not 00633 perform any decompression: this will be done by subsequent calls of 00634 inflate(). 00635 */ 00636 #ifdef __SYMBIAN32__ 00637 IMPORT_C int inflateSync OF((z_streamp strm)); 00638 #else 00639 00640 ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); 00641 //__SYMBIAN32__ 00642 #endif 00643 00644 /* 00645 Skips invalid compressed data until a full flush point (see above the 00646 description of deflate with Z_FULL_FLUSH) can be found, or until all 00647 available input is skipped. No output is provided. 00648 00649 inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR 00650 if no more input was provided, Z_DATA_ERROR if no flush point has been found, 00651 or Z_STREAM_ERROR if the stream structure was inconsistent. In the success 00652 case, the application may save the current current value of total_in which 00653 indicates where valid compressed data was found. In the error case, the 00654 application may repeatedly call inflateSync, providing more input each time, 00655 until success or end of the input data. 00656 */ 00657 #ifdef __SYMBIAN32__ 00658 IMPORT_C int inflateReset OF((z_streamp strm)); 00659 #else 00660 ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); 00661 //__SYMBIAN32__ 00662 #endif 00663 00664 /* 00665 This function is equivalent to inflateEnd followed by inflateInit, 00666 but does not free and reallocate all the internal decompression state. 00667 The stream will keep attributes that may have been set by inflateInit2. 00668 00669 inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source 00670 stream state was inconsistent (such as zalloc or state being NULL). 00671 */ 00672 00673 00674 typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); 00675 typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); 00676 00677 00678 00679 /* utility functions */ 00680 00681 /* 00682 The following utility functions are implemented on top of the 00683 basic stream-oriented functions. To simplify the interface, some 00684 default options are assumed (compression level and memory usage, 00685 standard memory allocation functions). The source code of these 00686 utility functions can easily be modified if you need special options. 00687 */ 00688 #ifdef __SYMBIAN32__ 00689 IMPORT_C int compress OF((Bytef *dest, uLongf *destLen, 00690 const Bytef *source, uLong sourceLen)); 00691 #else 00692 ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, 00693 const Bytef *source, uLong sourceLen)); 00694 //__SYMBIAN32__ 00695 #endif 00696 00697 /* 00698 Compresses the source buffer into the destination buffer. sourceLen is 00699 the byte length of the source buffer. Upon entry, destLen is the total 00700 size of the destination buffer, which must be at least the value returned 00701 by compressBound(sourceLen). Upon exit, destLen is the actual size of the 00702 compressed buffer. 00703 This function can be used to compress a whole file at once if the 00704 input file is mmap'ed. 00705 compress returns Z_OK if success, Z_MEM_ERROR if there was not 00706 enough memory, Z_BUF_ERROR if there was not enough room in the output 00707 buffer. 00708 */ 00709 #ifdef __SYMBIAN32__ 00710 IMPORT_C int compress2 OF((Bytef *dest, uLongf *destLen, 00711 const Bytef *source, uLong sourceLen, 00712 int level)); 00713 #else 00714 ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, 00715 const Bytef *source, uLong sourceLen, 00716 int level)); 00717 //__SYMBIAN32__ 00718 #endif 00719 00720 /* 00721 Compresses the source buffer into the destination buffer. The level 00722 parameter has the same meaning as in deflateInit. sourceLen is the byte 00723 length of the source buffer. Upon entry, destLen is the total size of the 00724 destination buffer, which must be at least the value returned by 00725 compressBound(sourceLen). Upon exit, destLen is the actual size of the 00726 compressed buffer. 00727 00728 compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 00729 memory, Z_BUF_ERROR if there was not enough room in the output buffer, 00730 Z_STREAM_ERROR if the level parameter is invalid. 00731 */ 00732 #ifdef __SYMBIAN32__ 00733 IMPORT_C uLong compressBound OF((uLong sourceLen)); 00734 #else 00735 ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); 00736 //__SYMBIAN32__ 00737 #endif 00738 00739 /* 00740 compressBound() returns an upper bound on the compressed size after 00741 compress() or compress2() on sourceLen bytes. It would be used before 00742 a compress() or compress2() call to allocate the destination buffer. 00743 */ 00744 #ifdef __SYMBIAN32__ 00745 IMPORT_C int uncompress (Bytef *dest, uLongf *destLen, 00746 const Bytef *source, uLong sourceLen); 00747 #else 00748 00749 ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, 00750 const Bytef *source, uLong sourceLen)); 00751 //__SYMBIAN32__ 00752 #endif 00753 00754 /* 00755 Decompresses the source buffer into the destination buffer. sourceLen is 00756 the byte length of the source buffer. Upon entry, destLen is the total 00757 size of the destination buffer, which must be large enough to hold the 00758 entire uncompressed data. (The size of the uncompressed data must have 00759 been saved previously by the compressor and transmitted to the decompressor 00760 by some mechanism outside the scope of this compression library.) 00761 Upon exit, destLen is the actual size of the compressed buffer. 00762 This function can be used to decompress a whole file at once if the 00763 input file is mmap'ed. 00764 00765 uncompress returns Z_OK if success, Z_MEM_ERROR if there was not 00766 enough memory, Z_BUF_ERROR if there was not enough room in the output 00767 buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. 00768 */ 00769 00770 00771 typedef voidp gzFile; 00772 #ifdef __SYMBIAN32__ 00773 IMPORT_C gzFile gzopen OF((const char *path, const char *mode)); 00774 #else 00775 ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); 00776 //__SYMBIAN32__ 00777 #endif 00778 00779 /* 00780 Opens a gzip (.gz) file for reading or writing. The mode parameter 00781 is as in fopen ("rb" or "wb") but can also include a compression level 00782 ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for 00783 Huffman only compression as in "wb1h", or 'R' for run-length encoding 00784 as in "wb1R". (See the description of deflateInit2 for more information 00785 about the strategy parameter.) 00786 00787 gzopen can be used to read a file which is not in gzip format; in this 00788 case gzread will directly read from the file without decompression. 00789 00790 gzopen returns NULL if the file could not be opened or if there was 00791 insufficient memory to allocate the (de)compression state; errno 00792 can be checked to distinguish the two cases (if errno is zero, the 00793 zlib error is Z_MEM_ERROR). */ 00794 #ifdef __SYMBIAN32__ 00795 IMPORT_C gzFile gzdopen OF((int fd, const char *mode)); 00796 #else 00797 ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); 00798 //__SYMBIAN32__ 00799 #endif 00800 00801 /* 00802 gzdopen() associates a gzFile with the file descriptor fd. File 00803 descriptors are obtained from calls like open, dup, creat, pipe or 00804 fileno (in the file has been previously opened with fopen). 00805 The mode parameter is as in gzopen. 00806 The next call of gzclose on the returned gzFile will also close the 00807 file descriptor fd, just like fclose(fdopen(fd), mode) closes the file 00808 descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). 00809 gzdopen returns NULL if there was insufficient memory to allocate 00810 the (de)compression state. 00811 */ 00812 #ifdef __SYMBIAN32__ 00813 IMPORT_C int gzsetparams OF((gzFile file, int level, int strategy)); 00814 #else 00815 ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); 00816 //__SYMBIAN32__ 00817 #endif 00818 00819 /* 00820 Dynamically update the compression level or strategy. See the description 00821 of deflateInit2 for the meaning of these parameters. 00822 gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not 00823 opened for writing. 00824 */ 00825 #ifdef __SYMBIAN32__ 00826 IMPORT_C int gzread OF((gzFile file, voidp buf, unsigned len)); 00827 #else 00828 00829 ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); 00830 //__SYMBIAN32__ 00831 #endif 00832 00833 /* 00834 Reads the given number of uncompressed bytes from the compressed file. 00835 If the input file was not in gzip format, gzread copies the given number 00836 of bytes into the buffer. 00837 gzread returns the number of uncompressed bytes actually read (0 for 00838 end of file, -1 for error). */ 00839 #ifdef __SYMBIAN32__ 00840 IMPORT_C int gzwrite OF((gzFile file, 00841 voidpc buf, unsigned len)); 00842 #else 00843 ZEXTERN int ZEXPORT gzwrite OF((gzFile file, 00844 voidpc buf, unsigned len)); 00845 //__SYMBIAN32__ 00846 #endif 00847 00848 /* 00849 Writes the given number of uncompressed bytes into the compressed file. 00850 gzwrite returns the number of uncompressed bytes actually written 00851 (0 in case of error). 00852 */ 00853 #ifdef __SYMBIAN32__ 00854 IMPORT_C int gzprintf OF((gzFile file, const char *format, ...)); 00855 #else 00856 ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); 00857 //__SYMBIAN32__ 00858 #endif 00859 00860 /* 00861 Converts, formats, and writes the args to the compressed file under 00862 control of the format string, as in fprintf. gzprintf returns the number of 00863 uncompressed bytes actually written (0 in case of error). The number of 00864 uncompressed bytes written is limited to 4095. The caller should assure that 00865 this limit is not exceeded. If it is exceeded, then gzprintf() will return 00866 return an error (0) with nothing written. In this case, there may also be a 00867 buffer overflow with unpredictable consequences, which is possible only if 00868 zlib was compiled with the insecure functions sprintf() or vsprintf() 00869 because the secure snprintf() or vsnprintf() functions were not available. 00870 */ 00871 #ifdef __SYMBIAN32__ 00872 IMPORT_C int gzputs OF((gzFile file, const char *s)); 00873 #else 00874 00875 ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); 00876 //__SYMBIAN32__ 00877 #endif 00878 00879 /* 00880 Writes the given null-terminated string to the compressed file, excluding 00881 the terminating null character. 00882 gzputs returns the number of characters written, or -1 in case of error. 00883 */ 00884 #ifdef __SYMBIAN32__ 00885 IMPORT_C char * gzgets OF((gzFile file, char *buf, int len)); 00886 #else 00887 ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); 00888 //__SYMBIAN32__ 00889 #endif 00890 00891 /* 00892 Reads bytes from the compressed file until len-1 characters are read, or 00893 a newline character is read and transferred to buf, or an end-of-file 00894 condition is encountered. The string is then terminated with a null 00895 character. 00896 gzgets returns buf, or Z_NULL in case of error. 00897 */ 00898 #ifdef __SYMBIAN32__ 00899 IMPORT_C int gzputc OF((gzFile file, int c)); 00900 #else 00901 ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); 00902 //__SYMBIAN32__ 00903 #endif 00904 00905 /* 00906 Writes c, converted to an unsigned char, into the compressed file. 00907 gzputc returns the value that was written, or -1 in case of error. 00908 */ 00909 #ifdef __SYMBIAN32__ 00910 IMPORT_C int gzgetc OF((gzFile file)); 00911 #else 00912 ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); 00913 //__SYMBIAN32__ 00914 #endif 00915 00916 /* 00917 Reads one byte from the compressed file. gzgetc returns this byte 00918 or -1 in case of end of file or error. 00919 */ 00920 #ifdef __SYMBIAN32__ 00921 IMPORT_C int gzflush OF((gzFile file, int flush)); 00922 #else 00923 ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); 00924 //__SYMBIAN32__ 00925 #endif 00926 00927 /* 00928 Flushes all pending output into the compressed file. The parameter 00929 flush is as in the deflate() function. The return value is the zlib 00930 error number (see function gzerror below). gzflush returns Z_OK if 00931 the flush parameter is Z_FINISH and all output could be flushed. 00932 gzflush should be called only when strictly necessary because it can 00933 degrade compression. 00934 */ 00935 #ifdef __SYMBIAN32__ 00936 IMPORT_C z_off_t gzseek OF((gzFile file, 00937 z_off_t offset, int whence)); 00938 #else 00939 00940 ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, 00941 z_off_t offset, int whence)); 00942 //__SYMBIAN32__ 00943 #endif 00944 00945 /* 00946 Sets the starting position for the next gzread or gzwrite on the 00947 given compressed file. The offset represents a number of bytes in the 00948 uncompressed data stream. The whence parameter is defined as in lseek(2); 00949 the value SEEK_END is not supported. 00950 If the file is opened for reading, this function is emulated but can be 00951 extremely slow. If the file is opened for writing, only forward seeks are 00952 supported; gzseek then compresses a sequence of zeroes up to the new 00953 starting position. 00954 00955 gzseek returns the resulting offset location as measured in bytes from 00956 the beginning of the uncompressed stream, or -1 in case of error, in 00957 particular if the file is opened for writing and the new starting position 00958 would be before the current position. 00959 */ 00960 #ifdef __SYMBIAN32__ 00961 IMPORT_C int gzrewind OF((gzFile file)); 00962 #else 00963 ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); 00964 //__SYMBIAN32__ 00965 #endif 00966 00967 /* 00968 Rewinds the given file. This function is supported only for reading. 00969 00970 gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) 00971 */ 00972 #ifdef __SYMBIAN32__ 00973 IMPORT_C z_off_t gztell OF((gzFile file)); 00974 #else 00975 ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); 00976 //__SYMBIAN32__ 00977 #endif 00978 00979 /* 00980 Returns the starting position for the next gzread or gzwrite on the 00981 given compressed file. This position represents a number of bytes in the 00982 uncompressed data stream. 00983 00984 gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) 00985 */ 00986 #ifdef __SYMBIAN32__ 00987 IMPORT_C int gzeof OF((gzFile file)); 00988 #else 00989 ZEXTERN int ZEXPORT gzeof OF((gzFile file)); 00990 //__SYMBIAN32__ 00991 #endif 00992 00993 /* 00994 Returns 1 when EOF has previously been detected reading the given 00995 input stream, otherwise zero. 00996 */ 00997 #ifdef __SYMBIAN32__ 00998 IMPORT_C int gzclose OF((gzFile file)); 00999 #else 01000 ZEXTERN int ZEXPORT gzclose OF((gzFile file)); 01001 //__SYMBIAN32__ 01002 #endif 01003 01004 /* 01005 Flushes all pending output if necessary, closes the compressed file 01006 and deallocates all the (de)compression state. The return value is the zlib 01007 error number (see function gzerror below). 01008 */ 01009 #ifdef __SYMBIAN32__ 01010 IMPORT_C const char * gzerror OF((gzFile file, int *errnum)); 01011 #else 01012 ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); 01013 //__SYMBIAN32__ 01014 #endif 01015 01016 /* 01017 Returns the error message for the last error which occurred on the 01018 given compressed file. errnum is set to zlib error number. If an 01019 error occurred in the file system and not in the compression library, 01020 errnum is set to Z_ERRNO and the application may consult errno 01021 to get the exact error code. 01022 */ 01023 01024 /* checksum functions */ 01025 01026 /* 01027 These functions are not related to compression but are exported 01028 anyway because they might be useful in applications using the 01029 compression library. 01030 */ 01031 #ifdef __SYMBIAN32__ 01032 IMPORT_C uLong adler32 OF((uLong adler, const Bytef *buf, uInt len)); 01033 #else 01034 01035 ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); 01036 //__SYMBIAN32__ 01037 #endif 01038 01039 /* 01040 Update a running Adler-32 checksum with the bytes buf[0..len-1] and 01041 return the updated checksum. If buf is NULL, this function returns 01042 the required initial value for the checksum. 01043 An Adler-32 checksum is almost as reliable as a CRC32 but can be computed 01044 much faster. Usage example: 01045 01046 uLong adler = adler32(0L, Z_NULL, 0); 01047 01048 while (read_buffer(buffer, length) != EOF) { 01049 adler = adler32(adler, buffer, length); 01050 } 01051 if (adler != original_adler) error(); 01052 */ 01053 #ifdef __SYMBIAN32__ 01054 IMPORT_C unsigned long crc32(unsigned long , const unsigned char*, unsigned ); 01055 #else 01056 ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); 01057 //__SYMBIAN32__ 01058 #endif 01059 01060 /* 01061 Update a running CRC-32 with the bytes buf[0..len-1] and return the 01062 updated CRC-32. If buf is NULL, this function returns the required initial 01063 value for the for the crc. Pre- and post-conditioning (one's complement) is 01064 performed within this function so it shouldn't be done by the application. 01065 Usage example: 01066 01067 uLong crc = crc32(0L, Z_NULL, 0); 01068 01069 while (read_buffer(buffer, length) != EOF) { 01070 crc = crc32(crc, buffer, length); 01071 } 01072 if (crc != original_crc) error(); 01073 */ 01074 01075 01076 /* various hacks, don't look :) */ 01077 01078 /* deflateInit and inflateInit are macros to allow checking the zlib version 01079 * and the compiler's view of z_stream: 01080 */ 01081 #ifdef __SYMBIAN32__ 01082 IMPORT_C int deflateInit_ OF((z_streamp strm, int level, 01083 const char *version, int stream_size)); 01084 #else 01085 ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, 01086 const char *version, int stream_size)); 01087 //__SYMBIAN32__ 01088 #endif 01089 01090 #ifdef __SYMBIAN32__ 01091 IMPORT_C int inflateInit_ OF((z_streamp strm, 01092 const char *version, int stream_size)); 01093 #else 01094 ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, 01095 const char *version, int stream_size)); 01096 //__SYMBIAN32__ 01097 #endif 01098 01099 #ifdef __SYMBIAN32__ 01100 IMPORT_C int deflateInit2_ OF((z_streamp strm, int level, int method, 01101 int windowBits, int memLevel, 01102 int strategy, const char *version, 01103 int stream_size)); 01104 #else 01105 ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, 01106 int windowBits, int memLevel, 01107 int strategy, const char *version, 01108 int stream_size)); 01109 //__SYMBIAN32__ 01110 #endif 01111 01112 #ifdef __SYMBIAN32__ 01113 IMPORT_C int inflateInit2_ OF((z_streamp strm, int windowBits, 01114 const char *version, int stream_size)); 01115 #else 01116 ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, 01117 const char *version, int stream_size)); 01118 //__SYMBIAN32__ 01119 #endif 01120 01121 01122 #define deflateInit(strm, level) \ 01123 deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) 01124 #define inflateInit(strm) \ 01125 inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) 01126 #define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ 01127 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ 01128 (strategy), ZLIB_VERSION, sizeof(z_stream)) 01129 #define inflateInit2(strm, windowBits) \ 01130 inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) 01131 #define inflateBackInit(strm, windowBits, window) \ 01132 inflateBackInit_((strm), (windowBits), (window), \ 01133 ZLIB_VERSION, sizeof(z_stream)) 01134 01135 01136 #if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) 01137 struct internal_state {int dummy;}; /* hack for buggy compilers */ 01138 #endif 01139 #ifdef __SYMBIAN32__ 01140 IMPORT_C const char * zError OF((int)); 01141 #else 01142 ZEXTERN const char * ZEXPORT zError OF((int)); 01143 //__SYMBIAN32__ 01144 #endif 01145 01146 #ifdef __SYMBIAN32__ 01147 IMPORT_C int inflateSyncPoint OF((z_streamp z)); 01148 #else 01149 ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); 01150 //__SYMBIAN32__ 01151 #endif 01152 01153 #ifdef __SYMBIAN32__ 01154 IMPORT_C const uLongf * get_crc_table OF((void)); 01155 #else 01156 ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); 01157 //__SYMBIAN32__ 01158 #endif 01159 01160 01161 #ifdef __cplusplus 01162 } 01163 #endif 01164 01165 #endif /* ZLIB_H */