RetroArch
Lzma2Dec.h
Go to the documentation of this file.
1 /* Lzma2Dec.h -- LZMA2 Decoder
2 2009-05-03 : Igor Pavlov : Public domain */
3 
4 #ifndef __LZMA2_DEC_H
5 #define __LZMA2_DEC_H
6 
7 #include <boolean.h>
8 #include "LzmaDec.h"
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 /* ---------- State Interface ---------- */
15 
16 typedef struct
17 {
21  int state;
26 } CLzma2Dec;
27 
28 #define Lzma2Dec_Construct(p) LzmaDec_Construct(&(p)->decoder)
29 #define Lzma2Dec_FreeProbs(p, alloc) LzmaDec_FreeProbs(&(p)->decoder, alloc);
30 #define Lzma2Dec_Free(p, alloc) LzmaDec_Free(&(p)->decoder, alloc);
31 
35 
36 
37 /*
38 finishMode:
39  It has meaning only if the decoding reaches output limit (*destLen or dicLimit).
40  LZMA_FINISH_ANY - use smallest number of input bytes
41  LZMA_FINISH_END - read EndOfStream marker after decoding
42 
43 Returns:
44  SZ_OK
45  status:
46  LZMA_STATUS_FINISHED_WITH_MARK
47  LZMA_STATUS_NOT_FINISHED
48  LZMA_STATUS_NEEDS_MORE_INPUT
49  SZ_ERROR_DATA - Data error
50 */
51 
52 SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, size_t dicLimit,
53  const uint8_t *src, size_t *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
54 
55 SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, uint8_t *dest, size_t *destLen,
56  const uint8_t *src, size_t *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
57 
58 
59 /* ---------- One Call Interface ---------- */
60 
61 /*
62 finishMode:
63  It has meaning only if the decoding reaches output limit (*destLen).
64  LZMA_FINISH_ANY - use smallest number of input bytes
65  LZMA_FINISH_END - read EndOfStream marker after decoding
66 
67 Returns:
68  SZ_OK
69  status:
70  LZMA_STATUS_FINISHED_WITH_MARK
71  LZMA_STATUS_NOT_FINISHED
72  SZ_ERROR_DATA - Data error
73  SZ_ERROR_MEM - Memory allocation error
74  SZ_ERROR_UNSUPPORTED - Unsupported properties
75  SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
76 */
77 
78 SRes Lzma2Decode(uint8_t *dest, size_t *destLen, const uint8_t *src, size_t *srcLen,
79  uint8_t prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAlloc *alloc);
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif
Definition: Lzma2Dec.h:16
Definition: 7zTypes.h:162
ELzmaStatus
Definition: LzmaDec.h:89
uint32_t unpackSize
Definition: Lzma2Dec.h:20
SRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, uint8_t prop, ISzAlloc *alloc)
Definition: Lzma2Dec.c:66
Definition: LzmaDec.h:39
uint8_t control
Definition: Lzma2Dec.h:22
bool needInitProp
Definition: Lzma2Dec.h:25
ELzmaFinishMode
Definition: LzmaDec.h:68
void Lzma2Dec_Init(CLzma2Dec *p)
Definition: Lzma2Dec.c:80
uint32_t packSize
Definition: Lzma2Dec.h:19
int SRes
Definition: 7zTypes.h:44
SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, size_t dicLimit, const uint8_t *src, size_t *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
Definition: Lzma2Dec.c:161
GLenum src
Definition: glext.h:6980
GLfloat GLfloat p
Definition: glext.h:9809
CLzmaDec decoder
Definition: Lzma2Dec.h:18
bool needInitState
Definition: Lzma2Dec.h:24
SRes Lzma2Decode(uint8_t *dest, size_t *destLen, const uint8_t *src, size_t *srcLen, uint8_t prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAlloc *alloc)
Definition: Lzma2Dec.c:321
SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, uint8_t *dest, size_t *destLen, const uint8_t *src, size_t *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
Definition: Lzma2Dec.c:282
bool needInitDic
Definition: Lzma2Dec.h:23
unsigned char uint8_t
Definition: stdint.h:124
unsigned int uint32_t
Definition: stdint.h:126
SRes Lzma2Dec_Allocate(CLzma2Dec *p, uint8_t prop, ISzAlloc *alloc)
Definition: Lzma2Dec.c:73
int state
Definition: Lzma2Dec.h:21