pub unsafe extern "C" fn BZ2_bzCompress(
strm: *mut bz_stream,
action: c_int,
) -> c_int
Expand description
Compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full.
§Returns
BZ_SEQUENCE_ERROR
if called on an invalid stream, e.g.- before
BZ2_bzCompressInit
- after
BZ2_bzCompressEnd
- before
BZ_PARAM_ERROR
if any ofBZ_RUN_OK
successfully compressed, but ran out of input or output spaceBZ_FLUSH_OK
not all compressed data has been written to the output yetBZ_FINISH_OK
if all input has been read but not all output has been written to the output buffer yetBZ_STREAM_END
if all input has been read all output has been written to the output buffer
§Safety
- Either
strm
isNULL
strm
satisfies the requirements of&mut *strm
and was initialized withBZ2_bzCompressInit
- Either
strm.next_in
isNULL
andstrm.avail_in
is 0strm.next_in
is readable forstrm.avail_in
bytes
- Either
strm.next_out
isNULL
andstrm.avail_out
is0
strm.next_out
is writable forstrm.avail_out
bytes