#[export_name = "compress2"]
pub unsafe extern "C-unwind" fn compress2(
dest: *mut Bytef,
destLen: *mut c_ulong,
source: *const Bytef,
sourceLen: c_ulong,
level: c_int,
) -> c_int
Expand description
Compresses source
into dest
, and writes the final deflated size into destLen
.
The level parameter has the same meaning as in deflateInit_
.
sourceLen
is the byte length of the source buffer.
Upon entry, destLen
is the total size of the destination buffer,
which must be at least the value returned by compressBound
(sourceLen)
.
Upon exit, destLen
is the actual size of the compressed data.
§Returns
Z_OK
if successZ_MEM_ERROR
if there was not enough memoryZ_BUF_ERROR
if there was not enough room in the output buffer
§Safety
The caller must guarantee that
- Either
destLen
isNULL
destLen
satisfies the requirements of&mut *destLen
- Either
dest
isNULL
dest
and*destLen
satisfy the requirements ofcore::slice::from_raw_parts_mut::<MaybeUninit<u8>>
- Either
source
isNULL
source
andsourceLen
satisfy the requirements ofcore::slice::from_raw_parts