libz_rs_sys

Function deflate

Source
#[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 success
  • Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced
  • Z_STREAM_ERROR if the stream state was inconsistent
  • 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 deflate can be called again with more input and more output space to continue decompressing.

§Safety