mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 23:33:00 +00:00
4497d7fdaa
As a bonus, add support for XZ-compressed files in ZIP
57 lines
1.7 KiB
C
57 lines
1.7 KiB
C
/* Lzma2Enc.h -- LZMA2 Encoder
|
|
2023-04-13 : Igor Pavlov : Public domain */
|
|
|
|
#ifndef ZIP7_INC_LZMA2_ENC_H
|
|
#define ZIP7_INC_LZMA2_ENC_H
|
|
|
|
#include "LzmaEnc.h"
|
|
|
|
EXTERN_C_BEGIN
|
|
|
|
#define LZMA2_ENC_PROPS_BLOCK_SIZE_AUTO 0
|
|
#define LZMA2_ENC_PROPS_BLOCK_SIZE_SOLID ((UInt64)(Int64)-1)
|
|
|
|
typedef struct
|
|
{
|
|
CLzmaEncProps lzmaProps;
|
|
UInt64 blockSize;
|
|
int numBlockThreads_Reduced;
|
|
int numBlockThreads_Max;
|
|
int numTotalThreads;
|
|
} 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)
|
|
*/
|
|
|
|
typedef struct CLzma2Enc CLzma2Enc;
|
|
typedef CLzma2Enc * CLzma2EncHandle;
|
|
// Z7_DECLARE_HANDLE(CLzma2EncHandle)
|
|
|
|
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,
|
|
ISeqOutStreamPtr outStream,
|
|
Byte *outBuf, size_t *outBufSize,
|
|
ISeqInStreamPtr inStream,
|
|
const Byte *inData, size_t inDataSize,
|
|
ICompressProgressPtr progress);
|
|
|
|
EXTERN_C_END
|
|
|
|
#endif
|