| OLD | NEW |
| (Empty) |
| 1 /* LzmaEnc.h -- LZMA Encoder | |
| 2 2009-02-07 : Igor Pavlov : Public domain | |
| 3 in the public domain */ | |
| 4 | |
| 5 #ifndef __LZMA_ENC_H | |
| 6 #define __LZMA_ENC_H | |
| 7 | |
| 8 #include "Types.h" | |
| 9 | |
| 10 #ifdef __cplusplus | |
| 11 extern "C" { | |
| 12 #endif | |
| 13 | |
| 14 #define LZMA_PROPS_SIZE 5 | |
| 15 | |
| 16 typedef struct _CLzmaEncProps | |
| 17 { | |
| 18 int level; /* 0 <= level <= 9 */ | |
| 19 UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version | |
| 20 (1 << 12) <= dictSize <= (1 << 30) for 64-bit version | |
| 21 default = (1 << 24) */ | |
| 22 int lc; /* 0 <= lc <= 8, default = 3 */ | |
| 23 int lp; /* 0 <= lp <= 4, default = 0 */ | |
| 24 int pb; /* 0 <= pb <= 4, default = 2 */ | |
| 25 int algo; /* 0 - fast, 1 - normal, default = 1 */ | |
| 26 int fb; /* 5 <= fb <= 273, default = 32 */ | |
| 27 int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1
*/ | |
| 28 int numHashBytes; /* 2, 3 or 4, default = 4 */ | |
| 29 UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */ | |
| 30 unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0
*/ | |
| 31 int numThreads; /* 1 or 2, default = 2 */ | |
| 32 } CLzmaEncProps; | |
| 33 | |
| 34 void LzmaEncProps_Init(CLzmaEncProps *p); | |
| 35 void LzmaEncProps_Normalize(CLzmaEncProps *p); | |
| 36 UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2); | |
| 37 | |
| 38 | |
| 39 /* ---------- CLzmaEncHandle Interface ---------- */ | |
| 40 | |
| 41 /* LzmaEnc_* functions can return the following exit codes: | |
| 42 Returns: | |
| 43 SZ_OK - OK | |
| 44 SZ_ERROR_MEM - Memory allocation error | |
| 45 SZ_ERROR_PARAM - Incorrect paramater in props | |
| 46 SZ_ERROR_WRITE - Write callback error. | |
| 47 SZ_ERROR_PROGRESS - some break from progress callback | |
| 48 SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) | |
| 49 */ | |
| 50 | |
| 51 typedef void * CLzmaEncHandle; | |
| 52 | |
| 53 CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc); | |
| 54 void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig); | |
| 55 SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props); | |
| 56 SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size); | |
| 57 SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *in
Stream, | |
| 58 ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); | |
| 59 SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte
*src, SizeT srcLen, | |
| 60 int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *al
locBig); | |
| 61 | |
| 62 /* ---------- One Call Interface ---------- */ | |
| 63 | |
| 64 /* LzmaEncode | |
| 65 Return code: | |
| 66 SZ_OK - OK | |
| 67 SZ_ERROR_MEM - Memory allocation error | |
| 68 SZ_ERROR_PARAM - Incorrect paramater | |
| 69 SZ_ERROR_OUTPUT_EOF - output buffer overflow | |
| 70 SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) | |
| 71 */ | |
| 72 | |
| 73 SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, | |
| 74 const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeE
ndMark, | |
| 75 ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); | |
| 76 | |
| 77 #ifdef __cplusplus | |
| 78 } | |
| 79 #endif | |
| 80 | |
| 81 #endif | |
| OLD | NEW |