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