7zip/C/Lzma2Enc.h

59 lines
1.7 KiB
C
Raw Permalink Normal View History

2021-12-27 01:00:00 +01:00
/* Lzma2Enc.h -- LZMA2 Encoder
2023-06-21 02:00:00 +02:00
2023-04-13 : Igor Pavlov : Public domain */
2021-12-27 01:00:00 +01:00
2023-06-21 02:00:00 +02:00
#ifndef ZIP7_INC_LZMA2_ENC_H
#define ZIP7_INC_LZMA2_ENC_H
2021-12-27 01:00:00 +01:00
#include "LzmaEnc.h"
EXTERN_C_BEGIN
2023-06-21 02:00:00 +02:00
#define LZMA2_ENC_PROPS_BLOCK_SIZE_AUTO 0
#define LZMA2_ENC_PROPS_BLOCK_SIZE_SOLID ((UInt64)(Int64)-1)
2021-12-27 01:00:00 +01:00
typedef struct
{
CLzmaEncProps lzmaProps;
UInt64 blockSize;
int numBlockThreads_Reduced;
int numBlockThreads_Max;
int numTotalThreads;
2025-07-05 02:00:00 +02:00
unsigned numThreadGroups; // 0 : no groups
2021-12-27 01:00:00 +01:00
} CLzma2EncProps;
void Lzma2EncProps_Init(CLzma2EncProps *p);
void Lzma2EncProps_Normalize(CLzma2EncProps *p);
/* ---------- CLzmaEnc2Handle Interface ---------- */
/* Lzma2Enc_* functions can return the following exit codes:
SRes:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater in props
SZ_ERROR_WRITE - ISeqOutStream write callback error
SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output
SZ_ERROR_PROGRESS - some break from progress callback
SZ_ERROR_THREAD - error in multithreading functions (only for Mt version)
*/
2023-06-21 02:00:00 +02:00
typedef struct CLzma2Enc CLzma2Enc;
typedef CLzma2Enc * CLzma2EncHandle;
// Z7_DECLARE_HANDLE(CLzma2EncHandle)
2021-12-27 01:00:00 +01:00
CLzma2EncHandle Lzma2Enc_Create(ISzAllocPtr alloc, ISzAllocPtr allocBig);
void Lzma2Enc_Destroy(CLzma2EncHandle p);
SRes Lzma2Enc_SetProps(CLzma2EncHandle p, const CLzma2EncProps *props);
void Lzma2Enc_SetDataSize(CLzma2EncHandle p, UInt64 expectedDataSiize);
Byte Lzma2Enc_WriteProperties(CLzma2EncHandle p);
SRes Lzma2Enc_Encode2(CLzma2EncHandle p,
2023-06-21 02:00:00 +02:00
ISeqOutStreamPtr outStream,
2021-12-27 01:00:00 +01:00
Byte *outBuf, size_t *outBufSize,
2023-06-21 02:00:00 +02:00
ISeqInStreamPtr inStream,
2021-12-27 01:00:00 +01:00
const Byte *inData, size_t inDataSize,
2023-06-21 02:00:00 +02:00
ICompressProgressPtr progress);
2021-12-27 01:00:00 +01:00
EXTERN_C_END
#endif