| 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 |
#include <types.h> |
| 26 |
|
| 27 |
typedef unsigned char Byte; |
| 28 |
typedef unsigned short UInt16; |
| 29 |
typedef unsigned int UInt32; |
| 30 |
typedef size_t SizeT; |
| 31 |
|
| 32 |
#define CProb UInt16 |
| 33 |
|
| 34 |
#define LZMA_RESULT_OK 0 |
| 35 |
#define LZMA_RESULT_DATA_ERROR 1 |
| 36 |
|
| 37 |
|
| 38 |
#define LZMA_BASE_SIZE 1846 |
| 39 |
#define LZMA_LIT_SIZE 768 |
| 40 |
|
| 41 |
#define LZMA_PROPERTIES_SIZE 5 |
| 42 |
|
| 43 |
typedef struct _CLzmaProperties { |
| 44 |
int lc; |
| 45 |
int lp; |
| 46 |
int pb; |
| 47 |
} CLzmaProperties; |
| 48 |
|
| 49 |
int LzmaDecodeProperties(CLzmaProperties *propsRes, |
| 50 |
const unsigned char *propsData, int size); |
| 51 |
|
| 52 |
#define LzmaGetNumProbs(Properties) (LZMA_BASE_SIZE + (LZMA_LIT_SIZE \ |
| 53 |
<< ((Properties)->lc + (Properties)->lp))) |
| 54 |
|
| 55 |
#define kLzmaNeedInitId (-2) |
| 56 |
|
| 57 |
typedef struct _CLzmaDecoderState { |
| 58 |
CLzmaProperties Properties; |
| 59 |
CProb *Probs; |
| 60 |
} CLzmaDecoderState; |
| 61 |
|
| 62 |
|
| 63 |
int LzmaDecode(CLzmaDecoderState *vs, |
| 64 |
const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed, |
| 65 |
unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed); |
| 66 |
|
| 67 |
#endif |