resonance 1.0.1
Loading...
Searching...
No Matches
inflate.h File Reference

Go to the source code of this file.

Enumerations

enum  InflateResult { kInflateOk = 0 , kInflateError = 1 , kInflateBadCodes = 2 , kInflateOutOfMemory = 3 }
 Results that inflate() and the routines under it report. More...

Functions

int inflate (void)
 Decode a whole deflate stream into the window, flushing it to the output.
void HuftReset (void)
 Record the pool high-water mark and rewind the pool to its start.
struct huft * HuftMalloc (unsigned nEntries)
 Carve a decoding table from the pool, in place of the heap.

Enumeration Type Documentation

◆ InflateResult

Results that inflate() and the routines under it report.

Enumerator
kInflateOk 

The data decoded.

kInflateError 

Corrupt data, or an incomplete code set.

kInflateBadCodes 

Over-subscribed code lengths, or an unknown block type.

kInflateOutOfMemory 

The table pool is exhausted.

Function Documentation

◆ inflate()

int inflate ( void )

Decode a whole deflate stream into the window, flushing it to the output.

The table pool is rewound before each block. On success any whole bytes read ahead into the bit buffer are returned to the staging buffer. The gzip trailer is neither read nor checked.

Returns
kInflateOk, or the failure of the block decoder.
Ghidra address:
NTSC-U/C: 0x0063e0b0
Ghidra address:
PAL: 0x0067ec40

◆ HuftReset()

void HuftReset ( void )

Record the pool high-water mark and rewind the pool to its start.

inflate() calls it before each block.

Ghidra address:
NTSC-U/C: 0x0063e1a8
Ghidra address:
PAL: 0x0067ed38

◆ HuftMalloc()

struct huft * HuftMalloc ( unsigned nEntries)

Carve a decoding table from the pool, in place of the heap.

The cursor is advanced even when the allocation fails, and an allocation that ends exactly at the end of the pool fails.

Parameters
nEntriesThe number of entries, including the link entry.
Returns
The table, or null after logging when the pool is exhausted.
Ghidra address:
NTSC-U/C: 0x0063e1e0
Ghidra address:
PAL: 0x0067ed70