1370b324cSopenharmony_ci/* XzEnc.h -- Xz Encode
2370b324cSopenharmony_ci2023-04-13 : Igor Pavlov : Public domain */
3370b324cSopenharmony_ci
4370b324cSopenharmony_ci#ifndef ZIP7_INC_XZ_ENC_H
5370b324cSopenharmony_ci#define ZIP7_INC_XZ_ENC_H
6370b324cSopenharmony_ci
7370b324cSopenharmony_ci#include "Lzma2Enc.h"
8370b324cSopenharmony_ci
9370b324cSopenharmony_ci#include "Xz.h"
10370b324cSopenharmony_ci
11370b324cSopenharmony_ciEXTERN_C_BEGIN
12370b324cSopenharmony_ci
13370b324cSopenharmony_ci
14370b324cSopenharmony_ci#define XZ_PROPS_BLOCK_SIZE_AUTO   LZMA2_ENC_PROPS_BLOCK_SIZE_AUTO
15370b324cSopenharmony_ci#define XZ_PROPS_BLOCK_SIZE_SOLID  LZMA2_ENC_PROPS_BLOCK_SIZE_SOLID
16370b324cSopenharmony_ci
17370b324cSopenharmony_ci
18370b324cSopenharmony_citypedef struct
19370b324cSopenharmony_ci{
20370b324cSopenharmony_ci  UInt32 id;
21370b324cSopenharmony_ci  UInt32 delta;
22370b324cSopenharmony_ci  UInt32 ip;
23370b324cSopenharmony_ci  int ipDefined;
24370b324cSopenharmony_ci} CXzFilterProps;
25370b324cSopenharmony_ci
26370b324cSopenharmony_civoid XzFilterProps_Init(CXzFilterProps *p);
27370b324cSopenharmony_ci
28370b324cSopenharmony_ci
29370b324cSopenharmony_citypedef struct
30370b324cSopenharmony_ci{
31370b324cSopenharmony_ci  CLzma2EncProps lzma2Props;
32370b324cSopenharmony_ci  CXzFilterProps filterProps;
33370b324cSopenharmony_ci  unsigned checkId;
34370b324cSopenharmony_ci  UInt64 blockSize;
35370b324cSopenharmony_ci  int numBlockThreads_Reduced;
36370b324cSopenharmony_ci  int numBlockThreads_Max;
37370b324cSopenharmony_ci  int numTotalThreads;
38370b324cSopenharmony_ci  int forceWriteSizesInHeader;
39370b324cSopenharmony_ci  UInt64 reduceSize;
40370b324cSopenharmony_ci} CXzProps;
41370b324cSopenharmony_ci
42370b324cSopenharmony_civoid XzProps_Init(CXzProps *p);
43370b324cSopenharmony_ci
44370b324cSopenharmony_citypedef struct CXzEnc CXzEnc;
45370b324cSopenharmony_citypedef CXzEnc * CXzEncHandle;
46370b324cSopenharmony_ci// Z7_DECLARE_HANDLE(CXzEncHandle)
47370b324cSopenharmony_ci
48370b324cSopenharmony_ciCXzEncHandle XzEnc_Create(ISzAllocPtr alloc, ISzAllocPtr allocBig);
49370b324cSopenharmony_civoid XzEnc_Destroy(CXzEncHandle p);
50370b324cSopenharmony_ciSRes XzEnc_SetProps(CXzEncHandle p, const CXzProps *props);
51370b324cSopenharmony_civoid XzEnc_SetDataSize(CXzEncHandle p, UInt64 expectedDataSiize);
52370b324cSopenharmony_ciSRes XzEnc_Encode(CXzEncHandle p, ISeqOutStreamPtr outStream, ISeqInStreamPtr inStream, ICompressProgressPtr progress);
53370b324cSopenharmony_ci
54370b324cSopenharmony_ciSRes Xz_Encode(ISeqOutStreamPtr outStream, ISeqInStreamPtr inStream,
55370b324cSopenharmony_ci    const CXzProps *props, ICompressProgressPtr progress);
56370b324cSopenharmony_ci
57370b324cSopenharmony_ciSRes Xz_EncodeEmpty(ISeqOutStreamPtr outStream);
58370b324cSopenharmony_ci
59370b324cSopenharmony_ciEXTERN_C_END
60370b324cSopenharmony_ci
61370b324cSopenharmony_ci#endif
62