Function xz_embedded_sys::xz_dec_run [] [src]

pub unsafe extern "C" fn xz_dec_run(s: *mut xz_dec, b: *mut xz_buf) -> xz_ret

Run the XZ decoder

@s: Decoder state allocated using xz_dec_init()

@b: Input and output buffers

The possible return values depend on build options and operation mode. See enum xz_ret for details.

Note that if an error occurs in single-call mode (return value is not XZ_STREAM_END), b->in_pos and b->out_pos are not modified and the contents of the output buffer from b->out[b->out_pos] onward are undefined. This is true even after XZ_BUF_ERROR, because with some filter chains, there may be a second pass over the output buffer, and this pass cannot be properly done if the output buffer is truncated. Thus, you cannot give the single-call decoder a too small buffer and then expect to get that amount valid data from the beginning of the stream. You must use the multi-call decoder if you don't want to uncompress the whole stream.