#[export_name = "inflateCopy"]
pub unsafe extern "C-unwind" fn inflateCopy(
dest: *mut z_stream,
source: *const z_stream,
) -> i32
Expand description
Sets the destination stream as a complete copy of the source stream.
This function can be useful when randomly accessing a large stream. The first pass through the stream can periodically record the inflate state, allowing restarting inflate at those points when randomly accessing the stream.
§Returns
Z_OK
if successZ_MEM_ERROR
if there was not enough memoryZ_STREAM_ERROR
if the source stream state was inconsistent (such as zalloc being NULL)
The msg
field is left unchanged in both source and destination.
§Safety
The caller must guarantee that
- Either
dest
isNULL
dest
satisfies the requirements of&mut *(dest as *mut MaybeUninit<z_stream>)
- Either
source
isNULL
source
satisfies the requirements of&mut *strm
and was initialized withinflateInit_
or similar