diff options
author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2021-12-27 00:00:00 +0000 |
---|---|---|
committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2022-03-18 15:35:13 +0500 |
commit | f19f813537c7aea1c20749c914e756b54a9c3cf5 (patch) | |
tree | 816ba62ca7c0fa19f2eb46d9e9d6f7dd7c3a744d /C/Lzma2DecMt.h | |
parent | 98e06a519b63b81986abe76d28887f6984a7732b (diff) | |
download | 7zip-21.07.tar.gz 7zip-21.07.tar.bz2 7zip-21.07.zip |
'21.07'21.07
Diffstat (limited to '')
-rw-r--r-- | C/Lzma2DecMt.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/C/Lzma2DecMt.h b/C/Lzma2DecMt.h new file mode 100644 index 0000000..7791c31 --- /dev/null +++ b/C/Lzma2DecMt.h | |||
@@ -0,0 +1,79 @@ | |||
1 | /* Lzma2DecMt.h -- LZMA2 Decoder Multi-thread | ||
2 | 2018-02-17 : Igor Pavlov : Public domain */ | ||
3 | |||
4 | #ifndef __LZMA2_DEC_MT_H | ||
5 | #define __LZMA2_DEC_MT_H | ||
6 | |||
7 | #include "7zTypes.h" | ||
8 | |||
9 | EXTERN_C_BEGIN | ||
10 | |||
11 | typedef struct | ||
12 | { | ||
13 | size_t inBufSize_ST; | ||
14 | size_t outStep_ST; | ||
15 | |||
16 | #ifndef _7ZIP_ST | ||
17 | unsigned numThreads; | ||
18 | size_t inBufSize_MT; | ||
19 | size_t outBlockMax; | ||
20 | size_t inBlockMax; | ||
21 | #endif | ||
22 | } CLzma2DecMtProps; | ||
23 | |||
24 | /* init to single-thread mode */ | ||
25 | void Lzma2DecMtProps_Init(CLzma2DecMtProps *p); | ||
26 | |||
27 | |||
28 | /* ---------- CLzma2DecMtHandle Interface ---------- */ | ||
29 | |||
30 | /* Lzma2DecMt_ * functions can return the following exit codes: | ||
31 | SRes: | ||
32 | SZ_OK - OK | ||
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) | ||
39 | */ | ||
40 | |||
41 | typedef void * CLzma2DecMtHandle; | ||
42 | |||
43 | CLzma2DecMtHandle Lzma2DecMt_Create(ISzAllocPtr alloc, ISzAllocPtr allocMid); | ||
44 | void Lzma2DecMt_Destroy(CLzma2DecMtHandle p); | ||
45 | |||
46 | SRes Lzma2DecMt_Decode(CLzma2DecMtHandle p, | ||
47 | Byte prop, | ||
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, | ||
55 | |||
56 | // out variables: | ||
57 | UInt64 *inProcessed, | ||
58 | int *isMT, /* out: (*isMT == 0), if single thread decoding was used */ | ||
59 | |||
60 | // UInt64 *outProcessed, | ||
61 | ICompressProgress *progress); | ||
62 | |||
63 | |||
64 | /* ---------- Read from CLzma2DecMtHandle Interface ---------- */ | ||
65 | |||
66 | SRes Lzma2DecMt_Init(CLzma2DecMtHandle pp, | ||
67 | Byte prop, | ||
68 | const CLzma2DecMtProps *props, | ||
69 | const UInt64 *outDataSize, int finishMode, | ||
70 | ISeqInStream *inStream); | ||
71 | |||
72 | SRes Lzma2DecMt_Read(CLzma2DecMtHandle pp, | ||
73 | Byte *data, size_t *outSize, | ||
74 | UInt64 *inStreamProcessed); | ||
75 | |||
76 | |||
77 | EXTERN_C_END | ||
78 | |||
79 | #endif | ||