deflateInit_ — Initializes the compression system.
#include <zlib.h>
int deflateInit_(z_streamp stream, int level, const char * version, int stream_size);
On success, the
deflateInit_() function
shall return Z_OK
. Otherwise,
deflateInit_() shall
return
a value as described below to indicate the error.
The deflateInit_() function shall initialize the compression 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, deflateInit_() shall fail,
and return
Z_VERSION_ERROR
.
The level
supplied shall be a
value between
0
and 9
,
or the value
Z_DEFAULT_COMPRESSION
. A level
of 1
requests the highest speed, while a
level
of 9
requests the highest compression.
A level of 0
indicates that no
compression should be used, and the output shall be the same as the
input.
The deflateInit_() function is not in the source standard; it is only in the binary standard. Source applications should use the deflateInit() macro.
To initialize the compression system:
#include <stdio.h> void DeflateInit_( ) { deflateInit_(&stream, Z_DEFAULT_COMPRESSION, zlibVersion(), sizeof(z_stream)); |
In addition, the
msg
field of the stream
may be set to an error message.
For additional information or queries on this page send feedback
© 2008 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user. |