libz_rs_sys

Function deflateEnd

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

Deallocates all dynamically allocated data structures for this stream.

This function discards any unprocessed input and does not flush any pending output.

§Returns

  • Z_OK if success
  • Z_STREAM_ERROR if the stream state was inconsistent
  • Z_DATA_ERROR if the stream was freed prematurely (some input or output was discarded)

In the error case, strm.msg may be set but then points to a static string (which must not be deallocated).

§Safety

  • Either
    • strm is NULL
    • strm satisfies the requirements of &mut *strm and was initialized with deflateInit_ or similar