RetroArch
libchdr_zlib.h
Go to the documentation of this file.
1 /* license:BSD-3-Clause
2  * copyright-holders:Aaron Giles
3  ***************************************************************************
4 
5  libchr_zlib.h
6 
7  Zlib compression wrappers
8 
9 ***************************************************************************/
10 
11 #pragma once
12 
13 #ifndef __LIBCHDR_ZLIB_H__
14 #define __LIBCHDR_ZLIB_H__
15 
16 #include <stdint.h>
17 
18 #include <zlib.h>
19 #include "coretypes.h"
20 #include "chd.h"
21 
22 #define MAX_ZLIB_ALLOCS 64
23 
24 /* codec-private data for the ZLIB codec */
25 
28 {
30 };
31 
34 {
35  z_stream inflater;
37 };
38 
39 
40 /* codec-private data for the CDZL codec */
43  /* internal state */
45 #ifdef WANT_SUBCODE
46  zlib_codec_data subcode_decompressor;
47 #endif
49 };
50 
51 /* zlib compression codec */
52 chd_error zlib_codec_init(void *codec, uint32_t hunkbytes);
53 
54 void zlib_codec_free(void *codec);
55 
56 chd_error zlib_codec_decompress(void *codec, const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen);
57 
58 voidpf zlib_fast_alloc(voidpf opaque, uInt items, uInt size);
59 
60 void zlib_fast_free(voidpf opaque, voidpf address);
61 
62 /* cdzl compression codec */
63 chd_error cdzl_codec_init(void* codec, uint32_t hunkbytes);
64 
65 void cdzl_codec_free(void* codec);
66 
67 chd_error cdzl_codec_decompress(void *codec, const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen);
68 
69 #endif /* __LIBCHDR_ZLIB_H__ */
zlib_allocator allocator
Definition: libchdr_zlib.h:36
#define MAX_ZLIB_ALLOCS
Definition: libchdr_zlib.h:22
z_stream inflater
Definition: libchdr_zlib.h:35
GLuint address
Definition: glext.h:10300
enum _chd_error chd_error
Definition: chd.h:280
GLsizeiptr size
Definition: glext.h:6559
void zlib_codec_free(void *codec)
Definition: libchdr_zlib.c:185
Byte FAR * voidpf
Definition: zconf.h:353
Definition: libchdr_zlib.h:42
voidpf zlib_fast_alloc(voidpf opaque, uInt items, uInt size)
Definition: libchdr_zlib.c:240
UINT32 * allocptr[MAX_ZLIB_ALLOCS]
Definition: libchdr_zlib.h:29
chd_error zlib_codec_decompress(void *codec, const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen)
Definition: libchdr_zlib.c:210
GLenum src
Definition: glext.h:6980
Definition: libchdr_zlib.h:33
chd_error cdzl_codec_init(void *codec, uint32_t hunkbytes)
Definition: libchdr_zlib.c:60
uint32_t UINT32
Definition: coretypes.h:10
Definition: libchdr_zlib.h:27
zlib_codec_data base_decompressor
Definition: libchdr_zlib.h:44
void zlib_fast_free(voidpf opaque, voidpf address)
Definition: libchdr_zlib.c:284
uint8_t * buffer
Definition: libchdr_zlib.h:48
unsigned int uInt
Definition: zconf.h:333
chd_error cdzl_codec_decompress(void *codec, const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen)
Definition: libchdr_zlib.c:98
unsigned char uint8_t
Definition: stdint.h:124
unsigned int uint32_t
Definition: stdint.h:126
void cdzl_codec_free(void *codec)
Definition: libchdr_zlib.c:86
chd_error zlib_codec_init(void *codec, uint32_t hunkbytes)
Definition: libchdr_zlib.c:152