libz_rs_sys

Function inflate

Source
#[export_name = "inflate"]
pub unsafe extern "C-unwind" fn inflate(
    strm: *mut z_stream,
    flush: i32,
) -> i32
Expand description

Decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full.

§Returns

  • Z_OK if success
  • Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced
  • Z_NEED_DICT if a preset dictionary is needed at this point
  • Z_STREAM_ERROR if the stream state was inconsistent
  • Z_DATA_ERROR if the input data was corrupted
  • Z_MEM_ERROR if there was not enough memory
  • Z_BUF_ERROR if no progress was possible or if there was not enough room in the output buffer when Z_FINISH is used

Note that Z_BUF_ERROR is not fatal, and inflate can be called again with more input and more output space to continue decompressing. If Z_DATA_ERROR is returned, the application may then call inflateSync to look for a good compression block if a partial recovery of the data is to be attempted.

§Safety