JubeatPlus 3.9.11
Loading...
Searching...
No Matches
ioapi.h
Go to the documentation of this file.
1
10
11#ifndef IOAPI_H
12#define IOAPI_H
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
19typedef void *voidpf;
20
22typedef unsigned long uLong;
23
25#define ZLIB_FILEFUNC_MODE_READ 1
27#define ZLIB_FILEFUNC_MODE_WRITE 2
29#define ZLIB_FILEFUNC_MODE_READWRITEFILTER 3
31#define ZLIB_FILEFUNC_MODE_EXISTING 4
33#define ZLIB_FILEFUNC_MODE_CREATE 8
34
36#define ZLIB_FILEFUNC_SEEK_SET 0
38#define ZLIB_FILEFUNC_SEEK_CUR 1
40#define ZLIB_FILEFUNC_SEEK_END 2
41
43typedef voidpf (*open_file_func)(voidpf opaque, const char *filename, int mode);
45typedef uLong (*read_file_func)(voidpf opaque, voidpf stream, void *buf, uLong size);
47typedef uLong (*write_file_func)(voidpf opaque, voidpf stream, const void *buf, uLong size);
49typedef long (*tell_file_func)(voidpf opaque, voidpf stream);
51typedef long (*seek_file_func)(voidpf opaque, voidpf stream, uLong offset, int origin);
53typedef int (*close_file_func)(voidpf opaque, voidpf stream);
55typedef int (*testerror_file_func)(voidpf opaque, voidpf stream);
56
73
88voidpf fopen_file_func(voidpf opaque, const char *filename, int mode);
89
100uLong fread_file_func(voidpf opaque, voidpf stream, void *buf, uLong size);
101
112uLong fwrite_file_func(voidpf opaque, voidpf stream, const void *buf, uLong size);
113
122long ftell_file_func(voidpf opaque, voidpf stream);
123
134long fseek_file_func(voidpf opaque, voidpf stream, uLong offset, int origin);
135
144int fclose_file_func(voidpf opaque, voidpf stream);
145
154int ferror_file_func(voidpf opaque, voidpf stream);
155
163void fill_fopen_filefunc(zlib_filefunc_def *pzlib_filefunc_def);
164
165#ifdef __cplusplus
166}
167#endif
168
169#endif
int fclose_file_func(voidpf opaque, voidpf stream)
Closes stream.
Definition ioapi.c:54
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.
Definition ioapi.c:12
uLong(* write_file_func)(voidpf opaque, voidpf stream, const void *buf, uLong size)
Callback that writes bytes to a stream.
Definition ioapi.h:47
int ferror_file_func(voidpf opaque, voidpf stream)
Reports the error state of stream.
Definition ioapi.c:59
uLong fread_file_func(voidpf opaque, voidpf stream, void *buf, uLong size)
Reads size bytes from stream into buf.
Definition ioapi.c:28
long fseek_file_func(voidpf opaque, voidpf stream, uLong offset, int origin)
Seeks stream, translating success to 0 and failure to -1.
Definition ioapi.c:43
uLong(* read_file_func)(voidpf opaque, voidpf stream, void *buf, uLong size)
Callback that reads bytes from a stream.
Definition ioapi.h:45
int(* testerror_file_func)(voidpf opaque, voidpf stream)
Callback that reports the error state of a stream.
Definition ioapi.h:55
long ftell_file_func(voidpf opaque, voidpf stream)
Reports the current position of stream.
Definition ioapi.c:38
long(* seek_file_func)(voidpf opaque, voidpf stream, uLong offset, int origin)
Callback that seeks a stream.
Definition ioapi.h:51
int(* close_file_func)(voidpf opaque, voidpf stream)
Callback that closes a stream.
Definition ioapi.h:53
uLong fwrite_file_func(voidpf opaque, voidpf stream, const void *buf, uLong size)
Writes size bytes from buf to stream.
Definition ioapi.c:33
struct zlib_filefunc_def_s zlib_filefunc_def
The table of I/O callbacks minizip drives an archive through.
void fill_fopen_filefunc(zlib_filefunc_def *pzlib_filefunc_def)
Fills pzlib_filefunc_def with the stdio implementations and a nullptr opaque cookie.
Definition ioapi.c:64
void * voidpf
minizip's opaque pointer type.
Definition ioapi.h:19
unsigned long uLong
minizip's wide unsigned integer type (zlib's uLong).
Definition ioapi.h:22
long(* tell_file_func)(voidpf opaque, voidpf stream)
Callback that reports the current position of a stream.
Definition ioapi.h:49
voidpf(* open_file_func)(voidpf opaque, const char *filename, int mode)
Callback that opens a file and returns its stream.
Definition ioapi.h:43
The table of I/O callbacks minizip drives an archive through.
Definition ioapi.h:63
seek_file_func zseek_file
Moves the current offset.
Definition ioapi.h:68
voidpf opaque
The cookie handed back to every callback above.
Definition ioapi.h:71
open_file_func zopen_file
Opens the archive.
Definition ioapi.h:64
testerror_file_func zerror_file
Reports the pending error, if any.
Definition ioapi.h:70
write_file_func zwrite_file
Writes bytes to the archive.
Definition ioapi.h:66
read_file_func zread_file
Reads bytes from the archive.
Definition ioapi.h:65
close_file_func zclose_file
Closes the archive.
Definition ioapi.h:69
tell_file_func ztell_file
Reports the current offset.
Definition ioapi.h:67