blob: 38830e5480251d1cd1f47667a0d82ed16331ebfe [file] [log] [blame]
repo syncbaa38582013-07-26 17:53:31 -07001/* Lzma2Enc.h -- LZMA2 Encoder
22009-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
10extern "C" {
11#endif
12
13typedef struct
14{
15 CLzmaEncProps lzmaProps;
16 size_t blockSize;
17 int numBlockThreads;
18 int numTotalThreads;
19} CLzma2EncProps;
20
21void Lzma2EncProps_Init(CLzma2EncProps *p);
22void Lzma2EncProps_Normalize(CLzma2EncProps *p);
23
24/* ---------- CLzmaEnc2Handle Interface ---------- */
25
26/* Lzma2Enc_* functions can return the following exit codes:
27Returns:
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
36typedef void * CLzma2EncHandle;
37
38CLzma2EncHandle Lzma2Enc_Create(ISzAlloc *alloc, ISzAlloc *allocBig);
39void Lzma2Enc_Destroy(CLzma2EncHandle p);
40SRes Lzma2Enc_SetProps(CLzma2EncHandle p, const CLzma2EncProps *props);
41Byte Lzma2Enc_WriteProperties(CLzma2EncHandle p);
42SRes Lzma2Enc_Encode(CLzma2EncHandle p,
43 ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress);
44
45/* ---------- One Call Interface ---------- */
46
47/* Lzma2Encode
48Return 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/*
57SRes 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