diff options
Diffstat (limited to 'zlib.h')
-rw-r--r-- | zlib.h | 66 |
1 files changed, 42 insertions, 24 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.2.0.4, August 10th, 2003 | 2 | version 1.2.0.5, September 8th, 2003 |
3 | 3 | ||
4 | Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler | 4 | Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler |
5 | 5 | ||
@@ -37,10 +37,10 @@ | |||
37 | extern "C" { | 37 | extern "C" { |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #define ZLIB_VERSION "1.2.0.4" | 40 | #define ZLIB_VERSION "1.2.0.5" |
41 | #define ZLIB_VERNUM 0x1204 | 41 | #define ZLIB_VERNUM 0x1205 |
42 | 42 | ||
43 | /* | 43 | /* |
44 | The 'zlib' compression library provides in-memory compression and | 44 | The 'zlib' compression library provides in-memory compression and |
45 | decompression functions, including integrity checks of the uncompressed | 45 | decompression functions, including integrity checks of the uncompressed |
46 | data. This version of the library supports only one compression method | 46 | data. This version of the library supports only one compression method |
@@ -143,7 +143,8 @@ typedef z_stream FAR *z_streamp; | |||
143 | #define Z_SYNC_FLUSH 2 | 143 | #define Z_SYNC_FLUSH 2 |
144 | #define Z_FULL_FLUSH 3 | 144 | #define Z_FULL_FLUSH 3 |
145 | #define Z_FINISH 4 | 145 | #define Z_FINISH 4 |
146 | /* Allowed flush values; see deflate() below for details */ | 146 | #define Z_BLOCK 5 |
147 | /* Allowed flush values; see deflate() and inflate() below for details */ | ||
147 | 148 | ||
148 | #define Z_OK 0 | 149 | #define Z_OK 0 |
149 | #define Z_STREAM_END 1 | 150 | #define Z_STREAM_END 1 |
@@ -192,7 +193,7 @@ ZEXTERN const char * ZEXPORT zlibVersion OF((void)); | |||
192 | This check is automatically made by deflateInit and inflateInit. | 193 | This check is automatically made by deflateInit and inflateInit. |
193 | */ | 194 | */ |
194 | 195 | ||
195 | /* | 196 | /* |
196 | ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); | 197 | ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); |
197 | 198 | ||
198 | Initializes the internal stream state for compression. The fields | 199 | Initializes the internal stream state for compression. The fields |
@@ -272,7 +273,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); | |||
272 | more input data, until it returns with Z_STREAM_END or an error. After | 273 | more input data, until it returns with Z_STREAM_END or an error. After |
273 | deflate has returned Z_STREAM_END, the only possible operations on the | 274 | deflate has returned Z_STREAM_END, the only possible operations on the |
274 | stream are deflateReset or deflateEnd. | 275 | stream are deflateReset or deflateEnd. |
275 | 276 | ||
276 | Z_FINISH can be used immediately after deflateInit if all the compression | 277 | Z_FINISH can be used immediately after deflateInit if all the compression |
277 | is to be done in a single step. In this case, avail_out must be at least | 278 | is to be done in a single step. In this case, avail_out must be at least |
278 | the value returned by deflateBound (see below). If deflate does not return | 279 | the value returned by deflateBound (see below). If deflate does not return |
@@ -311,7 +312,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); | |||
311 | */ | 312 | */ |
312 | 313 | ||
313 | 314 | ||
314 | /* | 315 | /* |
315 | ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); | 316 | ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); |
316 | 317 | ||
317 | Initializes the internal stream state for decompression. The fields | 318 | Initializes the internal stream state for decompression. The fields |
@@ -361,9 +362,23 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); | |||
361 | must be called again after making room in the output buffer because there | 362 | must be called again after making room in the output buffer because there |
362 | might be more output pending. | 363 | might be more output pending. |
363 | 364 | ||
364 | The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, or | 365 | The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, |
365 | Z_FINISH. Z_SYNC_FLUSH requests that inflate() flush as much output as | 366 | Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much |
366 | possible to the output buffer. | 367 | output as possible to the output buffer. Z_BLOCK requests that inflate() stop |
368 | if and when it get to the next deflate block boundary. When decoding the zlib | ||
369 | or gzip format, this will cause inflate() to return immediately after the | ||
370 | header and before the first block. When doing a raw inflate, inflate() will | ||
371 | go ahead and process the first block, and will return when it gets to the end | ||
372 | of that block, or when it runs out of data. | ||
373 | |||
374 | The Z_BLOCK option assists in appending to or combining deflate streams. | ||
375 | Also to assist in this, on return inflate() will set strm->data_type to the | ||
376 | number of unused bits in the last byte taken from strm->next_in, plus eight | ||
377 | if inflate() is currently decoding the last block in the deflate stream, | ||
378 | plus 16 if inflate() returned immediately after decoding an end-of-block | ||
379 | code or decoding the complete header up just before the first byte of the | ||
380 | deflate stream. The end-of-block will not be indicated until all of the | ||
381 | uncompressed data from that block has been written to strm->next_out. | ||
367 | 382 | ||
368 | inflate() should normally be called until it returns Z_STREAM_END or an | 383 | inflate() should normally be called until it returns Z_STREAM_END or an |
369 | error. However if all decompression is to be performed in a single step | 384 | error. However if all decompression is to be performed in a single step |
@@ -379,7 +394,8 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); | |||
379 | In this implementation, inflate() always flushes as much output as | 394 | In this implementation, inflate() always flushes as much output as |
380 | possible to the output buffer, and always uses the faster approach on the | 395 | possible to the output buffer, and always uses the faster approach on the |
381 | first call. So the only effect of the flush parameter in this implementation | 396 | first call. So the only effect of the flush parameter in this implementation |
382 | is on the return value of inflate(), as noted below. | 397 | is on the return value of inflate(), as noted below, or when it returns early |
398 | because Z_BLOCK is used. | ||
383 | 399 | ||
384 | If a preset dictionary is needed after this call (see inflateSetDictionary | 400 | If a preset dictionary is needed after this call (see inflateSetDictionary |
385 | below), inflate sets strm-adler to the adler32 checksum of the dictionary | 401 | below), inflate sets strm-adler to the adler32 checksum of the dictionary |
@@ -430,7 +446,7 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); | |||
430 | The following functions are needed only in some special applications. | 446 | The following functions are needed only in some special applications. |
431 | */ | 447 | */ |
432 | 448 | ||
433 | /* | 449 | /* |
434 | ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, | 450 | ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, |
435 | int level, | 451 | int level, |
436 | int method, | 452 | int method, |
@@ -485,7 +501,7 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, | |||
485 | method). msg is set to null if there is no error message. deflateInit2 does | 501 | method). msg is set to null if there is no error message. deflateInit2 does |
486 | not perform any compression: this will be done by deflate(). | 502 | not perform any compression: this will be done by deflate(). |
487 | */ | 503 | */ |
488 | 504 | ||
489 | ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, | 505 | ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, |
490 | const Bytef *dictionary, | 506 | const Bytef *dictionary, |
491 | uInt dictLength)); | 507 | uInt dictLength)); |
@@ -582,7 +598,7 @@ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, | |||
582 | for deflation in a single pass, and so would be called before deflate(). | 598 | for deflation in a single pass, and so would be called before deflate(). |
583 | */ | 599 | */ |
584 | 600 | ||
585 | /* | 601 | /* |
586 | ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, | 602 | ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, |
587 | int windowBits)); | 603 | int windowBits)); |
588 | 604 | ||
@@ -644,7 +660,7 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, | |||
644 | */ | 660 | */ |
645 | 661 | ||
646 | ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); | 662 | ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); |
647 | /* | 663 | /* |
648 | Skips invalid compressed data until a full flush point (see above the | 664 | Skips invalid compressed data until a full flush point (see above the |
649 | description of deflate with Z_FULL_FLUSH) can be found, or until all | 665 | description of deflate with Z_FULL_FLUSH) can be found, or until all |
650 | available input is skipped. No output is provided. | 666 | available input is skipped. No output is provided. |
@@ -778,7 +794,7 @@ ZEXTERN int ZEXPORT inflateBack OF((z_stream FAR *strm, | |||
778 | that inflateBack() cannot return Z_OK. | 794 | that inflateBack() cannot return Z_OK. |
779 | */ | 795 | */ |
780 | 796 | ||
781 | ZEXTERN int ZEXPORT inflateBackEnd(z_stream FAR *strm); | 797 | ZEXTERN int ZEXPORT inflateBackEnd OF((z_stream FAR *strm)); |
782 | /* | 798 | /* |
783 | All memory allocated by inflateBackInit() is freed. | 799 | All memory allocated by inflateBackInit() is freed. |
784 | 800 | ||
@@ -792,12 +808,14 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); | |||
792 | Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: | 808 | Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: |
793 | 1.0: size of uInt | 809 | 1.0: size of uInt |
794 | 3.2: size of uLong | 810 | 3.2: size of uLong |
795 | 5.4: size of voidpf (pointers) | 811 | 5.4: size of voidpf (pointer) |
796 | 7.6: size of z_off_t | 812 | 7.6: size of z_off_t |
797 | 813 | ||
798 | Debug options: | 814 | Compiler, assembler, and debug options: |
799 | 8: DEBUG | 815 | 8: DEBUG |
800 | 9-11: 0 (reserved) | 816 | 9: ASMV or ASMINF -- use ASM code |
817 | 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention | ||
818 | 11: 0 (reserved) | ||
801 | 819 | ||
802 | One-time table building (smaller code, but not thread-safe if true): | 820 | One-time table building (smaller code, but not thread-safe if true): |
803 | 12: BUILDFIXED -- build static block decoding tables when needed | 821 | 12: BUILDFIXED -- build static block decoding tables when needed |
@@ -805,8 +823,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); | |||
805 | 14,15: 0 (reserved) | 823 | 14,15: 0 (reserved) |
806 | 824 | ||
807 | Library content (indicates missing functionality): | 825 | Library content (indicates missing functionality): |
808 | 16: NO_DEFLATE -- gz* functions cannot compress (to avoid linking deflate | 826 | 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking |
809 | code when not needed) | 827 | deflate code when not needed) |
810 | 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect | 828 | 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect |
811 | and decode gzip streams (to avoid linking crc code) | 829 | and decode gzip streams (to avoid linking crc code) |
812 | 18-19: 0 (reserved) | 830 | 18-19: 0 (reserved) |
@@ -941,7 +959,7 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); | |||
941 | gzread returns the number of uncompressed bytes actually read (0 for | 959 | gzread returns the number of uncompressed bytes actually read (0 for |
942 | end of file, -1 for error). */ | 960 | end of file, -1 for error). */ |
943 | 961 | ||
944 | ZEXTERN int ZEXPORT gzwrite OF((gzFile file, | 962 | ZEXTERN int ZEXPORT gzwrite OF((gzFile file, |
945 | voidpc buf, unsigned len)); | 963 | voidpc buf, unsigned len)); |
946 | /* | 964 | /* |
947 | Writes the given number of uncompressed bytes into the compressed file. | 965 | Writes the given number of uncompressed bytes into the compressed file. |
@@ -1012,7 +1030,7 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); | |||
1012 | 1030 | ||
1013 | ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, | 1031 | ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, |
1014 | z_off_t offset, int whence)); | 1032 | z_off_t offset, int whence)); |
1015 | /* | 1033 | /* |
1016 | Sets the starting position for the next gzread or gzwrite on the | 1034 | Sets the starting position for the next gzread or gzwrite on the |
1017 | given compressed file. The offset represents a number of bytes in the | 1035 | given compressed file. The offset represents a number of bytes in the |
1018 | uncompressed data stream. The whence parameter is defined as in lseek(2); | 1036 | uncompressed data stream. The whence parameter is defined as in lseek(2); |