#[export_name = "deflate"]
pub unsafe extern "C-unwind" fn deflate(
strm: *mut z_stream,
flush: i32,
) -> c_int
Expand description
Compresses 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_STREAM_ERROR
if the stream state was inconsistentZ_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 deflate
can be called again with more input and more output space to continue decompressing.
§Safety
- Either
strm
isNULL
strm
satisfies the requirements of&mut *strm
and was initialized withdeflateInit_
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>