| 1 | /* LzmaEnc.h -- LZMA Encoder |
| 2 | 2008-10-04 : Igor Pavlov : Public domain */ |
| 3 | |
| 4 | #ifndef __LZMAENC_H |
| 5 | #define __LZMAENC_Hcxx . . $ `compression/lzma/LzmaEnc.h:5:9`! |
| 6 | |
| 7 | #include "Types.h"cxx . . $ `<file>/compression/lzma/Types.h`/ |
| 8 | |
| 9 | #define LZMA_PROPS_SIZEcxx . . $ `compression/lzma/LzmaEnc.h:9:9`! 5 |
| 10 | |
| 11 | typedef struct _CLzmaEncPropscxx . . $ _CLzmaEncProps# |
| 12 | { |
| 13 | int levelcxx . . $ _CLzmaEncProps#level.; /* 0 <= level <= 9 */ |
| 14 | UInt32cxx . . $ UInt32# dictSizecxx . . $ _CLzmaEncProps#dictSize.; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version |
| 15 | (1 << 12) <= dictSize <= (1 << 30) for 64-bit version |
| 16 | default = (1 << 24) */ |
| 17 | int lccxx . . $ _CLzmaEncProps#lc.; /* 0 <= lc <= 8, default = 3 */ |
| 18 | int lpcxx . . $ _CLzmaEncProps#lp.; /* 0 <= lp <= 4, default = 0 */ |
| 19 | int pbcxx . . $ _CLzmaEncProps#pb.; /* 0 <= pb <= 4, default = 2 */ |
| 20 | int algocxx . . $ _CLzmaEncProps#algo.; /* 0 - fast, 1 - normal, default = 1 */ |
| 21 | int fbcxx . . $ _CLzmaEncProps#fb.; /* 5 <= fb <= 273, default = 32 */ |
| 22 | int btModecxx . . $ _CLzmaEncProps#btMode.; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */ |
| 23 | int numHashBytescxx . . $ _CLzmaEncProps#numHashBytes.; /* 2, 3 or 4, default = 4 */ |
| 24 | UInt32cxx . . $ UInt32# mccxx . . $ _CLzmaEncProps#mc.; /* 1 <= mc <= (1 << 30), default = 32 */ |
| 25 | unsigned writeEndMarkcxx . . $ _CLzmaEncProps#writeEndMark.; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */ |
| 26 | int numThreadscxx . . $ _CLzmaEncProps#numThreads.; /* 1 or 2, default = 2 */ |
| 27 | } CLzmaEncPropscxx . . $ CLzmaEncProps#; |
| 28 | |
| 29 | void LzmaEncProps_Initcxx . . $ LzmaEncProps_Init(8b45acebcbbd4466).(CLzmaEncPropscxx . . $ CLzmaEncProps# *p); |
| 30 | void LzmaEncProps_Normalizecxx . . $ LzmaEncProps_Normalize(8b45acebcbbd4466).(CLzmaEncPropscxx . . $ CLzmaEncProps# *p); |
| 31 | UInt32cxx . . $ UInt32# LzmaEncProps_GetDictSizecxx . . $ LzmaEncProps_GetDictSize(3a5902fc24077008).(const CLzmaEncPropscxx . . $ CLzmaEncProps# *props2); |
| 32 | |
| 33 | |
| 34 | /* ---------- CLzmaEncHandle Interface ---------- */ |
| 35 | |
| 36 | /* LzmaEnc_* functions can return the following exit codes: |
| 37 | Returns: |
| 38 | SZ_OK - OK |
| 39 | SZ_ERROR_MEM - Memory allocation error |
| 40 | SZ_ERROR_PARAM - Incorrect paramater in props |
| 41 | SZ_ERROR_WRITE - Write callback error. |
| 42 | SZ_ERROR_PROGRESS - some break from progress callback |
| 43 | SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) |
| 44 | */ |
| 45 | |
| 46 | typedef void * CLzmaEncHandlecxx . . $ CLzmaEncHandle#; |
| 47 | |
| 48 | CLzmaEncHandlecxx . . $ CLzmaEncHandle# LzmaEnc_Createcxx . . $ LzmaEnc_Create(2b2f2d4c05393eec).(ISzAlloccxx . . $ ISzAlloc# *alloc); |
| 49 | void LzmaEnc_Destroycxx . . $ LzmaEnc_Destroy(651218bf81b64962).(CLzmaEncHandlecxx . . $ CLzmaEncHandle# p, ISzAlloccxx . . $ ISzAlloc# *alloc, ISzAlloccxx . . $ ISzAlloc# *allocBig); |
| 50 | SRescxx . . $ SRes# LzmaEnc_SetPropscxx . . $ LzmaEnc_SetProps(56f3369ab02c17f).(CLzmaEncHandlecxx . . $ CLzmaEncHandle# p, const CLzmaEncPropscxx . . $ CLzmaEncProps# *props); |
| 51 | SRescxx . . $ SRes# LzmaEnc_WritePropertiescxx . . $ LzmaEnc_WriteProperties(c1234e765a538d13).(CLzmaEncHandlecxx . . $ CLzmaEncHandle# p, Bytecxx . . $ Byte# *properties, SizeTcxx . . $ SizeT# *size); |
| 52 | SRescxx . . $ SRes# LzmaEnc_Encodecxx . . $ LzmaEnc_Encode(13a78612ddeaed6a).(CLzmaEncHandlecxx . . $ CLzmaEncHandle# p, ISeqOutStreamcxx . . $ ISeqOutStream# *outStream, ISeqInStreamcxx . . $ ISeqInStream# *inStream, |
| 53 | ICompressProgresscxx . . $ ICompressProgress# *progress, ISzAlloccxx . . $ ISzAlloc# *alloc, ISzAlloccxx . . $ ISzAlloc# *allocBig); |
| 54 | SRescxx . . $ SRes# LzmaEnc_MemEncodecxx . . $ LzmaEnc_MemEncode(cedee8e9a4b69b5a).(CLzmaEncHandlecxx . . $ CLzmaEncHandle# p, Bytecxx . . $ Byte# *dest, SizeTcxx . . $ SizeT# *destLen, const Bytecxx . . $ Byte# *src, SizeTcxx . . $ SizeT# srcLen, |
| 55 | int writeEndMark, ICompressProgresscxx . . $ ICompressProgress# *progress, ISzAlloccxx . . $ ISzAlloc# *alloc, ISzAlloccxx . . $ ISzAlloc# *allocBig); |
| 56 | |
| 57 | /* ---------- One Call Interface ---------- */ |
| 58 | |
| 59 | /* LzmaEncode |
| 60 | Return code: |
| 61 | SZ_OK - OK |
| 62 | SZ_ERROR_MEM - Memory allocation error |
| 63 | SZ_ERROR_PARAM - Incorrect paramater |
| 64 | SZ_ERROR_OUTPUT_EOF - output buffer overflow |
| 65 | SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) |
| 66 | */ |
| 67 | |
| 68 | SRescxx . . $ SRes# LzmaEncodecxx . . $ LzmaEncode(368176730a281172).(Bytecxx . . $ Byte# *dest, SizeTcxx . . $ SizeT# *destLen, const Bytecxx . . $ Byte# *src, SizeTcxx . . $ SizeT# srcLen, |
| 69 | const CLzmaEncPropscxx . . $ CLzmaEncProps# *props, Bytecxx . . $ Byte# *propsEncoded, SizeTcxx . . $ SizeT# *propsSize, int writeEndMark, |
| 70 | ICompressProgresscxx . . $ ICompressProgress# *progress, ISzAlloccxx . . $ ISzAlloc# *alloc, ISzAlloccxx . . $ ISzAlloc# *allocBig); |
| 71 | |
| 72 | #endif |