wavelength 1.0.0
Loading...
Searching...
No Matches
loadfile.h File Reference

Go to the source code of this file.

Functions

void GzipInit ()
 Mark the gzip module initialized.
int GzipFdToRam (int nFile, void *pDest, int bCompress)
 Decompress or compress the gzip input to a buffer.
int GzipDecompressRamToRam (const void *pSource, int nSourceLength, void *pDest)
 Inflate a gzip member that is already in memory, naming the input (in-memory).
int GzipSizeDecompressed (const void *pSource, int nSourceLength)
 Report the uncompressed length a gzip member in memory records in its trailer.
int GzipCompressRamToRam (const void *pSource, int nSourceLength, void *pDest)
 Deflate bytes in memory into a gzip member, naming the input (in-memory).
void GzipFileName (const char *pszFile, int bGenerated, char *pszOut)
 Write the name of the compressed copy of a file.

Function Documentation

◆ GzipInit()

void GzipInit ( )

Mark the gzip module initialized.

Only GzipInit() reads the flag.

Ghidra address:
NTSC-U/C: 0x002834b8
Ghidra address:
PAL: 0x0028cd68

◆ GzipFdToRam()

int GzipFdToRam ( int nFile,
void * pDest,
int bCompress )

Decompress or compress the gzip input to a buffer.

Decompression reads the member header and inflates the data without checking the trailer. Compression writes a whole member. The file is not closed.

The name is inferred.

Parameters
nFileThe file to read, or -1 for the memory source.
pDestThe destination.
bCompressNon-zero to compress, zero to decompress.
Returns
The number of bytes written, or -1 on failure.
Ghidra address:
NTSC-U/C: 0x002834d8
Ghidra address:
PAL: 0x0028cd88

◆ GzipDecompressRamToRam()

int GzipDecompressRamToRam ( const void * pSource,
int nSourceLength,
void * pDest )

Inflate a gzip member that is already in memory, naming the input (in-memory).

The source and destination windows may overlap, and every caller in the async layer relies on the overlap. The stored bytes sit against the end of the destination, and the inflate runs forward over the whole destination.

Parameters
pSourceThe stored bytes.
nSourceLengthThe number of bytes the inflate may read.
pDestThe destination.
Returns
The number of bytes written, or -1 on failure.
Ghidra address:
NTSC-U/C: 0x002835b0
Ghidra address:
PAL: 0x0028ce60

◆ GzipSizeDecompressed()

int GzipSizeDecompressed ( const void * pSource,
int nSourceLength )

Report the uncompressed length a gzip member in memory records in its trailer.

The length is the last four bytes of the member, read without regard to alignment.

Parameters
pSourceThe stored bytes.
nSourceLengthThe number of stored bytes.
Returns
The uncompressed length.
Ghidra address:
NTSC-U/C: 0x00283620
Ghidra address:
PAL: 0x0028ced0

◆ GzipCompressRamToRam()

int GzipCompressRamToRam ( const void * pSource,
int nSourceLength,
void * pDest )

Deflate bytes in memory into a gzip member, naming the input (in-memory).

The name is inferred.

Parameters
pSourceThe bytes.
nSourceLengthThe number of bytes.
pDestThe destination, which may be the source.
Returns
The length of the member, or -1 on failure.
Ghidra address:
NTSC-U/C: 0x00283648
Ghidra address:
PAL: 0x0028cef8

◆ GzipFileName()

void GzipFileName ( const char * pszFile,
int bGenerated,
char * pszOut )

Write the name of the compressed copy of a file.

The name is inferred.

Parameters
pszFileThe file.
bGeneratedNon-zero for the copy under gen beside the file, <dir>/gen/<base>.<ext>.gz. Otherwise the copy is the file with .gz appended.
pszOutReceives the name.
Ghidra address:
NTSC-U/C: 0x002836b8
Ghidra address:
PAL: 0x0028cf68