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