Function BZ2_bzCompressInit
pub unsafe extern "C" fn BZ2_bzCompressInit(strm: *mut bz_stream, blockSize100k: c_int, verbosity: c_int, workFactor: c_int) -> c_int
Prepares the stream for compression.
Returns
BZ_PARAM_ERRORif any ofstrm.is_null()!(1..=9).contains(&blockSize100k)!(0..=250).contains(&workFactor)- no valid allocator could be configured
BZ_MEM_ERRORif insufficient memory is availableBZ_OKotherwise
Note: unlike BZ2_bzDecompressInit, verbosity is not validated. Only values in
0..=4 have any effect: 0 suppresses all output, and higher values enable
progressively more verbose diagnostic output.
Safety
The caller must guarantee that
- Either
strmisNULLstrmsatisfies the requirements of&mut *strm
- The
bzalloc,bzfreeandopaquefields form a valid allocator.