Enum xz_embedded_sys::xz_ret
[−]
[src]
pub enum xz_ret { XZ_OK, XZ_STREAM_END, XZ_UNSUPPORTED_CHECK, XZ_MEM_ERROR, XZ_MEMLIMIT_ERROR, XZ_FORMAT_ERROR, XZ_OPTIONS_ERROR, XZ_DATA_ERROR, XZ_BUF_ERROR, }
Return codes
In multi-call mode, XZ_BUF_ERROR is returned when two consecutive calls to XZ code cannot consume any input and cannot produce any new output. This happens when there is no new input available, or the output buffer is full while at least one output byte is still pending. Assuming your code is not buggy, you can get this error only when decoding a compressed stream that is truncated or otherwise corrupt.
In single-call mode, XZ_BUF_ERROR is returned only when the output buffer is too small or the compressed input is corrupt in a way that makes the decoder produce more output than the caller expected. When it is (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR is used instead of XZ_BUF_ERROR.
Variants
XZ_OK | Everything is OK so far. More input or more output space is required to continue. This return code is possible only in multi-call mode (XZ_PREALLOC or XZ_DYNALLOC). |
XZ_STREAM_END | Operation finished successfully. |
XZ_UNSUPPORTED_CHECK | Integrity check type is not supported. Decoding is still possible in multi-call mode by simply calling xz_dec_run() again. Note that this return value is used only if XZ_DEC_ANY_CHECK was defined at build time, which is not used in the kernel. Unsupported check types return XZ_OPTIONS_ERROR if XZ_DEC_ANY_CHECK was not defined at build time. |
XZ_MEM_ERROR | Allocating memory failed. This return code is possible only if the decoder was initialized with XZ_DYNALLOC. The amount of memory that was tried to be allocated was no more than the dict_max argument given to xz_dec_init(). |
XZ_MEMLIMIT_ERROR | A bigger LZMA2 dictionary would be needed than allowed by the dict_max argument given to xz_dec_init(). This return value is possible only in multi-call mode (XZ_PREALLOC or XZ_DYNALLOC); the single-call mode (XZ_SINGLE) ignores the dict_max argument. |
XZ_FORMAT_ERROR | File format was not recognized (wrong magic bytes). |
XZ_OPTIONS_ERROR | This implementation doesn't support the requested compression options. In the decoder this means that the header CRC32 matches, but the header itself specifies something that we don't support. |
XZ_DATA_ERROR | Compressed data is corrupt. |
XZ_BUF_ERROR | Cannot make any progress. Details are slightly different between multi-call and single-call mode; more information below. |