Function BZ2_bzDecompress

Source
pub unsafe extern "C" fn BZ2_bzDecompress(
    strm: *mut bz_stream,
) -> c_int
Expand description

Decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full.

§Returns

  • BZ_PARAM_ERROR if any of
    • strm.is_null()
    • strm.s.is_null()
    • strm.avail_out < 1
  • BZ_DATA_ERROR if a data integrity error is detected in the compressed stream
  • BZ_DATA_ERROR_MAGIC if the compressed stream doesn’t begin with the right magic bytes
  • BZ_MEM_ERROR if there wasn’t enough memory available
  • BZ_STREAM_END if the logical end of the data stream was detected and all output has been written to the output buffer
  • BZ_OK otherwise

§Safety

  • Either
    • strm is NULL
    • strm satisfies the requirements of &mut *strm and was initialized with BZ2_bzDecompressInit
  • Either
    • strm.next_in is NULL and strm.avail_in is 0
    • strm.next_in is readable for strm.avail_in bytes
  • Either
    • strm.next_out is NULL and strm.avail_out is 0
    • strm.next_out is writable for strm.avail_out bytes