libdragon
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
aplib_dec.c File Reference

Data Structures

struct  aplib_decompressor_t
 APLib decompressor. More...
 
struct  aplib_decompressor_t.partial
 

Macros

#define MINMATCH3_OFFSET   1280
 Minimum match offset for 3-byte matches.
 
#define MINMATCH4_OFFSET   32000
 Minimum match offset for 4-byte matches.
 

Functions

void decompress_aplib_init (void *state, int fd, int winsize)
 Initialize APLIB decompressor.
 
void decompress_aplib_reset (void *state)
 Reset APLIB decompressor state.
 
ssize_t decompress_aplib_read (void *state, void *buf, size_t len)
 Read decompressed data from APLIB decompressor.
 
void * decompress_aplib_full (const char *fn, int fd, size_t cmp_size, size_t size)
 Decompress entire APLIB file.
 

Detailed Description

Author
Giovanni Bajo giova.nosp@m.nnib.nosp@m.ajo@g.nosp@m.mail.nosp@m..com

Data Structure Documentation

◆ aplib_decompressor_t

struct aplib_decompressor_t

APLib decompressor.

Data Fields
uint8_t buf[2][128] Buffer of loaded data.
int cur_buf Current buffer being used.
uint8_t * buf_ptr Pointer to data being processed.
uint8_t * buf_end Pointer to end of current loaded data.
uint8_t cc Current byte being processed.
int shift Current bit being processed.
int fd File being read from.
uint32_t rom_addr ROM address being read from (optional)
bool eof Whether the end of the stream has been reached.
struct aplib_decompressor_t.partial partial Partial decompression state.

◆ aplib_decompressor_t.partial

struct aplib_decompressor_t.partial
Data Fields
decompress_ringbuf_t ringbuf Ring buffer.
bool first_literal_done Whether the first literal has been written.
int nlit Number of expected literals.
int match_off Offset of the match.
int match_len Length of the match.