| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef __LZMADECODE_H |
| 23 |
#define __LZMADECODE_H |
| 24 |
|
| 25 |
typedef unsigned char Byte; |
| 26 |
typedef unsigned short UInt16; |
| 27 |
typedef unsigned int UInt32; |
| 28 |
typedef UInt32 SizeT; |
| 29 |
|
| 30 |
#define CProb UInt16 |
| 31 |
|
| 32 |
#define LZMA_RESULT_OK 0 |
| 33 |
#define LZMA_RESULT_DATA_ERROR 1 |
| 34 |
|
| 35 |
#define LZMA_BASE_SIZE 1846 |
| 36 |
#define LZMA_LIT_SIZE 768 |
| 37 |
|
| 38 |
#define LZMA_PROPERTIES_SIZE 5 |
| 39 |
|
| 40 |
typedef struct _CLzmaProperties |
| 41 |
{ |
| 42 |
int lc; |
| 43 |
int lp; |
| 44 |
int pb; |
| 45 |
}CLzmaProperties; |
| 46 |
|
| 47 |
int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size); |
| 48 |
|
| 49 |
#define LzmaGetNumProbs(Properties) (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((Properties)->lc + (Properties)->lp))) |
| 50 |
|
| 51 |
#define kLzmaNeedInitId (-2) |
| 52 |
|
| 53 |
typedef struct _CLzmaDecoderState |
| 54 |
{ |
| 55 |
CLzmaProperties Properties; |
| 56 |
CProb *Probs; |
| 57 |
|
| 58 |
} CLzmaDecoderState; |
| 59 |
|
| 60 |
int LzmaDecode(CLzmaDecoderState *vs, |
| 61 |
const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed, |
| 62 |
unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed); |
| 63 |
|
| 64 |
#endif |