1 /* Lzma2DecMt.h -- LZMA2 Decoder Multi-thread
2 2018-02-17 : Igor Pavlov : Public domain */
4 #ifndef __LZMA2_DEC_MT_H
5 #define __LZMA2_DEC_MT_H
24 /* init to single-thread mode */
25 void Lzma2DecMtProps_Init(CLzma2DecMtProps
*p
);
28 /* ---------- CLzma2DecMtHandle Interface ---------- */
30 /* Lzma2DecMt_ * functions can return the following exit codes:
33 SZ_ERROR_MEM - Memory allocation error
34 SZ_ERROR_PARAM - Incorrect paramater in props
35 SZ_ERROR_WRITE - ISeqOutStream write callback error
36 // SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output
37 SZ_ERROR_PROGRESS - some break from progress callback
38 SZ_ERROR_THREAD - error in multithreading functions (only for Mt version)
41 typedef void * CLzma2DecMtHandle
;
43 CLzma2DecMtHandle
Lzma2DecMt_Create(ISzAllocPtr alloc
, ISzAllocPtr allocMid
);
44 void Lzma2DecMt_Destroy(CLzma2DecMtHandle p
);
46 SRes
Lzma2DecMt_Decode(CLzma2DecMtHandle p
,
48 const CLzma2DecMtProps
*props
,
49 ISeqOutStream
*outStream
,
50 const UInt64
*outDataSize
, // NULL means undefined
51 int finishMode
, // 0 - partial unpacking is allowed, 1 - if lzma2 stream must be finished
52 // Byte *outBuf, size_t *outBufSize,
53 ISeqInStream
*inStream
,
54 // const Byte *inData, size_t inDataSize,
58 int *isMT
, /* out: (*isMT == 0), if single thread decoding was used */
60 // UInt64 *outProcessed,
61 ICompressProgress
*progress
);
64 /* ---------- Read from CLzma2DecMtHandle Interface ---------- */
66 SRes
Lzma2DecMt_Init(CLzma2DecMtHandle pp
,
68 const CLzma2DecMtProps
*props
,
69 const UInt64
*outDataSize
, int finishMode
,
70 ISeqInStream
*inStream
);
72 SRes
Lzma2DecMt_Read(CLzma2DecMtHandle pp
,
73 Byte
*data
, size_t *outSize
,
74 UInt64
*inStreamProcessed
);