UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
ioapi.h
Go to the documentation of this file.
1
/* ioapi.h -- IO base function header for compress/uncompress .zip
2
files using zlib + zip or unzip API
3
4
Version 1.01e, February 12th, 2005
5
6
Copyright (C) 1998-2005 Gilles Vollant
7
*/
8
9
#pragma once
10
11
12
#define ZLIB_FILEFUNC_SEEK_CUR (1)
13
#define ZLIB_FILEFUNC_SEEK_END (2)
14
#define ZLIB_FILEFUNC_SEEK_SET (0)
15
16
#define ZLIB_FILEFUNC_MODE_READ (1)
17
#define ZLIB_FILEFUNC_MODE_WRITE (2)
18
#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
19
20
#define ZLIB_FILEFUNC_MODE_EXISTING (4)
21
#define ZLIB_FILEFUNC_MODE_CREATE (8)
22
23
24
#ifndef ZCALLBACK
25
26
#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
27
#define ZCALLBACK CALLBACK
28
#else
29
#define ZCALLBACK
30
#endif
31
#endif
32
33
#ifndef OF
34
#define OF(args) args
35
#endif
36
37
#ifdef __cplusplus
38
extern
"C"
{
39
#endif
40
41
typedef
voidpf
(
ZCALLBACK
* open_file_func)
OF
((
voidpf
opaque,
const
char
*
filename
,
int
mode
));
42
typedef
uLong
(
ZCALLBACK
* read_file_func)
OF
((
voidpf
opaque,
voidpf
stream
,
void
*
buf
,
uLong
size
));
43
typedef
uLong
(
ZCALLBACK
* write_file_func)
OF
((
voidpf
opaque,
voidpf
stream
,
const
void
*
buf
,
uLong
size
));
44
typedef
long
(
ZCALLBACK
* tell_file_func)
OF
((
voidpf
opaque,
voidpf
stream
));
45
typedef
long
(
ZCALLBACK
* seek_file_func)
OF
((
voidpf
opaque,
voidpf
stream
,
uLong
offset
,
int
origin
));
46
typedef
int
(
ZCALLBACK
* close_file_func)
OF
((
voidpf
opaque,
voidpf
stream
));
47
typedef
int
(
ZCALLBACK
* testerror_file_func)
OF
((
voidpf
opaque,
voidpf
stream
));
48
49
typedef
struct
zlib_filefunc_def_s
50
{
51
open_file_func
zopen_file
;
52
read_file_func
zread_file
;
53
write_file_func
zwrite_file
;
54
tell_file_func
ztell_file
;
55
seek_file_func
zseek_file
;
56
close_file_func
zclose_file
;
57
testerror_file_func
zerror_file
;
58
voidpf
opaque
;
59
}
zlib_filefunc_def
;
60
61
62
63
void
fill_fopen_filefunc
OF
((
zlib_filefunc_def
* pzlib_filefunc_def));
64
65
#define ZREAD(filefunc, filestream, buf, size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size))
66
#define ZWRITE(filefunc, filestream, buf, size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))
67
#define ZTELL(filefunc, filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream))
68
#define ZSEEK(filefunc, filestream, pos, mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode))
69
#define ZCLOSE(filefunc, filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
70
#define ZERROR(filefunc, filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
71
72
73
#ifdef __cplusplus
74
}
75
#endif
fill_fopen_filefunc
void fill_fopen_filefunc(zlib_filefunc_def *pzlib_filefunc_def)
Definition
ioapi.cpp:95
size
voidpf void uLong size
Definition
ioapi.h:42
voidpf
typedef voidpf(ZCALLBACK *open_file_func) OF((voidpf opaque
long
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque
stream
voidpf stream
Definition
ioapi.h:42
uLong
typedef uLong(ZCALLBACK *read_file_func) OF((voidpf opaque
origin
voidpf uLong int origin
Definition
ioapi.h:45
int
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
filename
const char * filename
Definition
ioapi.h:41
buf
voidpf void * buf
Definition
ioapi.h:42
OF
#define OF(args)
Definition
ioapi.h:34
ZCALLBACK
#define ZCALLBACK
Definition
ioapi.h:29
mode
const char int mode
Definition
ioapi.h:41
offset
voidpf uLong offset
Definition
ioapi.h:45
zlib_filefunc_def
Definition
ioapi.h:50
zlib_filefunc_def::zseek_file
seek_file_func zseek_file
Definition
ioapi.h:55
zlib_filefunc_def::zopen_file
open_file_func zopen_file
Definition
ioapi.h:51
zlib_filefunc_def::zwrite_file
write_file_func zwrite_file
Definition
ioapi.h:53
zlib_filefunc_def::opaque
voidpf opaque
Definition
ioapi.h:58
zlib_filefunc_def::zerror_file
testerror_file_func zerror_file
Definition
ioapi.h:57
zlib_filefunc_def::zread_file
read_file_func zread_file
Definition
ioapi.h:52
zlib_filefunc_def::ztell_file
tell_file_func ztell_file
Definition
ioapi.h:54
zlib_filefunc_def::zclose_file
close_file_func zclose_file
Definition
ioapi.h:56
src
common
ioapi.h
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0