#[export_name = "inflateSync"]
pub unsafe extern "C-unwind" fn inflateSync(
strm: *mut z_stream,
) -> i32
Expand description
Skips invalid compressed data until
Skip invalid compressed data until a possible full flush point (see the description of deflate with Z_FULL_FLUSH
) can be found,
or until all available input is skipped. No output is provided.
inflateSync
searches for a 00 00 FF FF
pattern in the compressed data.
All full flush points have this pattern, but not all occurrences of this pattern are full flush points.
§Returns
Z_OK
if a possible full flush point has been foundZ_BUF_ERROR
if no more input was providedZ_DATA_ERROR
if no flush point has been foundZ_STREAM_ERROR
if the stream structure was inconsistent
In the success case, the application may save the current value of total_in
which indicates where valid compressed data was found.
In the error case, the application may repeatedly call inflateSync
, providing more input each time, until success or end of the input data.
§Safety
The caller must guarantee that
- Either
strm
isNULL
strm
satisfies the requirements of&mut *strm
and was initialized withinflateInit_
or similar