#[unsafe(export_name = "BZ2_bzWriteOpen")]pub unsafe extern "C" fn BZ2_bzWriteOpen(
bzerror: *mut c_int,
f: *mut FILE,
blockSize100k: c_int,
verbosity: c_int,
workFactor: c_int,
) -> *mut BZFILEExpand description
Prepare to write compressed data to a file handle.
The file handle f should refer to a file which has been opened for writing, and for which the error indicator libc::ferror(f) is not set.
For the meaning of parameters blockSize100k, verbosity and workFactor, see BZ2_bzCompressInit.
§Returns
- if
*bzerrorisBZ_OK, a valid pointer to an abstractBZFILE - otherwise
NULL
§Possible assignments to bzerror
BZ_PARAM_ERRORif any off.is_null!(1..=9).contains(&blockSize100k)!(0..=4).contains(&verbosity)!(0..=250).contains(&workFactor)
BZ_CONFIG_ERRORif no default allocator is configuredBZ_IO_ERRORiflibc::ferror(f)is nonzeroBZ_MEM_ERRORif insufficient memory is availableBZ_OKotherwise
§Safety
The caller must guarantee that
bzerrorsatisfies the requirements ofpointer::as_mut- Either
fisNULLfa valid pointer to aFILE