diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:17:02 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:17:02 -0700 |
commit | ff11b0a61f7345572ff2e413173d3179486162f2 (patch) | |
tree | f3c9e2563c4f0ac6684a0012ad48423d4c6aa798 /zlib.h | |
parent | e26a448e9673d67dc2866e11a48d24fc352e5f80 (diff) | |
download | zlib-ff11b0a61f7345572ff2e413173d3179486162f2.tar.gz zlib-ff11b0a61f7345572ff2e413173d3179486162f2.tar.bz2 zlib-ff11b0a61f7345572ff2e413173d3179486162f2.zip |
zlib 1.0.4v1.0.4
Diffstat (limited to 'zlib.h')
-rw-r--r-- | zlib.h | 54 |
1 files changed, 28 insertions, 26 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* zlib.h -- interface of the 'zlib' general purpose compression library | 1 | /* zlib.h -- interface of the 'zlib' general purpose compression library |
2 | version 1.0.2, May 23rd, 1996. | 2 | version 1.0.4, Jul 24th, 1996. |
3 | 3 | ||
4 | Copyright (C) 1995-1996 Jean-loup Gailly and Mark Adler | 4 | Copyright (C) 1995-1996 Jean-loup Gailly and Mark Adler |
5 | 5 | ||
@@ -37,7 +37,7 @@ extern "C" { | |||
37 | 37 | ||
38 | #include "zconf.h" | 38 | #include "zconf.h" |
39 | 39 | ||
40 | #define ZLIB_VERSION "1.0.2" | 40 | #define ZLIB_VERSION "1.0.4" |
41 | 41 | ||
42 | /* | 42 | /* |
43 | The 'zlib' compression library provides in-memory compression and | 43 | The 'zlib' compression library provides in-memory compression and |
@@ -89,6 +89,8 @@ typedef struct z_stream_s { | |||
89 | uLong reserved; /* reserved for future use */ | 89 | uLong reserved; /* reserved for future use */ |
90 | } z_stream; | 90 | } z_stream; |
91 | 91 | ||
92 | typedef z_stream FAR *z_streamp; | ||
93 | |||
92 | /* | 94 | /* |
93 | The application must update next_in and avail_in when avail_in has | 95 | The application must update next_in and avail_in when avail_in has |
94 | dropped to zero. It must update next_out and avail_out when avail_out | 96 | dropped to zero. It must update next_out and avail_out when avail_out |
@@ -166,7 +168,7 @@ typedef struct z_stream_s { | |||
166 | 168 | ||
167 | /* basic functions */ | 169 | /* basic functions */ |
168 | 170 | ||
169 | extern char EXPORT *zlibVersion OF((void)); | 171 | extern const char * EXPORT zlibVersion OF((void)); |
170 | /* The application can compare zlibVersion and ZLIB_VERSION for consistency. | 172 | /* The application can compare zlibVersion and ZLIB_VERSION for consistency. |
171 | If the first character differs, the library code actually used is | 173 | If the first character differs, the library code actually used is |
172 | not compatible with the zlib.h header file used by the application. | 174 | not compatible with the zlib.h header file used by the application. |
@@ -174,7 +176,7 @@ extern char EXPORT *zlibVersion OF((void)); | |||
174 | */ | 176 | */ |
175 | 177 | ||
176 | /* | 178 | /* |
177 | extern int EXPORT deflateInit OF((z_stream *strm, int level)); | 179 | extern int EXPORT deflateInit OF((z_streamp strm, int level)); |
178 | 180 | ||
179 | Initializes the internal stream state for compression. The fields | 181 | Initializes the internal stream state for compression. The fields |
180 | zalloc, zfree and opaque must be initialized before by the caller. | 182 | zalloc, zfree and opaque must be initialized before by the caller. |
@@ -196,7 +198,7 @@ extern int EXPORT deflateInit OF((z_stream *strm, int level)); | |||
196 | */ | 198 | */ |
197 | 199 | ||
198 | 200 | ||
199 | extern int EXPORT deflate OF((z_stream *strm, int flush)); | 201 | extern int EXPORT deflate OF((z_streamp strm, int flush)); |
200 | /* | 202 | /* |
201 | Performs one or both of the following actions: | 203 | Performs one or both of the following actions: |
202 | 204 | ||
@@ -239,8 +241,8 @@ extern int EXPORT deflate OF((z_stream *strm, int flush)); | |||
239 | parameter and more output space (updated avail_out), until the flush is | 241 | parameter and more output space (updated avail_out), until the flush is |
240 | complete (deflate returns with non-zero avail_out). | 242 | complete (deflate returns with non-zero avail_out). |
241 | 243 | ||
242 | If the parameter flush is set to Z_FINISH, all pending input is processed, | 244 | If the parameter flush is set to Z_FINISH, pending input is processed, |
243 | all pending output is flushed and deflate returns with Z_STREAM_END if there | 245 | pending output is flushed and deflate returns with Z_STREAM_END if there |
244 | was enough output space; if deflate returns with Z_OK, this function must be | 246 | was enough output space; if deflate returns with Z_OK, this function must be |
245 | called again with Z_FINISH and more output space (updated avail_out) but no | 247 | called again with Z_FINISH and more output space (updated avail_out) but no |
246 | more input data, until it returns with Z_STREAM_END or an error. After | 248 | more input data, until it returns with Z_STREAM_END or an error. After |
@@ -265,7 +267,7 @@ extern int EXPORT deflate OF((z_stream *strm, int flush)); | |||
265 | */ | 267 | */ |
266 | 268 | ||
267 | 269 | ||
268 | extern int EXPORT deflateEnd OF((z_stream *strm)); | 270 | extern int EXPORT deflateEnd OF((z_streamp strm)); |
269 | /* | 271 | /* |
270 | All dynamically allocated data structures for this stream are freed. | 272 | All dynamically allocated data structures for this stream are freed. |
271 | This function discards any unprocessed input and does not flush any | 273 | This function discards any unprocessed input and does not flush any |
@@ -280,7 +282,7 @@ extern int EXPORT deflateEnd OF((z_stream *strm)); | |||
280 | 282 | ||
281 | 283 | ||
282 | /* | 284 | /* |
283 | extern int EXPORT inflateInit OF((z_stream *strm)); | 285 | extern int EXPORT inflateInit OF((z_streamp strm)); |
284 | 286 | ||
285 | Initializes the internal stream state for decompression. The fields | 287 | Initializes the internal stream state for decompression. The fields |
286 | zalloc, zfree and opaque must be initialized before by the caller. If | 288 | zalloc, zfree and opaque must be initialized before by the caller. If |
@@ -295,7 +297,7 @@ extern int EXPORT inflateInit OF((z_stream *strm)); | |||
295 | */ | 297 | */ |
296 | 298 | ||
297 | 299 | ||
298 | extern int EXPORT inflate OF((z_stream *strm, int flush)); | 300 | extern int EXPORT inflate OF((z_streamp strm, int flush)); |
299 | /* | 301 | /* |
300 | Performs one or both of the following actions: | 302 | Performs one or both of the following actions: |
301 | 303 | ||
@@ -350,7 +352,7 @@ extern int EXPORT inflate OF((z_stream *strm, int flush)); | |||
350 | */ | 352 | */ |
351 | 353 | ||
352 | 354 | ||
353 | extern int EXPORT inflateEnd OF((z_stream *strm)); | 355 | extern int EXPORT inflateEnd OF((z_streamp strm)); |
354 | /* | 356 | /* |
355 | All dynamically allocated data structures for this stream are freed. | 357 | All dynamically allocated data structures for this stream are freed. |
356 | This function discards any unprocessed input and does not flush any | 358 | This function discards any unprocessed input and does not flush any |
@@ -368,7 +370,7 @@ extern int EXPORT inflateEnd OF((z_stream *strm)); | |||
368 | */ | 370 | */ |
369 | 371 | ||
370 | /* | 372 | /* |
371 | extern int EXPORT deflateInit2 OF((z_stream *strm, | 373 | extern int EXPORT deflateInit2 OF((z_streamp strm, |
372 | int level, | 374 | int level, |
373 | int method, | 375 | int method, |
374 | int windowBits, | 376 | int windowBits, |
@@ -426,7 +428,7 @@ extern int EXPORT deflateInit2 OF((z_stream *strm, | |||
426 | deflate(). | 428 | deflate(). |
427 | */ | 429 | */ |
428 | 430 | ||
429 | extern int EXPORT deflateSetDictionary OF((z_stream *strm, | 431 | extern int EXPORT deflateSetDictionary OF((z_streamp strm, |
430 | const Bytef *dictionary, | 432 | const Bytef *dictionary, |
431 | uInt dictLength)); | 433 | uInt dictLength)); |
432 | /* | 434 | /* |
@@ -455,8 +457,8 @@ extern int EXPORT deflateSetDictionary OF((z_stream *strm, | |||
455 | be done by deflate(). | 457 | be done by deflate(). |
456 | */ | 458 | */ |
457 | 459 | ||
458 | extern int EXPORT deflateCopy OF((z_stream *dest, | 460 | extern int EXPORT deflateCopy OF((z_streamp dest, |
459 | z_stream *source)); | 461 | z_streamp source)); |
460 | /* | 462 | /* |
461 | Sets the destination stream as a complete copy of the source stream. If | 463 | Sets the destination stream as a complete copy of the source stream. If |
462 | the source stream is using an application-supplied history buffer, a new | 464 | the source stream is using an application-supplied history buffer, a new |
@@ -478,7 +480,7 @@ extern int EXPORT deflateCopy OF((z_stream *dest, | |||
478 | destination. | 480 | destination. |
479 | */ | 481 | */ |
480 | 482 | ||
481 | extern int EXPORT deflateReset OF((z_stream *strm)); | 483 | extern int EXPORT deflateReset OF((z_streamp strm)); |
482 | /* | 484 | /* |
483 | This function is equivalent to deflateEnd followed by deflateInit, | 485 | This function is equivalent to deflateEnd followed by deflateInit, |
484 | but does not free and reallocate all the internal compression state. | 486 | but does not free and reallocate all the internal compression state. |
@@ -489,7 +491,7 @@ extern int EXPORT deflateReset OF((z_stream *strm)); | |||
489 | stream state was inconsistent (such as zalloc or state being NULL). | 491 | stream state was inconsistent (such as zalloc or state being NULL). |
490 | */ | 492 | */ |
491 | 493 | ||
492 | extern int EXPORT deflateParams OF((z_stream *strm, int level, int strategy)); | 494 | extern int EXPORT deflateParams OF((z_streamp strm, int level, int strategy)); |
493 | /* | 495 | /* |
494 | Dynamically update the compression level and compression strategy. | 496 | Dynamically update the compression level and compression strategy. |
495 | This can be used to switch between compression and straight copy of | 497 | This can be used to switch between compression and straight copy of |
@@ -508,7 +510,7 @@ extern int EXPORT deflateParams OF((z_stream *strm, int level, int strategy)); | |||
508 | */ | 510 | */ |
509 | 511 | ||
510 | /* | 512 | /* |
511 | extern int EXPORT inflateInit2 OF((z_stream *strm, | 513 | extern int EXPORT inflateInit2 OF((z_streamp strm, |
512 | int windowBits)); | 514 | int windowBits)); |
513 | 515 | ||
514 | This is another version of inflateInit with more compression options. The | 516 | This is another version of inflateInit with more compression options. The |
@@ -542,7 +544,7 @@ extern int EXPORT inflateInit2 OF((z_stream *strm, | |||
542 | inflate(). | 544 | inflate(). |
543 | */ | 545 | */ |
544 | 546 | ||
545 | extern int EXPORT inflateSetDictionary OF((z_stream *strm, | 547 | extern int EXPORT inflateSetDictionary OF((z_streamp strm, |
546 | const Bytef *dictionary, | 548 | const Bytef *dictionary, |
547 | uInt dictLength)); | 549 | uInt dictLength)); |
548 | /* | 550 | /* |
@@ -561,7 +563,7 @@ extern int EXPORT inflateSetDictionary OF((z_stream *strm, | |||
561 | inflate(). | 563 | inflate(). |
562 | */ | 564 | */ |
563 | 565 | ||
564 | extern int EXPORT inflateSync OF((z_stream *strm)); | 566 | extern int EXPORT inflateSync OF((z_streamp strm)); |
565 | /* | 567 | /* |
566 | Skips invalid compressed data until the special marker (see deflate() | 568 | Skips invalid compressed data until the special marker (see deflate() |
567 | above) can be found, or until all available input is skipped. No output | 569 | above) can be found, or until all available input is skipped. No output |
@@ -576,7 +578,7 @@ extern int EXPORT inflateSync OF((z_stream *strm)); | |||
576 | until success or end of the input data. | 578 | until success or end of the input data. |
577 | */ | 579 | */ |
578 | 580 | ||
579 | extern int EXPORT inflateReset OF((z_stream *strm)); | 581 | extern int EXPORT inflateReset OF((z_streamp strm)); |
580 | /* | 582 | /* |
581 | This function is equivalent to inflateEnd followed by inflateInit, | 583 | This function is equivalent to inflateEnd followed by inflateInit, |
582 | but does not free and reallocate all the internal decompression state. | 584 | but does not free and reallocate all the internal decompression state. |
@@ -690,7 +692,7 @@ extern int EXPORT gzclose OF((gzFile file)); | |||
690 | error number (see function gzerror below). | 692 | error number (see function gzerror below). |
691 | */ | 693 | */ |
692 | 694 | ||
693 | extern char EXPORT *gzerror OF((gzFile file, int *errnum)); | 695 | extern const char * EXPORT gzerror OF((gzFile file, int *errnum)); |
694 | /* | 696 | /* |
695 | Returns the error message for the last error which occurred on the | 697 | Returns the error message for the last error which occurred on the |
696 | given compressed file. errnum is set to zlib error number. If an | 698 | given compressed file. errnum is set to zlib error number. If an |
@@ -746,14 +748,14 @@ extern uLong EXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); | |||
746 | /* deflateInit and inflateInit are macros to allow checking the zlib version | 748 | /* deflateInit and inflateInit are macros to allow checking the zlib version |
747 | * and the compiler's view of z_stream: | 749 | * and the compiler's view of z_stream: |
748 | */ | 750 | */ |
749 | extern int EXPORT deflateInit_ OF((z_stream *strm, int level, | 751 | extern int EXPORT deflateInit_ OF((z_streamp strm, int level, |
750 | const char *version, int stream_size)); | 752 | const char *version, int stream_size)); |
751 | extern int EXPORT inflateInit_ OF((z_stream *strm, | 753 | extern int EXPORT inflateInit_ OF((z_streamp strm, |
752 | const char *version, int stream_size)); | 754 | const char *version, int stream_size)); |
753 | extern int EXPORT deflateInit2_ OF((z_stream *strm, int level, int method, | 755 | extern int EXPORT deflateInit2_ OF((z_streamp strm, int level, int method, |
754 | int windowBits, int memLevel, int strategy, | 756 | int windowBits, int memLevel, int strategy, |
755 | const char *version, int stream_size)); | 757 | const char *version, int stream_size)); |
756 | extern int EXPORT inflateInit2_ OF((z_stream *strm, int windowBits, | 758 | extern int EXPORT inflateInit2_ OF((z_streamp strm, int windowBits, |
757 | const char *version, int stream_size)); | 759 | const char *version, int stream_size)); |
758 | #define deflateInit(strm, level) \ | 760 | #define deflateInit(strm, level) \ |
759 | deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) | 761 | deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) |