/* Lzma2DecMt.h -- LZMA2 Decoder Multi-thread12023-04-13 : Igor Pavlov : Public domain */23#ifndef ZIP7_INC_LZMA2_DEC_MT_H4#define ZIP7_INC_LZMA2_DEC_MT_H56#include "7zTypes.h"78EXTERN_C_BEGIN910typedef struct11{12size_t inBufSize_ST;13size_t outStep_ST;1415#ifndef Z7_ST16unsigned numThreads;17size_t inBufSize_MT;18size_t outBlockMax;19size_t inBlockMax;20#endif21} CLzma2DecMtProps;2223/* init to single-thread mode */24void Lzma2DecMtProps_Init(CLzma2DecMtProps *p);252627/* ---------- CLzma2DecMtHandle Interface ---------- */2829/* Lzma2DecMt_ * functions can return the following exit codes:30SRes:31SZ_OK - OK32SZ_ERROR_MEM - Memory allocation error33SZ_ERROR_PARAM - Incorrect paramater in props34SZ_ERROR_WRITE - ISeqOutStream write callback error35// SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output36SZ_ERROR_PROGRESS - some break from progress callback37SZ_ERROR_THREAD - error in multithreading functions (only for Mt version)38*/3940typedef struct CLzma2DecMt CLzma2DecMt;41typedef CLzma2DecMt * CLzma2DecMtHandle;42// Z7_DECLARE_HANDLE(CLzma2DecMtHandle)4344CLzma2DecMtHandle Lzma2DecMt_Create(ISzAllocPtr alloc, ISzAllocPtr allocMid);45void Lzma2DecMt_Destroy(CLzma2DecMtHandle p);4647SRes Lzma2DecMt_Decode(CLzma2DecMtHandle p,48Byte prop,49const CLzma2DecMtProps *props,50ISeqOutStreamPtr outStream,51const UInt64 *outDataSize, // NULL means undefined52int finishMode, // 0 - partial unpacking is allowed, 1 - if lzma2 stream must be finished53// Byte *outBuf, size_t *outBufSize,54ISeqInStreamPtr inStream,55// const Byte *inData, size_t inDataSize,5657// out variables:58UInt64 *inProcessed,59int *isMT, /* out: (*isMT == 0), if single thread decoding was used */6061// UInt64 *outProcessed,62ICompressProgressPtr progress);636465/* ---------- Read from CLzma2DecMtHandle Interface ---------- */6667SRes Lzma2DecMt_Init(CLzma2DecMtHandle pp,68Byte prop,69const CLzma2DecMtProps *props,70const UInt64 *outDataSize, int finishMode,71ISeqInStreamPtr inStream);7273SRes Lzma2DecMt_Read(CLzma2DecMtHandle pp,74Byte *data, size_t *outSize,75UInt64 *inStreamProcessed);767778EXTERN_C_END7980#endif818283