#[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
BZ_CONFIG_ERRORif no default allocator is configuredBZ_SEQUENCE_ERRORif b was opened withBZ2_bzWriteOpenBZ_IO_ERRORif there is an error writing to the compressed fileBZ_OKotherwise
§Safety
The caller must guarantee that
bzerrorsatisfies the requirements ofpointer::as_mut- Either
bisNULLbis initialized withBZ2_bzReadOpenorBZ2_bzWriteOpen
nbytes_insatisfies the requirements ofpointer::as_mutnbytes_outsatisfies the requirements ofpointer::as_mut