Lines Matching full:and
4 Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
11 including commercial applications, and to alter it and redistribute it
18 2. Altered source versions must be plainly marked as such, and must not be
28 (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
44 The 'zlib' compression library provides in-memory compression and
47 (deflation) but other algorithms will be added later and will have the same
53 application must provide more input and/or consume the output
60 The library also supports reading and writing files in gzip (.gz) format
65 This library can optionally read and write gzip streams in memory as well.
67 The zlib format was designed to be compact and fast for use in memory
68 and on communications channels. The gzip format was designed for single-
70 directory information, and uses a different, slower check method than zlib.
96 voidpf opaque; /* private data object passed to zalloc and zfree */
106 gzip header information passed to and from zlib routines. See RFC 1952
129 The application must update next_in and avail_in when avail_in has
130 dropped to zero. It must update next_out and avail_out when avail_out
131 has dropped to zero. The application must initialize zalloc, zfree and
133 compression library and must not be updated by the application.
136 parameter for calls of zalloc and zfree. This can be useful for custom
141 If zlib is used in a multi-threaded application, zalloc and zfree must be
144 On 16-bit systems, the functions zalloc and zfree must be able to allocate
150 requirements and avoid any allocation of 64K objects, at the expense of
153 The fields total_in and total_out can be used for statistics or
155 the uncompressed data and may be saved for use in the decompressor
168 /* Allowed flush values; see deflate() and inflate() below for details */
198 #define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
213 /* The application can compare zlibVersion and ZLIB_VERSION for consistency.
216 This check is automatically made by deflateInit and inflateInit.
223 zalloc, zfree and opaque must be initialized before by the caller.
224 If zalloc and zfree are set to Z_NULL, deflateInit updates them to
227 The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
230 Z_DEFAULT_COMPRESSION requests a default compromise between speed and
244 deflate compresses as much data as possible, and stops when the input
252 - Compress more input starting at next_in and update next_in and avail_in
254 enough room in the output buffer), next_in and avail_in are updated and
257 - Provide more output starting at next_out and update next_out and avail_out
264 one of the actions is possible, by providing more input and/or consuming
265 more output, and updating avail_in or avail_out accordingly; avail_out
269 and with zero avail_out, it must be called again after making room in the
277 flushed to the output buffer and the output is aligned on a byte boundary, so
281 algorithms and so it should be used only when necessary.
284 Z_SYNC_FLUSH, and the compression state is reset so that decompression can
290 with the same value of the flush parameter and more output space (updated
297 pending output is flushed and deflate returns with Z_STREAM_END if there
299 called again with Z_FINISH and more output space (updated avail_out) but no
314 binary. This field is only for information purposes and does not affect
319 consumed and all output has been produced (only when flush is set to
323 fatal, and deflate() can be called again with more input and more output
331 This function discards any unprocessed input and does not flush any
346 next_in, avail_in, zalloc, zfree and opaque must be initialized before by
347 the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
349 compression method from the zlib header and allocates all data structures
351 inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
358 the zlib header if present: this will be done by inflate(). (So next_in and
359 avail_in may be modified, but next_out and avail_out are unchanged.)
365 inflate decompresses as much data as possible, and stops when the input
373 - Decompress more input starting at next_in and update next_in and avail_in
375 enough room in the output buffer), next_in is updated and processing
378 - Provide more output starting at next_out and update next_out and avail_out
384 one of the actions is possible, by providing more input and/or consuming
385 more output, and updating the next_* and avail_* values accordingly.
388 call of inflate(). If inflate returns Z_OK and with zero avail_out, it
395 if and when it gets to the next deflate block boundary. When decoding the
397 the header and before the first block. When doing a raw inflate, inflate()
398 will go ahead and process the first block, and will return when it gets to
416 Z_FINISH. In this case all pending input is processed and all pending
425 possible to the output buffer, and always uses the faster approach on the
432 chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
434 total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
436 checksum is equal to that saved by the compressor and returns Z_STREAM_END
439 inflate() will decompress and check either zlib-wrapped or gzip-wrapped
443 inflateBack() and perform their own processing of the gzip header and
448 been reached and all uncompressed output has been produced, Z_NEED_DICT if a
454 output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
455 inflate() can be called again with more input and more output space to
465 This function discards any unprocessed input and does not flush any
488 fields next_in, zalloc, zfree and opaque must be initialized before by
502 with no zlib header or trailer, and will not compute an adler32 check value.
505 16 to windowBits to write a simple gzip header and trailer around the
508 no header crc, and the operating system will be set to 255 (unknown). If a
513 is slow and reduces compression ratio; memLevel=9 uses maximum memory
515 usage as a function of windowBits and memLevel.
524 coding and less string matching; it is somewhat intermediate between
525 Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as
545 call of deflate. The compressor and decompressor must use exactly the same
551 dictionary is most useful when the data to be compressed is short and can be
568 adler32 value is not computed and strm->adler is not set.
586 compression state which can be quite large, so this strategy is slow and
591 (such as zalloc being NULL). msg is left unchanged in both source and
598 but does not free and reallocate all the internal compression state.
599 The stream will keep the same compression level and any other attributes
610 Dynamically update the compression level and compression strategy. The
611 interpretation of level and strategy is as in deflateInit2. This can be
612 used to switch between compression and straight copy of the input data, or
615 is compressed with the old level (and may be flushed); the new level will
620 be compressed and flushed. In particular, strm->avail_out must be non-zero.
635 searching for the best matching string, and even then only by the most
638 max_lazy, good_length, nice_length, and max_chain parameters.
640 deflateTune() can be called after deflateInit() or deflateInit2(), and
650 for deflation in a single pass, and so would be called before deflate().
660 this function can only be used for raw deflate, and must be used before the
662 less than or equal to 16, and that many of the least significant bits of
674 after deflateInit2() or deflateReset() and before the first call of
675 deflate(). The text, time, os, extra field, name, and comment information
678 caller must assure that, if not Z_NULL, name and comment are terminated with
679 a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
682 1.3.x) do not support header crc's, and will report that it is a "multi-part
683 gzip file" and give up.
686 the time set to zero, and os set to 255, with no extra, name, or comment
698 fields next_in, avail_in, zalloc, zfree and opaque must be initialized
712 not looking for a zlib or gzip header, not generating a check value, and not
718 the uncompressed data as is done in the zlib, gzip, and zip formats. For
723 32 to windowBits to enable zlib and gzip decoding with automatic header
732 be done by inflate(). (So next_in and avail_in may be modified, but next_out
733 and avail_out are unchanged.)
744 The compressor and decompressor must use exactly the same dictionary (see
746 immediately after inflateInit2() or inflateReset() and before any call of
785 (such as zalloc being NULL). msg is left unchanged in both source and
792 but does not free and reallocate all the internal decompression state.
806 from next_in. This function should only be used with raw inflate, and
808 inflateReset(). bits must be less than or equal to 16, and that many of the
820 inflateInit2() or inflateReset(), and before the first call of inflate().
826 and before any actual data is decompressed.
828 The text, time, xflags, and os fields are filled in with the gzip header
832 extra_len contains the actual extra field length, and extra contains the
838 any of extra, name, or comment are not Z_NULL and the respective field is
860 calls. The fields zalloc, zfree and opaque in strm must be initialized
861 before the call. If zalloc and zfree are Z_NULL, then the default library-
866 and a 32K byte window must be supplied to be able to decompress general
885 interface for input and output. This is more efficient than inflate() for
886 file i/o applications in that it avoids copying between the output and the
892 and to initialize the state with the user-provided window buffer.
899 files and writes out uncompressed files. The utility would decode the
900 header and process the trailer on its own, hence this routine expects
902 normal behavior of inflate(), which expects either a zlib or gzip header and
906 called by inflateBack() for input and output. inflateBack() calls those
907 routines until it reads a complete deflate stream and writes out all of the
909 parameters and return types are defined above in the in_func and out_func
911 number of bytes of provided input, and a pointer to that input in buf. If
913 case--and inflateBack() will return a buffer error. inflateBack() will call
923 setting strm->next_in and strm->avail_in. If that input is exhausted, then
927 must also be initialized, and then if strm->avail_in is not zero, input will
930 The in_desc and out_desc parameters of inflateBack() is passed as the
931 first parameter of in() and out() respectively when they are called. These
933 supplied in() and out() functions need to do their job.
935 On return, inflateBack() will set strm->next_in and strm->avail_in to
966 Compiler, assembler, and debug options:
980 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
981 and decode gzip streams (to avoid linking crc code)
1004 default options are assumed (compression level and memory usage,
1054 been saved previously by the compressor and transmitted to the decompressor
1124 Converts, formats, and writes the args to the compressed file under
1145 a newline character is read and transferred to buf, or an end-of-file
1178 the flush parameter is Z_FINISH and all output could be flushed.
1197 particular if the file is opened for writing and the new starting position
1232 and deallocates all the (de)compression state. The return value is the zlib
1240 error occurred in the file system and not in the compression library,
1241 errnum is set to Z_ERRNO and the application may consult errno
1247 Clears the error and end-of-file flags for file. This is analogous to the
1262 Update a running Adler-32 checksum with the bytes buf[0..len-1] and
1281 and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
1282 each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
1283 seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
1288 Update a running CRC-32 with the bytes buf[0..len-1] and return the
1290 value for the for the crc. Pre- and post-conditioning (one's complement) is
1305 /* deflateInit and inflateInit are macros to allow checking the zlib version
1306 * and the compiler's view of z_stream:
1339 seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
1340 calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
1341 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and