#[unsafe(export_name = "BZ2_bzRead")]pub unsafe extern "C" fn BZ2_bzRead(
bzerror: *mut c_int,
b: *mut BZFILE,
buf: *mut c_void,
len: c_int,
) -> c_intExpand description
Reads up to len (uncompressed) bytes from the compressed file b into the buffer buf.
§Returns
The number of bytes read
§Possible assignments to bzerror
BZ_PARAM_ERRORif any ofb.is_null()buf.is_null()len < 0
BZ_SEQUENCE_ERRORif b was opened withBZ2_bzWriteOpenBZ_IO_ERRORif there is an error reading from the compressed fileBZ_UNEXPECTED_EOFif the compressed data ends before the logical end-of-stream was detectedBZ_DATA_ERRORif a data integrity error is detected in the compressed streamBZ_DATA_ERROR_MAGICif the compressed stream doesn’t begin with the right magic bytesBZ_MEM_ERRORif insufficient memory is availableBZ_STREAM_ENDif the logical end-of-stream was detectedBZ_OKotherwise
§Safety
The caller must guarantee that
bzerrorsatisfies the requirements ofpointer::as_mut- Either
bisNULLbis initialized withBZ2_bzReadOpenorBZ2_bzWriteOpen
- Either
bufisNULLbufis writable forlenbytes