RetroArch
lzma.h
Go to the documentation of this file.
1 /* license:BSD-3-Clause
2  * copyright-holders:Aaron Giles
3  ***************************************************************************
4 
5  lzma.h
6 
7  LZMA compression wrappers
8 
9 ***************************************************************************/
10 
11 #pragma once
12 
13 #ifndef __LIBCHDR_LZMA_H__
14 #define __LIBCHDR_LZMA_H__
15 
16 #include <stdint.h>
17 
18 #include <LzmaEnc.h>
19 #include <LzmaDec.h>
20 
21 #include <libchdr/libchdr_zlib.h>
22 
23 /* codec-private data for the LZMA codec */
24 #define MAX_LZMA_ALLOCS 64
25 
28 {
29  void *(*Alloc)(void *p, size_t size);
30  void (*Free)(void *p, void *address); /* address can be 0 */
31  void (*FreeSz)(void *p, void *address, size_t size); /* address can be 0 */
33 };
34 
37 {
40 };
41 
42 /* codec-private data for the CDLZ codec */
45  /* internal state */
47 #ifdef WANT_SUBCODE
48  zlib_codec_data subcode_decompressor;
49 #endif
51 };
52 
53 chd_error lzma_codec_init(void* codec, uint32_t hunkbytes);
54 
55 void lzma_codec_free(void* codec);
56 
57 /*-------------------------------------------------
58  * decompress - decompress data using the LZMA
59  * codec
60  *-------------------------------------------------
61  */
62 
63 chd_error lzma_codec_decompress(void* codec, const uint8_t *src,
64  uint32_t complen, uint8_t *dest, uint32_t destlen);
65 
66 chd_error cdlz_codec_init(void* codec, uint32_t hunkbytes);
67 
68 void cdlz_codec_free(void* codec);
69 
70 chd_error cdlz_codec_decompress(void *codec, const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen);
71 
72 #endif /* __LIBCHDR_LZMA_H__ */
lzma_allocator allocator
Definition: lzma.h:39
uint8_t * buffer
Definition: lzma.h:50
Definition: LzmaDec.h:39
GLuint address
Definition: glext.h:10300
void(* FreeSz)(void *p, void *address, size_t size)
Definition: lzma.h:31
enum _chd_error chd_error
Definition: chd.h:280
GLsizeiptr size
Definition: glext.h:6559
chd_error lzma_codec_decompress(void *codec, const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen)
Definition: libchdr_lzma.c:254
Definition: lzma.h:27
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
Definition: lzma.h:44
#define MAX_LZMA_ALLOCS
Definition: lzma.h:24
chd_error lzma_codec_init(void *codec, uint32_t hunkbytes)
Definition: libchdr_lzma.c:183
chd_error cdlz_codec_decompress(void *codec, const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen)
Definition: libchdr_lzma.c:308
CLzmaDec decoder
Definition: lzma.h:38
GLenum src
Definition: glext.h:6980
GLfloat GLfloat p
Definition: glext.h:9809
Definition: libchdr_zlib.h:33
chd_error cdlz_codec_init(void *codec, uint32_t hunkbytes)
Definition: libchdr_lzma.c:273
void cdlz_codec_free(void *codec)
Definition: libchdr_lzma.c:296
void lzma_codec_free(void *codec)
Definition: libchdr_lzma.c:238
void(* Free)(void *p, void *address)
Definition: lzma.h:30
unsigned char uint8_t
Definition: stdint.h:124
uint32_t * allocptr[MAX_LZMA_ALLOCS]
Definition: lzma.h:32
lzma_codec_data base_decompressor
Definition: lzma.h:46
unsigned int uint32_t
Definition: stdint.h:126
Definition: lzma.h:36