Path Tracer
cfileio.h
Go to the documentation of this file.
1 /*
2 ---------------------------------------------------------------------------
3 Open Asset Import Library (assimp)
4 ---------------------------------------------------------------------------
5 
6 Copyright (c) 2006-2020, assimp team
7 
8 
9 
10 All rights reserved.
11 
12 Redistribution and use of this software in source and binary forms,
13 with or without modification, are permitted provided that the following
14 conditions are met:
15 
16 * Redistributions of source code must retain the above
17  copyright notice, this list of conditions and the
18  following disclaimer.
19 
20 * Redistributions in binary form must reproduce the above
21  copyright notice, this list of conditions and the
22  following disclaimer in the documentation and/or other
23  materials provided with the distribution.
24 
25 * Neither the name of the assimp team, nor the names of its
26  contributors may be used to endorse or promote products
27  derived from this software without specific prior
28  written permission of the assimp team.
29 
30 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 ---------------------------------------------------------------------------
42 */
43 
47 #pragma once
48 #ifndef AI_FILEIO_H_INC
49 #define AI_FILEIO_H_INC
50 
51 #ifdef __GNUC__
52 # pragma GCC system_header
53 #endif
54 
55 #include <assimp/types.h>
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 struct aiFileIO;
62 struct aiFile;
63 
64 // aiFile callbacks
65 typedef size_t (*aiFileWriteProc) (C_STRUCT aiFile*, const char*, size_t, size_t);
66 typedef size_t (*aiFileReadProc) (C_STRUCT aiFile*, char*, size_t,size_t);
67 typedef size_t (*aiFileTellProc) (C_STRUCT aiFile*);
68 typedef void (*aiFileFlushProc) (C_STRUCT aiFile*);
69 typedef C_ENUM aiReturn (*aiFileSeek) (C_STRUCT aiFile*, size_t, C_ENUM aiOrigin);
70 
71 // aiFileIO callbacks
72 typedef C_STRUCT aiFile* (*aiFileOpenProc) (C_STRUCT aiFileIO*, const char*, const char*);
73 typedef void (*aiFileCloseProc) (C_STRUCT aiFileIO*, C_STRUCT aiFile*);
74 
75 // Represents user-defined data
76 typedef char* aiUserData;
77 
78 // ----------------------------------------------------------------------------------
85 struct aiFileIO
86 {
89  aiFileOpenProc OpenProc;
90 
93  aiFileCloseProc CloseProc;
94 
96  aiUserData UserData;
97 };
98 
99 // ----------------------------------------------------------------------------------
109 struct aiFile
110 {
112  aiFileReadProc ReadProc;
113 
115  aiFileWriteProc WriteProc;
116 
120  aiFileTellProc TellProc;
121 
125  aiFileTellProc FileSizeProc;
126 
130  aiFileSeek SeekProc;
131 
134  aiFileFlushProc FlushProc;
135 
138  aiUserData UserData;
139 };
140 
141 #ifdef __cplusplus
142 }
143 #endif
144 #endif // AI_FILEIO_H_INC
aiOrigin
aiOrigin
Definition: types.h:426
types.h
aiFile::TellProc
aiFileTellProc TellProc
Definition: cfileio.h:120
aiFileIO
C-API: File system callbacks.
Definition: cfileio.h:86
aiFile
C-API: File callbacks.
Definition: cfileio.h:110
aiFile::ReadProc
aiFileReadProc ReadProc
Definition: cfileio.h:112
aiReturn
aiReturn
Definition: types.h:397
aiFile::WriteProc
aiFileWriteProc WriteProc
Definition: cfileio.h:115
aiFile::SeekProc
aiFileSeek SeekProc
Definition: cfileio.h:130
aiFile::FileSizeProc
aiFileTellProc FileSizeProc
Definition: cfileio.h:125
aiFileIO::OpenProc
aiFileOpenProc OpenProc
Definition: cfileio.h:89
aiFile::UserData
aiUserData UserData
Definition: cfileio.h:138
aiFileIO::UserData
aiUserData UserData
Definition: cfileio.h:96
aiFileIO::CloseProc
aiFileCloseProc CloseProc
Definition: cfileio.h:93
aiFile::FlushProc
aiFileFlushProc FlushProc
Definition: cfileio.h:134