libz_rs_sys

Function deflatePrime

Source
#[export_name = "deflatePrime"]
pub unsafe extern "C-unwind" fn deflatePrime(
    strm: z_streamp,
    bits: c_int,
    value: c_int,
) -> c_int
Expand description

Inserts bits in the deflate output stream.

The intent is that this function is used to start off the deflate output with the bits leftover from a previous deflate stream when appending to it. As such, this function can only be used for raw deflate, and must be used before the first deflate call after a deflateInit2_ or deflateReset. bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the output.

§Returns

  • Z_OK if success
  • Z_BUF_ERROR if there was not enough room in the internal buffer to insert the bits
  • Z_STREAM_ERROR if the source stream state was inconsistent

§Safety

The caller must guarantee that

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