1 /* Lzma2Enc.h -- LZMA2 Encoder 2 2009-02-07 : Igor Pavlov : Public domain */ 3 4 #ifndef __LZMA2_ENC_H 5 #define __LZMA2_ENC_H 6 7 #include "LzmaEnc.h" 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 typedef struct 14 { 15 CLzmaEncProps lzmaProps; 16 size_t blockSize; 17 int numBlockThreads; 18 int numTotalThreads; 19 } CLzma2EncProps; 20 21 void Lzma2EncProps_Init(CLzma2EncProps *p); 22 void Lzma2EncProps_Normalize(CLzma2EncProps *p); 23 24 /* ---------- CLzmaEnc2Handle Interface ---------- */ 25 26 /* Lzma2Enc_* functions can return the following exit codes: 27 Returns: 28 SZ_OK - OK 29 SZ_ERROR_MEM - Memory allocation error 30 SZ_ERROR_PARAM - Incorrect paramater in props 31 SZ_ERROR_WRITE - Write callback error 32 SZ_ERROR_PROGRESS - some break from progress callback 33 SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) 34 */ 35 36 typedef void * CLzma2EncHandle; 37 38 CLzma2EncHandle Lzma2Enc_Create(ISzAlloc *alloc, ISzAlloc *allocBig); 39 void Lzma2Enc_Destroy(CLzma2EncHandle p); 40 SRes Lzma2Enc_SetProps(CLzma2EncHandle p, const CLzma2EncProps *props); 41 Byte Lzma2Enc_WriteProperties(CLzma2EncHandle p); 42 SRes Lzma2Enc_Encode(CLzma2EncHandle p, 43 ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress); 44 45 /* ---------- One Call Interface ---------- */ 46 47 /* Lzma2Encode 48 Return code: 49 SZ_OK - OK 50 SZ_ERROR_MEM - Memory allocation error 51 SZ_ERROR_PARAM - Incorrect paramater 52 SZ_ERROR_OUTPUT_EOF - output buffer overflow 53 SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) 54 */ 55 56 /* 57 SRes Lzma2Encode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, 58 const CLzmaEncProps *props, Byte *propsEncoded, int writeEndMark, 59 ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); 60 */ 61 62 #ifdef __cplusplus 63 } 64 #endif 65 66 #endif 67