Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
LzmaEnc.h
Go to the documentation of this file.
1/* LzmaEnc.h -- LZMA Encoder
22023-04-13 : Igor Pavlov : Public domain */
3
4#ifndef ZIP7_INC_LZMA_ENC_H
5#define ZIP7_INC_LZMA_ENC_H
6
7#include "7zTypes.h"
8
10
11#define LZMA_PROPS_SIZE 5
12
13typedef struct
14{
15 int level; /* 0 <= level <= 9 */
16 UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
17 (1 << 12) <= dictSize <= (3 << 29) for 64-bit version
18 default = (1 << 24) */
19 int lc; /* 0 <= lc <= 8, default = 3 */
20 int lp; /* 0 <= lp <= 4, default = 0 */
21 int pb; /* 0 <= pb <= 4, default = 2 */
22 int algo; /* 0 - fast, 1 - normal, default = 1 */
23 int fb; /* 5 <= fb <= 273, default = 32 */
24 int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
25 int numHashBytes; /* 2, 3 or 4, default = 4 */
26 unsigned numHashOutBits; /* default = ? */
27 UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */
28 unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
29 int numThreads; /* 1 or 2, default = 2 */
30
31 // int _pad;
32
33 UInt64 reduceSize; /* estimated size of data that will be compressed. default = (UInt64)(Int64)-1.
34 Encoder uses this value to reduce dictionary size */
35
38
42
43
44/* ---------- CLzmaEncHandle Interface ---------- */
45
46/* LzmaEnc* functions can return the following exit codes:
47SRes:
48 SZ_OK - OK
49 SZ_ERROR_MEM - Memory allocation error
50 SZ_ERROR_PARAM - Incorrect paramater in props
51 SZ_ERROR_WRITE - ISeqOutStream write callback error
52 SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output
53 SZ_ERROR_PROGRESS - some break from progress callback
54 SZ_ERROR_THREAD - error in multithreading functions (only for Mt version)
55*/
56
57typedef struct CLzmaEnc CLzmaEnc;
59// Z7_DECLARE_HANDLE(CLzmaEncHandle)
60
63
65void LzmaEnc_SetDataSize(CLzmaEncHandle p, UInt64 expectedDataSiize);
68
69SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStreamPtr outStream, ISeqInStreamPtr inStream,
70 ICompressProgressPtr progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);
71SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
72 int writeEndMark, ICompressProgressPtr progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);
73
74
75/* ---------- One Call Interface ---------- */
76
77SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
78 const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
79 ICompressProgressPtr progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);
80
82
83#endif
size_t SizeT
Definition 7zTypes.h:247
#define EXTERN_C_BEGIN
Definition 7zTypes.h:20
unsigned long long int UInt64
Definition 7zTypes.h:234
int SRes
Definition 7zTypes.h:45
#define EXTERN_C_END
Definition 7zTypes.h:21
void LzmaEnc_SetDataSize(CLzmaEncHandle p, UInt64 expectedDataSiize)
Definition LzmaEnc.c:624
UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2)
Definition LzmaEnc.c:118
void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAllocPtr alloc, ISzAllocPtr allocBig)
Definition LzmaEnc.c:2382
SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, ICompressProgressPtr progress, ISzAllocPtr alloc, ISzAllocPtr allocBig)
Definition LzmaEnc.c:3142
void LzmaEncProps_Init(CLzmaEncProps *p)
Definition LzmaEnc.c:59
CLzmaEncHandle LzmaEnc_Create(ISzAllocPtr alloc)
Definition LzmaEnc.c:2354
CLzmaEnc * CLzmaEncHandle
Definition LzmaEnc.h:58
SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, int writeEndMark, ICompressProgressPtr progress, ISzAllocPtr alloc, ISzAllocPtr allocBig)
Definition LzmaEnc.c:3111
SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props)
Definition LzmaEnc.c:551
unsigned LzmaEnc_IsWriteEndMark(CLzmaEncHandle p)
Definition LzmaEnc.c:3105
SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size)
Definition LzmaEnc.c:3072
void LzmaEncProps_Normalize(CLzmaEncProps *p)
Definition LzmaEnc.c:70
SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStreamPtr outStream, ISeqInStreamPtr inStream, ICompressProgressPtr progress, ISzAllocPtr alloc, ISzAllocPtr allocBig)
Definition LzmaEnc.c:3064
struct _CLzmaEncProps CLzmaEncProps
const char * src
Definition lz4.h:866
char * dest
Definition lz4.h:806
Definition LzmaEnc.c:409
BoolInt writeEndMark
Definition LzmaEnc.c:434
Definition LzmaEnc.h:14
int numHashBytes
Definition LzmaEnc.h:25
UInt64 affinity
Definition LzmaEnc.h:36
UInt32 dictSize
Definition LzmaEnc.h:16
int btMode
Definition LzmaEnc.h:24
int lp
Definition LzmaEnc.h:20
int pb
Definition LzmaEnc.h:21
UInt64 reduceSize
Definition LzmaEnc.h:33
UInt32 mc
Definition LzmaEnc.h:27
int algo
Definition LzmaEnc.h:22
int fb
Definition LzmaEnc.h:23
int numThreads
Definition LzmaEnc.h:29
int level
Definition LzmaEnc.h:15
unsigned writeEndMark
Definition LzmaEnc.h:28
unsigned numHashOutBits
Definition LzmaEnc.h:26
int lc
Definition LzmaEnc.h:19
Definition 7zTypes.h:460
size_t size
Definition platform.h:559
unsigned int UInt32
Definition bzlib_private.h:45
unsigned char Byte
Definition zconf.h:391
const lzma_allocator const uint8_t * props
Definition filter.h:362