--- /dev/null
+/* LzmaEnc.h -- LZMA Encoder\r
+2019-10-30 : Igor Pavlov : Public domain */\r
+\r
+#ifndef __LZMA_ENC_H\r
+#define __LZMA_ENC_H\r
+\r
+#include "7zTypes.h"\r
+\r
+EXTERN_C_BEGIN\r
+\r
+#define LZMA_PROPS_SIZE 5\r
+\r
+typedef struct _CLzmaEncProps\r
+{\r
+ int level; /* 0 <= level <= 9 */\r
+ UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version\r
+ (1 << 12) <= dictSize <= (3 << 29) for 64-bit version\r
+ default = (1 << 24) */\r
+ int lc; /* 0 <= lc <= 8, default = 3 */\r
+ int lp; /* 0 <= lp <= 4, default = 0 */\r
+ int pb; /* 0 <= pb <= 4, default = 2 */\r
+ int algo; /* 0 - fast, 1 - normal, default = 1 */\r
+ int fb; /* 5 <= fb <= 273, default = 32 */\r
+ int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */\r
+ int numHashBytes; /* 2, 3 or 4, default = 4 */\r
+ UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */\r
+ unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */\r
+ int numThreads; /* 1 or 2, default = 2 */\r
+\r
+ UInt64 reduceSize; /* estimated size of data that will be compressed. default = (UInt64)(Int64)-1.\r
+ Encoder uses this value to reduce dictionary size */\r
+\r
+ UInt64 affinity;\r
+} CLzmaEncProps;\r
+\r
+void LzmaEncProps_Init(CLzmaEncProps *p);\r
+void LzmaEncProps_Normalize(CLzmaEncProps *p);\r
+UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);\r
+\r
+\r
+/* ---------- CLzmaEncHandle Interface ---------- */\r
+\r
+/* LzmaEnc* functions can return the following exit codes:\r
+SRes:\r
+ SZ_OK - OK\r
+ SZ_ERROR_MEM - Memory allocation error\r
+ SZ_ERROR_PARAM - Incorrect paramater in props\r
+ SZ_ERROR_WRITE - ISeqOutStream write callback error\r
+ SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output\r
+ SZ_ERROR_PROGRESS - some break from progress callback\r
+ SZ_ERROR_THREAD - error in multithreading functions (only for Mt version)\r
+*/\r
+\r
+typedef void * CLzmaEncHandle;\r
+\r
+CLzmaEncHandle LzmaEnc_Create(ISzAllocPtr alloc);\r
+void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAllocPtr alloc, ISzAllocPtr allocBig);\r
+\r
+SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);\r
+void LzmaEnc_SetDataSize(CLzmaEncHandle p, UInt64 expectedDataSiize);\r
+SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);\r
+unsigned LzmaEnc_IsWriteEndMark(CLzmaEncHandle p);\r
+\r
+SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream,\r
+ ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);\r
+SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,\r
+ int writeEndMark, ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);\r
+\r
+\r
+/* ---------- One Call Interface ---------- */\r
+\r
+SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,\r
+ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,\r
+ ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);\r
+\r
+EXTERN_C_END\r
+\r
+#endif\r