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