blob: 37712455e96ad02f5cda61aa8327eead1c269a77 [file] [log] [blame]
Stefan Reinauer14e22772010-04-27 06:56:47 +00001/*
Uwe Hermann7eb845e2008-11-02 17:01:06 +00002 LzmaDecode.h
3 LZMA Decoder interface
4
5 LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
6 http://www.7-zip.org/
7
8 LZMA SDK is licensed under two licenses:
9 1) GNU Lesser General Public License (GNU LGPL)
10 2) Common Public License (CPL)
Stefan Reinauer14e22772010-04-27 06:56:47 +000011 It means that you can select one of these two licenses and
Uwe Hermann7eb845e2008-11-02 17:01:06 +000012 follow rules of that license.
13
14 SPECIAL EXCEPTION:
Stefan Reinauer14e22772010-04-27 06:56:47 +000015 Igor Pavlov, as the author of this code, expressly permits you to
16 statically or dynamically link your code (or bind by name) to the
17 interfaces of this file without subjecting your linked code to the
18 terms of the CPL or GNU LGPL. Any modifications or additions
Uwe Hermann7eb845e2008-11-02 17:01:06 +000019 to this file, however, are subject to the LGPL or CPL terms.
20*/
21
22#ifndef LZMADECODE_H
23#define LZMADECODE_H
24
25typedef unsigned char Byte;
26typedef unsigned short UInt16;
27typedef unsigned int UInt32;
28typedef UInt32 SizeT;
29
30#define CProb UInt16
31
32#define LZMA_RESULT_OK 0
33#define LZMA_RESULT_DATA_ERROR 1
34
35
36#define LZMA_BASE_SIZE 1846
37#define LZMA_LIT_SIZE 768
38
39#define LZMA_PROPERTIES_SIZE 5
40
41typedef struct _CLzmaProperties
42{
43 int lc;
44 int lp;
45 int pb;
46}CLzmaProperties;
47
48int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size);
49
50#define LzmaGetNumProbs(Properties) (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((Properties)->lc + (Properties)->lp)))
51
52#define kLzmaNeedInitId (-2)
53
54typedef struct _CLzmaDecoderState
55{
56 CLzmaProperties Properties;
57 CProb *Probs;
58
59
60} CLzmaDecoderState;
61
62
63int LzmaDecode(CLzmaDecoderState *vs,
64 const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed,
65 unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed);
66
67#endif /* LZMADECODE_H */