#[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 successZ_STREAM_END
if the end of the compressed data has been reached and all uncompressed output has been producedZ_NEED_DICT
if a preset dictionary is needed at this pointZ_STREAM_ERROR
if the stream state was inconsistentZ_DATA_ERROR
if the input data was corruptedZ_MEM_ERROR
if there was not enough memoryZ_BUF_ERROR
if no progress was possible or if there was not enough room in the output buffer whenZ_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
- Either
strm
isNULL
strm
satisfies the requirements of&mut *strm
and was initialized withinflateInit_
or similar
- Either
strm.next_out
isNULL
strm.next_out
andstrm.avail_out
satisfy the requirements ofcore::slice::from_raw_parts_mut::<MaybeUninit<u8>>
- Either
strm.next_in
isNULL
strm.next_in
andstrm.avail_in
satisfy the requirements ofcore::slice::from_raw_parts::<u8>