inflateInit_ — Initializes the decompression system.
Libz.lib
#include <zlib.h>
int inflateInit_(z_streamp stream, const char * version, int stream_size);
On success, the inflateInit_()
function
shall return Z_OK
. Otherwise, inflateInit_() shall return
a value as described below to indicate the error.
The inflateInit_()
function shall
initialize the
decompression system.
On entry, stream shall refer to a
user supplied
z_stream
object (a z_stream_s structure). The
following fields shall be
set on entry:
If the version
requested is not
compatible with the version
implemented, or if the size of the z_stream_s
structure
provided in stream_size does not
match the size in the library implementation, inflateInit_()
shall fail, and return
Z_VERSION_ERROR
.
The inflateInit_() function is not in the source standard; it is only in the binary standard. Source applications should use the inflateInit() macro.
To initialize the decompression system:
#include <stdio.h>void InflateInit_( ) { z_stream d_stream; const char * version; d_stream.zalloc = (alloc_func)0; d_stream.zfree = (free_func)0; d_stream.opaque = (voidpf)0; const char hello[] = "hello, hello!"; Byte *compr, *uncompr; uLong comprLen = 20*sizeof(int); uLong uncomprLen = comprLen; compr = (Byte*)calloc((uInt)comprLen, 1); uncompr = (Byte*)calloc((uInt)uncomprLen, 1); uLong len = (uLong)strlen(hello)+1; compress(compr, &comprLen, (const Bytef*)hello, len); d_stream.next_in = compr; d_stream.avail_in = 0; d_stream.next_out = uncompr; version=zlibVersion(); int ret = inflateInit_(&d_stream,(char*)version, sizeof(d_stream)); inflateEnd(&d_stream); free(compr); free(uncompr); }
|
On error, inflateInit_()
shall return one
of the following error indicators:
In addition, the msg
field of the strm
may be set to an error message.
For additional information or queries on this page send feedback
© 2005-2007 Nokia |