GraphicsAPI_2020C
cfileio.h
Go to the documentation of this file.
1 /*
2 ---------------------------------------------------------------------------
3 Open Asset Import Library (assimp)
4 ---------------------------------------------------------------------------
5 
6 Copyright (c) 2006-2017, assimp team
7 
8 
9 All rights reserved.
10 
11 Redistribution and use of this software in source and binary forms,
12 with or without modification, are permitted provided that the following
13 conditions are met:
14 
15 * Redistributions of source code must retain the above
16  copyright notice, this list of conditions and the
17  following disclaimer.
18 
19 * Redistributions in binary form must reproduce the above
20  copyright notice, this list of conditions and the
21  following disclaimer in the documentation and/or other
22  materials provided with the distribution.
23 
24 * Neither the name of the assimp team, nor the names of its
25  contributors may be used to endorse or promote products
26  derived from this software without specific prior
27  written permission of the assimp team.
28 
29 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 ---------------------------------------------------------------------------
41 */
42 
46 #pragma once
47 #ifndef AI_FILEIO_H_INC
48 #define AI_FILEIO_H_INC
49 
50 #include <assimp/types.h>
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 struct aiFileIO;
55 struct aiFile;
56 
57 // aiFile callbacks
58 typedef size_t (*aiFileWriteProc) (C_STRUCT aiFile*, const char*, size_t, size_t);
59 typedef size_t (*aiFileReadProc) (C_STRUCT aiFile*, char*, size_t,size_t);
60 typedef size_t (*aiFileTellProc) (C_STRUCT aiFile*);
61 typedef void (*aiFileFlushProc) (C_STRUCT aiFile*);
62 typedef C_ENUM aiReturn (*aiFileSeek) (C_STRUCT aiFile*, size_t, C_ENUM aiOrigin);
63 
64 // aiFileIO callbacks
65 typedef C_STRUCT aiFile* (*aiFileOpenProc) (C_STRUCT aiFileIO*, const char*, const char*);
66 typedef void (*aiFileCloseProc) (C_STRUCT aiFileIO*, C_STRUCT aiFile*);
67 
68 // Represents user-defined data
69 typedef char* aiUserData;
70 
71 // ----------------------------------------------------------------------------------
78 struct aiFileIO
79 {
82  aiFileOpenProc OpenProc;
83 
86  aiFileCloseProc CloseProc;
87 
89  aiUserData UserData;
90 };
91 
92 // ----------------------------------------------------------------------------------
102 struct aiFile
103 {
105  aiFileReadProc ReadProc;
106 
108  aiFileWriteProc WriteProc;
109 
113  aiFileTellProc TellProc;
114 
118  aiFileTellProc FileSizeProc;
119 
123  aiFileSeek SeekProc;
124 
127  aiFileFlushProc FlushProc;
128 
131  aiUserData UserData;
132 };
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 #endif // AI_FILEIO_H_INC
Basic data types and primitives, such as vectors or colors.
C-API: File system callbacks.
Definition: cfileio.h:78
C-API: File callbacks.
Definition: cfileio.h:102
aiFileOpenProc OpenProc
Function used to open a new file.
Definition: cfileio.h:82
aiReturn
Standard return type for some library functions.
Definition: types.h:375
aiUserData UserData
User-defined, opaque data.
Definition: cfileio.h:131
aiOrigin
Seek origins (for the virtual file system API).
Definition: types.h:405
aiFileCloseProc CloseProc
Function used to close an existing file.
Definition: cfileio.h:86
aiUserData UserData
User-defined, opaque data.
Definition: cfileio.h:89