|
JubeatPlus 3.9.11
|
The stdio I/O callbacks the game hands to minizip's unzip API. More...

Go to the source code of this file.
Classes | |
| struct | zlib_filefunc_def_s |
| The table of I/O callbacks minizip drives an archive through. More... | |
Typedefs | |
| typedef void * | voidpf |
| minizip's opaque pointer type. | |
| typedef unsigned long | uLong |
minizip's wide unsigned integer type (zlib's uLong). | |
| typedef voidpf(* | open_file_func) (voidpf opaque, const char *filename, int mode) |
| Callback that opens a file and returns its stream. | |
| typedef uLong(* | read_file_func) (voidpf opaque, voidpf stream, void *buf, uLong size) |
| Callback that reads bytes from a stream. | |
| typedef uLong(* | write_file_func) (voidpf opaque, voidpf stream, const void *buf, uLong size) |
| Callback that writes bytes to a stream. | |
| typedef long(* | tell_file_func) (voidpf opaque, voidpf stream) |
| Callback that reports the current position of a stream. | |
| typedef long(* | seek_file_func) (voidpf opaque, voidpf stream, uLong offset, int origin) |
| Callback that seeks a stream. | |
| typedef int(* | close_file_func) (voidpf opaque, voidpf stream) |
| Callback that closes a stream. | |
| typedef int(* | testerror_file_func) (voidpf opaque, voidpf stream) |
| Callback that reports the error state of a stream. | |
| typedef struct zlib_filefunc_def_s | zlib_filefunc_def |
| The table of I/O callbacks minizip drives an archive through. | |
Functions | |
| voidpf | fopen_file_func (voidpf opaque, const char *filename, int mode) |
Maps a ZLIB_FILEFUNC_MODE_* bitmask to an fopen mode string and opens the file. | |
| uLong | fread_file_func (voidpf opaque, voidpf stream, void *buf, uLong size) |
Reads size bytes from stream into buf. | |
| uLong | fwrite_file_func (voidpf opaque, voidpf stream, const void *buf, uLong size) |
Writes size bytes from buf to stream. | |
| long | ftell_file_func (voidpf opaque, voidpf stream) |
Reports the current position of stream. | |
| long | fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) |
Seeks stream, translating success to 0 and failure to -1. | |
| int | fclose_file_func (voidpf opaque, voidpf stream) |
Closes stream. | |
| int | ferror_file_func (voidpf opaque, voidpf stream) |
Reports the error state of stream. | |
| void | fill_fopen_filefunc (zlib_filefunc_def *pzlib_filefunc_def) |
Fills pzlib_filefunc_def with the stdio implementations and a nullptr opaque cookie. | |
The stdio I/O callbacks the game hands to minizip's unzip API.
Reconstructed from Ghidra program Jubeat (image base 0x100000000). All
contrib/minizip/ioapi.c file function set: a zlib_filefunc_def table whose seven members forward to the C stdio routines, filled by fill_fopen_filefunc. | typedef struct zlib_filefunc_def_s zlib_filefunc_def |
The table of I/O callbacks minizip drives an archive through.
The layout matches the stores in fill_fopen_filefunc: eight pointer-sized fields, the seven callbacks followed by the opaque cookie, totalling 0x40 bytes.
Closes stream.
| opaque | The opaque cookie; unused. |
| stream | The FILE * to close. |
fclose. Reports the error state of stream.
| opaque | The opaque cookie; unused. |
| stream | The FILE * to query. |
ferror. | void fill_fopen_filefunc | ( | zlib_filefunc_def * | pzlib_filefunc_def | ) |
Fills pzlib_filefunc_def with the stdio implementations and a nullptr opaque cookie.
| pzlib_filefunc_def | The table to populate; written unconditionally with no nullptr check. |
Maps a ZLIB_FILEFUNC_MODE_* bitmask to an fopen mode string and opens the file.
The mode is selected by priority: read (mode & 3 == 1) becomes "rb", otherwise an existing file (mode & 4) becomes "r+b", otherwise create (mode & 8) becomes "wb"; any other bitmask selects no string. opaque is unused.
| opaque | The zlib_filefunc_def opaque cookie; unused. |
| filename | The path to open. |
| mode | A ZLIB_FILEFUNC_MODE_* bitmask. |
FILE * as a voidpf, or nullptr when filename is nullptr or the bits select no mode string. Reads size bytes from stream into buf.
| opaque | The opaque cookie; unused. |
| stream | The FILE * to read from. |
| buf | The destination buffer. |
| size | The number of bytes to read. |
Seeks stream, translating success to 0 and failure to -1.
| opaque | The opaque cookie; unused. |
| stream | The FILE * to seek. |
| offset | The byte offset. |
| origin | A ZLIB_FILEFUNC_SEEK_* value. |
Reports the current position of stream.
| opaque | The opaque cookie; unused. |
| stream | The FILE * to query. |
Writes size bytes from buf to stream.
| opaque | The opaque cookie; unused. |
| stream | The FILE * to write to. |
| buf | The source buffer. |
| size | The number of bytes to write. |