// ECoderStatus values are identical to ELzmaStatus values of LZMA2 decoder
typedefenum
{
CODER_STATUS_NOT_SPECIFIED, /* use main error code instead */
CODER_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */
CODER_STATUS_NOT_FINISHED, /* stream was not finished */
CODER_STATUS_NEEDS_MORE_INPUT /* you must provide more input bytes */
} ECoderStatus;
// ECoderFinishMode values are identical to ELzmaFinishMode
typedefenum
{
CODER_FINISH_ANY, /* finish at any point */
CODER_FINISH_END /* block must be finished at the end */
} ECoderFinishMode;
/* alloc : aligned for cache line allocation is better */ void XzUnpacker_Construct(CXzUnpacker *p, ISzAllocPtr alloc); void XzUnpacker_Init(CXzUnpacker *p); void XzUnpacker_SetOutBuf(CXzUnpacker *p, Byte *outBuf, size_t outBufSize); void XzUnpacker_Free(CXzUnpacker *p);
/* XzUnpacker The sequence for decoding functions: { XzUnpacker_Construct() [Decoding_Calls] XzUnpacker_Free() }
[Decoding_Calls]
There are 3 types of interfaces for [Decoding_Calls] calls:
Interface-1 : Partial output buffers: { XzUnpacker_Init() for() XzUnpacker_Code(); } Interface-2 : Direct output buffer: Use it, if you know exact size of decoded data, and you need whole xz unpacked data in one output buffer. xz unpacker doesn't allocate additional buffer for lzma2 dictionary in that mode. { XzUnpacker_Init() XzUnpacker_SetOutBufMode(); // to set output buffer and size for() XzUnpacker_Code(); // (dest = NULL) in XzUnpacker_Code() }
Interface-3 : Direct output buffer : One call full decoding It unpacks whole input buffer to output buffer in one call. It uses Interface-2 internally. { XzUnpacker_CodeFull() }
*/
/* finishMode: It has meaning only if the decoding reaches output limit (*destLen). CODER_FINISH_ANY - use smallest number of input bytes CODER_FINISH_END - read EndOfStream marker after decoding
Returns: SZ_OK status: CODER_STATUS_NOT_FINISHED, CODER_STATUS_NEEDS_MORE_INPUT - maybe there are more xz streams, call XzUnpacker_IsStreamWasFinished to check that current stream was finished SZ_ERROR_MEM - Memory allocation error SZ_ERROR_DATA - Data error SZ_ERROR_UNSUPPORTED - Unsupported method or method properties SZ_ERROR_CRC - CRC error // SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
SZ_ERROR_NO_ARCHIVE - the error with xz Stream Header with one of the following reasons: - xz Stream Signature failure - CRC32 of xz Stream Header is failed - The size of Stream padding is not multiple of four bytes. It's possible to get that error, if xz stream was finished and the stream contains some another data. In that case you can call XzUnpacker_GetExtraSize() function to get real size of xz stream.
*/
/* XzUnpacker_GetExtraSize() returns then number of uncofirmed bytes, if it's in (XZ_STATE_STREAM_HEADER) state or in (XZ_STATE_STREAM_PADDING) state. These bytes can be some bytes after xz archive, or it can be start of new xz stream. Call XzUnpacker_GetExtraSize() after XzUnpacker_Code() function to detect real size of xz stream in two cases, if XzUnpacker_Code() returns: res == SZ_OK && status == CODER_STATUS_NEEDS_MORE_INPUT res == SZ_ERROR_NO_ARCHIVE
*/
/* for random block decoding: XzUnpacker_Init(); set CXzUnpacker::streamFlags XzUnpacker_PrepareToRandomBlockDecoding() loop { XzUnpacker_Code() XzUnpacker_IsBlockFinished() }
*/
/* XzDecMt_Decode() SRes: SZ_OK - OK SZ_ERROR_MEM - Memory allocation error SZ_ERROR_NO_ARCHIVE - is not xz archive SZ_ERROR_ARCHIVE - Headers error SZ_ERROR_DATA - Data Error SZ_ERROR_CRC - CRC Error SZ_ERROR_INPUT_EOF - it needs more input data SZ_ERROR_WRITE - ISeqOutStream error (SZ_ERROR_READ) - ISeqInStream errors (SZ_ERROR_PROGRESS) - ICompressProgress errors // SZ_ERROR_THREAD - error in multi-threading functions MY_SRes_HRESULT_FROM_WRes(WRes_error) - error in multi-threading function
*/
SRes XzDecMt_Decode(CXzDecMtHandle p, const CXzDecMtProps *props, const UInt64 *outDataSize, // NULL means undefined int finishMode, // 0 - partial unpacking is allowed, 1 - xz stream(s) must be finished
ISeqOutStream *outStream, // Byte *outBuf, size_t *outBufSize,
ISeqInStream *inStream, // const Byte *inData, size_t inDataSize,
CXzStatInfo *stat, int *isMT, // 0 means that ST (Single-Thread) version was used
ICompressProgress *progress);
EXTERN_C_END
#endif
Messung V0.5
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.