Lines Matching full:zlib
6 <title>zlib Usage Example</title>
10 <h2 align="center"> zlib Usage Example </h2>
14 so on. So for those who have read <tt>zlib.h</tt> (a few times), and
18 We hope this helps explain some of the intricacies of <em>zlib</em>.
22 /* zpipe.c: example of proper use of zlib's inflate() and deflate()
30 1.2 9 Nov 2004 Add assertions to document zlib guarantees
39 From <tt>zlib.h</tt>
48 #include "zlib.h"
51 from the <em>zlib</em> routines. Larger buffer sizes would be more efficient,
58 will be in the <em>zlib</em> format, which is different from the <em>gzip</em> or <em>zip</em>
59 formats. The <em>zlib</em> format has a very small header of only two bytes to identify it as
60 a <em>zlib</em> stream and to provide decoding information, and a four-byte trailer with a fast
66 level is supplied, Z_VERSION_ERROR if the version of zlib.h and the
72 Here are the local variables for <tt>def()</tt>. <tt>ret</tt> will be used for <em>zlib</em>
76 is used to pass information to and from the <em>zlib</em> routines, and to maintain the
86 The first thing we do is to initialize the <em>zlib</em> state for compression using
90 set to the <em>zlib</em> constant <tt>Z_NULL</tt> to request that <em>zlib</em> use
94 (See <a href="zlib_tech.html"><em>zlib Technical Details</em></a>.)
99 greater compression, but slower execution. The <em>zlib</em> constant Z_DEFAULT_COMPRESSION,
103 the <em>zlib</em> format (it is not a byte-for-byte copy of the input).
104 More advanced applications of <em>zlib</em>
107 <em>gzip</em> header and trailer instead of a <em>zlib</em> header and trailer, or raw
110 We must check the return value of <tt>deflateInit()</tt> against the <em>zlib</em> constant
113 <tt>deflateInit()</tt> will also check that the version of <em>zlib</em> that the <tt>zlib.h</tt>
114 file came from matches the version of <em>zlib</em> actually linked with the program. This
115 is especially important for environments in which <em>zlib</em> is a shared library.
117 Note that an application can initialize multiple, independent <em>zlib</em> streams, which can
118 operate in parallel. The state information maintained in the structure allows the <em>zlib</em>
141 <em>zlib</em> constant <tt>Z_FINISH</tt>, which is later passed to <tt>deflate()</tt> to
146 up the compressed stream. If we are not yet at the end of the input, then the <em>zlib</em>
151 <tt>deflateEnd()</tt> being called to free the allocated <em>zlib</em> state before returning
222 other part of the application inadvertently clobbered the memory containing the <em>zlib</em> state.
265 Some applications of <em>zlib
295 decompresses what is hopefully a valid <em>zlib</em> stream from the input file and writes the
303 invalid or incomplete, Z_VERSION_ERROR if the version of zlib.h and
311 can tell from the <em>zlib</em> stream itself when the stream is complete.
322 is because the application has the option to provide the start of the zlib stream in
324 method to aid in memory allocation. In the current implementation of <em>zlib</em>
327 of <em>zlib</em> that provide more compression methods may take advantage of this interface.
356 by <tt>inflate()</tt>, if the input file continues past the <em>zlib</em> stream.
357 For applications where <em>zlib</em> streams are embedded in other data, this routine would
359 data was not used, so the application would know where to pick up after the <em>zlib</em> stream.
383 the <em>zlib</em> format is self-terminating. The main difference here is that there are
385 indicates that <tt>inflate()</tt> detected an error in the <em>zlib</em> compressed data format,
386 which means that either the data is not a <em>zlib</em> stream to begin with, or that the data was
393 first 32K or so of compression. This is noted in the <em>zlib</em> header, so <tt>inflate()</tt>
430 end of the input <em>zlib</em> stream, has completed the decompression and integrity
434 of the <em>zlib</em> stream. So if the return value is not <tt>Z_STREAM_END</tt>, the
442 is not <tt>Z_STREAM_END</tt>, then the <em>zlib</em> stream was incomplete and a data error
451 That ends the routines that directly use <em>zlib</em>. The following routines make this
460 /* report a zlib or i/o error */
481 fputs("zlib version mismatch!\n", stderr);