libz_rs_sys

Function inflateSync

Source
#[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

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 is NULL
    • strm satisfies the requirements of &mut *strm and was initialized with inflateInit_ or similar