BZ2_bzWriteClose

Function BZ2_bzWriteClose 

Source
#[unsafe(export_name = "BZ2_bzWriteClose")]
pub unsafe extern "C" fn BZ2_bzWriteClose( bzerror: *mut c_int, b: *mut BZFILE, abandon: c_int, nbytes_in: *mut c_uint, nbytes_out: *mut c_uint, )
Expand description

Compresses and flushes to the compressed file all data so far supplied by BZ2_bzWrite.

The logical end-of-stream markers are also written, so subsequent calls to BZ2_bzWrite are illegal. All memory associated with the compressed file b is released. libc::fflush is called on the compressed file, but it is not libc::fclose’d.

If BZ2_bzWriteClose is called to clean up after an error, the only action is to release the memory. The library records the error codes issued by previous calls, so this situation will be detected automatically. There is no attempt to complete the compression operation, nor to libc::fflush the compressed file. You can force this behaviour to happen even in the case of no error, by passing a nonzero value to abandon.

§Possible assignments to bzerror

§Safety

The caller must guarantee that