/* LzmaDec.h -- LZMA Decoder\r
-2013-01-18 : Igor Pavlov : Public domain */\r
+2018-04-21 : Igor Pavlov : Public domain */\r
\r
#ifndef __LZMA_DEC_H\r
#define __LZMA_DEC_H\r
/* _LZMA_PROB32 can increase the speed on some CPUs,\r
but memory usage for CLzmaDec::probs will be doubled in that case */\r
\r
+typedef\r
#ifdef _LZMA_PROB32\r
-#define CLzmaProb UInt32\r
+ UInt32\r
#else\r
-#define CLzmaProb UInt16\r
+ UInt16\r
#endif\r
+ CLzmaProb;\r
\r
\r
/* ---------- LZMA Properties ---------- */\r
\r
typedef struct _CLzmaProps\r
{\r
- unsigned lc, lp, pb;\r
+ Byte lc;\r
+ Byte lp;\r
+ Byte pb;\r
+ Byte _pad_;\r
UInt32 dicSize;\r
} CLzmaProps;\r
\r
\r
typedef struct\r
{\r
+ /* Don't change this structure. ASM code can use it. */\r
CLzmaProps prop;\r
CLzmaProb *probs;\r
+ CLzmaProb *probs_1664;\r
Byte *dic;\r
- const Byte *buf;\r
- UInt32 range, code;\r
- SizeT dicPos;\r
SizeT dicBufSize;\r
+ SizeT dicPos;\r
+ const Byte *buf;\r
+ UInt32 range;\r
+ UInt32 code;\r
UInt32 processedPos;\r
UInt32 checkDicSize;\r
- unsigned state;\r
UInt32 reps[4];\r
- unsigned remainLen;\r
- int needFlush;\r
- int needInitState;\r
+ UInt32 state;\r
+ UInt32 remainLen;\r
+\r
UInt32 numProbs;\r
unsigned tempBufSize;\r
Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];\r
} CLzmaDec;\r
\r
-#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }\r
+#define LzmaDec_Construct(p) { (p)->dic = NULL; (p)->probs = NULL; }\r
\r
void LzmaDec_Init(CLzmaDec *p);\r
\r
/* There are two types of LZMA streams:\r
- 0) Stream with end mark. That end mark adds about 6 bytes to compressed size.\r
- 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */\r
+ - Stream with end mark. That end mark adds about 6 bytes to compressed size.\r
+ - Stream without end mark. You must know exact uncompressed size to decompress such stream. */\r
\r
typedef enum\r
{\r
SZ_ERROR_UNSUPPORTED - Unsupported properties\r
*/\r
\r
-SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);\r
-void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);\r
+SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc);\r
+void LzmaDec_FreeProbs(CLzmaDec *p, ISzAllocPtr alloc);\r
\r
-SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);\r
-void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);\r
+SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc);\r
+void LzmaDec_Free(CLzmaDec *p, ISzAllocPtr alloc);\r
\r
/* ---------- Dictionary Interface ---------- */\r
\r
You must work with CLzmaDec variables directly in this interface.\r
\r
STEPS:\r
- LzmaDec_Constr()\r
+ LzmaDec_Construct()\r
LzmaDec_Allocate()\r
for (each new stream)\r
{\r
\r
SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,\r
const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,\r
- ELzmaStatus *status, ISzAlloc *alloc);\r
+ ELzmaStatus *status, ISzAllocPtr alloc);\r
\r
EXTERN_C_END\r
\r