-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaifileio.inc
executable file
·76 lines (64 loc) · 2.43 KB
/
aifileio.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//from fileio.inc
type
PaiFileIO = ^TaiFileIO;
PaiFile = ^TaiFile;
// aiFile callbacks
TaiFileWriteProc = function(a: PaiFile; const b: PChar; c, d: size_t): size_t;
TaiFileReadProc = function(a: PaiFile; b: PChar; c, d: size_t): size_t;
TaiFileTellProc = function(a: PaiFile): size_t;
TaiFileFlushProc = procedure(a: PaiFile);
TaiFileSeek = function(a: PaiFile; b: size_t; c: TaiOrigin): TaiReturn;
// aiFileIO callbacks
TaiFileOpenProc = function(a: PaiFileIO; b, c: PChar): PaiFile;
TaiFileCloseProc = procedure(a: PaiFileIO; b: PaiFile);
// Represents user-defined data
TaiUserData = PChar;
// ----------------------------------------------------------------------------------
{** @brief C-API: File system callbacks
*
* Provided are functions to open and close files. Supply a custom structure to
* the import function. If you don't, a default implementation is used. Use custom
* file systems to enable reading from other sources, such as ZIPs
* or memory locations. *}
TaiFileIO = record
{** Function used to open a new file *}
OpenProc: TaiFileOpenProc;
{** Function used to close an existing file *}
CloseProc: TaiFileCloseProc;
{** User-defined, opaque data *}
UserData: TaiUserData;
end;
// ----------------------------------------------------------------------------------
{** @brief C-API: File callbacks
*
* Actually, it's a data structure to wrap a set of fXXXX (e.g fopen)
* replacement functions.
*
* The default implementation of the functions utilizes the fXXX functions from
* the CRT. However, you can supply a custom implementation to Assimp by
* delivering a custom aiFileIO. Use this to enable reading from other sources,
* such as ZIP archives or memory locations. *}
TaiFile = record
{** Callback to read from a file *}
ReadProc: TaiFileReadProc;
{** Callback to write to a file *}
WriteProc: TaiFileWriteProc;
{** Callback to retrieve the current position of
* the file cursor (ftell())
*}
TellProc: TaiFileTellProc;
{** Callback to retrieve the size of the file,
* in bytes
*}
FileSizeProc: TaiFileTellProc;
{** Callback to set the current position
* of the file cursor (fseek())
*}
SeekProc: TaiFileSeek;
{** Callback to flush the file contents
*}
FlushProc: TaiFileFlushProc;
{** User-defined, opaque data
*}
UserData: TaiUserData;
end;