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/Lzma2Enc.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 'C/Lzma2Enc.h')
-rw-r--r-- | C/Lzma2Enc.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/C/Lzma2Enc.h b/C/Lzma2Enc.h new file mode 100644 index 0000000..6a6110f --- /dev/null +++ b/C/Lzma2Enc.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* Lzma2Enc.h -- LZMA2 Encoder | ||
2 | 2017-07-27 : Igor Pavlov : Public domain */ | ||
3 | |||
4 | #ifndef __LZMA2_ENC_H | ||
5 | #define __LZMA2_ENC_H | ||
6 | |||
7 | #include "LzmaEnc.h" | ||
8 | |||
9 | EXTERN_C_BEGIN | ||
10 | |||
11 | #define LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO 0 | ||
12 | #define LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID ((UInt64)(Int64)-1) | ||
13 | |||
14 | typedef struct | ||
15 | { | ||
16 | CLzmaEncProps lzmaProps; | ||
17 | UInt64 blockSize; | ||
18 | int numBlockThreads_Reduced; | ||
19 | int numBlockThreads_Max; | ||
20 | int numTotalThreads; | ||
21 | } CLzma2EncProps; | ||
22 | |||
23 | void Lzma2EncProps_Init(CLzma2EncProps *p); | ||
24 | void Lzma2EncProps_Normalize(CLzma2EncProps *p); | ||
25 | |||
26 | /* ---------- CLzmaEnc2Handle Interface ---------- */ | ||
27 | |||
28 | /* Lzma2Enc_* functions can return the following exit codes: | ||
29 | SRes: | ||
30 | SZ_OK - OK | ||
31 | SZ_ERROR_MEM - Memory allocation error | ||
32 | SZ_ERROR_PARAM - Incorrect paramater in props | ||
33 | SZ_ERROR_WRITE - ISeqOutStream write callback error | ||
34 | SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output | ||
35 | SZ_ERROR_PROGRESS - some break from progress callback | ||
36 | SZ_ERROR_THREAD - error in multithreading functions (only for Mt version) | ||
37 | */ | ||
38 | |||
39 | typedef void * CLzma2EncHandle; | ||
40 | |||
41 | CLzma2EncHandle Lzma2Enc_Create(ISzAllocPtr alloc, ISzAllocPtr allocBig); | ||
42 | void Lzma2Enc_Destroy(CLzma2EncHandle p); | ||
43 | SRes Lzma2Enc_SetProps(CLzma2EncHandle p, const CLzma2EncProps *props); | ||
44 | void Lzma2Enc_SetDataSize(CLzma2EncHandle p, UInt64 expectedDataSiize); | ||
45 | Byte Lzma2Enc_WriteProperties(CLzma2EncHandle p); | ||
46 | SRes Lzma2Enc_Encode2(CLzma2EncHandle p, | ||
47 | ISeqOutStream *outStream, | ||
48 | Byte *outBuf, size_t *outBufSize, | ||
49 | ISeqInStream *inStream, | ||
50 | const Byte *inData, size_t inDataSize, | ||
51 | ICompressProgress *progress); | ||
52 | |||
53 | EXTERN_C_END | ||
54 | |||
55 | #endif | ||