diff options
author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2023-06-21 00:00:00 +0000 |
---|---|---|
committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2023-12-17 14:59:19 +0500 |
commit | 5b39dc76f1bc82f941d5c800ab9f34407a06b53a (patch) | |
tree | fe5e17420300b715021a76328444088d32047963 /C/MtDec.h | |
parent | 93be7d4abfd4233228f58ee1fbbcd76d91be66a4 (diff) | |
download | 7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.tar.gz 7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.tar.bz2 7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.zip |
23.0123.01
Diffstat (limited to 'C/MtDec.h')
-rw-r--r-- | C/MtDec.h | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -1,46 +1,46 @@ | |||
1 | /* MtDec.h -- Multi-thread Decoder | 1 | /* MtDec.h -- Multi-thread Decoder |
2 | 2020-03-05 : Igor Pavlov : Public domain */ | 2 | 2023-04-02 : Igor Pavlov : Public domain */ |
3 | 3 | ||
4 | #ifndef __MT_DEC_H | 4 | #ifndef ZIP7_INC_MT_DEC_H |
5 | #define __MT_DEC_H | 5 | #define ZIP7_INC_MT_DEC_H |
6 | 6 | ||
7 | #include "7zTypes.h" | 7 | #include "7zTypes.h" |
8 | 8 | ||
9 | #ifndef _7ZIP_ST | 9 | #ifndef Z7_ST |
10 | #include "Threads.h" | 10 | #include "Threads.h" |
11 | #endif | 11 | #endif |
12 | 12 | ||
13 | EXTERN_C_BEGIN | 13 | EXTERN_C_BEGIN |
14 | 14 | ||
15 | #ifndef _7ZIP_ST | 15 | #ifndef Z7_ST |
16 | 16 | ||
17 | #ifndef _7ZIP_ST | 17 | #ifndef Z7_ST |
18 | #define MTDEC__THREADS_MAX 32 | 18 | #define MTDEC_THREADS_MAX 32 |
19 | #else | 19 | #else |
20 | #define MTDEC__THREADS_MAX 1 | 20 | #define MTDEC_THREADS_MAX 1 |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | 23 | ||
24 | typedef struct | 24 | typedef struct |
25 | { | 25 | { |
26 | ICompressProgress *progress; | 26 | ICompressProgressPtr progress; |
27 | SRes res; | 27 | SRes res; |
28 | UInt64 totalInSize; | 28 | UInt64 totalInSize; |
29 | UInt64 totalOutSize; | 29 | UInt64 totalOutSize; |
30 | CCriticalSection cs; | 30 | CCriticalSection cs; |
31 | } CMtProgress; | 31 | } CMtProgress; |
32 | 32 | ||
33 | void MtProgress_Init(CMtProgress *p, ICompressProgress *progress); | 33 | void MtProgress_Init(CMtProgress *p, ICompressProgressPtr progress); |
34 | SRes MtProgress_Progress_ST(CMtProgress *p); | 34 | SRes MtProgress_Progress_ST(CMtProgress *p); |
35 | SRes MtProgress_ProgressAdd(CMtProgress *p, UInt64 inSize, UInt64 outSize); | 35 | SRes MtProgress_ProgressAdd(CMtProgress *p, UInt64 inSize, UInt64 outSize); |
36 | SRes MtProgress_GetError(CMtProgress *p); | 36 | SRes MtProgress_GetError(CMtProgress *p); |
37 | void MtProgress_SetError(CMtProgress *p, SRes res); | 37 | void MtProgress_SetError(CMtProgress *p, SRes res); |
38 | 38 | ||
39 | struct _CMtDec; | 39 | struct CMtDec; |
40 | 40 | ||
41 | typedef struct | 41 | typedef struct |
42 | { | 42 | { |
43 | struct _CMtDec *mtDec; | 43 | struct CMtDec_ *mtDec; |
44 | unsigned index; | 44 | unsigned index; |
45 | void *inBuf; | 45 | void *inBuf; |
46 | 46 | ||
@@ -117,7 +117,7 @@ typedef struct | |||
117 | 117 | ||
118 | 118 | ||
119 | 119 | ||
120 | typedef struct _CMtDec | 120 | typedef struct CMtDec_ |
121 | { | 121 | { |
122 | /* input variables */ | 122 | /* input variables */ |
123 | 123 | ||
@@ -126,11 +126,11 @@ typedef struct _CMtDec | |||
126 | // size_t inBlockMax; | 126 | // size_t inBlockMax; |
127 | unsigned numThreadsMax_2; | 127 | unsigned numThreadsMax_2; |
128 | 128 | ||
129 | ISeqInStream *inStream; | 129 | ISeqInStreamPtr inStream; |
130 | // const Byte *inData; | 130 | // const Byte *inData; |
131 | // size_t inDataSize; | 131 | // size_t inDataSize; |
132 | 132 | ||
133 | ICompressProgress *progress; | 133 | ICompressProgressPtr progress; |
134 | ISzAllocPtr alloc; | 134 | ISzAllocPtr alloc; |
135 | 135 | ||
136 | IMtDecCallback2 *mtCallback; | 136 | IMtDecCallback2 *mtCallback; |
@@ -171,11 +171,11 @@ typedef struct _CMtDec | |||
171 | unsigned filledThreadStart; | 171 | unsigned filledThreadStart; |
172 | unsigned numFilledThreads; | 172 | unsigned numFilledThreads; |
173 | 173 | ||
174 | #ifndef _7ZIP_ST | 174 | #ifndef Z7_ST |
175 | BoolInt needInterrupt; | 175 | BoolInt needInterrupt; |
176 | UInt64 interruptIndex; | 176 | UInt64 interruptIndex; |
177 | CMtProgress mtProgress; | 177 | CMtProgress mtProgress; |
178 | CMtDecThread threads[MTDEC__THREADS_MAX]; | 178 | CMtDecThread threads[MTDEC_THREADS_MAX]; |
179 | #endif | 179 | #endif |
180 | } CMtDec; | 180 | } CMtDec; |
181 | 181 | ||