orx  stable
Portable Game Engine
orxResource.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2017 Orx-Project
4  *
5  * This software is provided 'as-is', without any express or implied
6  * warranty. In no event will the authors be held liable for any damages
7  * arising from the use of this software.
8  *
9  * Permission is granted to anyone to use this software for any purpose,
10  * including commercial applications, and to alter it and redistribute it
11  * freely, subject to the following restrictions:
12  *
13  * 1. The origin of this software must not be misrepresented; you must not
14  * claim that you wrote the original software. If you use this software
15  * in a product, an acknowledgment in the product documentation would be
16  * appreciated but is not required.
17  *
18  * 2. Altered source versions must be plainly marked as such, and must not be
19  * misrepresented as being the original software.
20  *
21  * 3. This notice may not be removed or altered from any source
22  * distribution.
23  */
24 
40 #ifndef _orxRESOURCE_H_
41 #define _orxRESOURCE_H_
42 
43 
44 #include "orxInclude.h"
45 
46 
47 #define orxRESOURCE_KC_LOCATION_SEPARATOR ':'
48 
49 
52 typedef void (orxFASTCALL *orxRESOURCE_OP_FUNCTION)(orxHANDLE _hResource, orxS64 _s64Size, void *_pBuffer, void *_pContext);
53 
54 
57 typedef const orxSTRING (orxFASTCALL *orxRESOURCE_FUNCTION_LOCATE)(const orxSTRING _zStorage, const orxSTRING _zName, orxBOOL _bRequireExistence);
58 typedef orxS64 (orxFASTCALL *orxRESOURCE_FUNCTION_GET_TIME)(const orxSTRING _zPath);
59 typedef orxHANDLE (orxFASTCALL *orxRESOURCE_FUNCTION_OPEN)(const orxSTRING _zPath, orxBOOL _bEraseMode);
60 typedef void (orxFASTCALL *orxRESOURCE_FUNCTION_CLOSE)(orxHANDLE _hResource);
61 typedef orxS64 (orxFASTCALL *orxRESOURCE_FUNCTION_GET_SIZE)(orxHANDLE _hResource);
62 typedef orxS64 (orxFASTCALL *orxRESOURCE_FUNCTION_SEEK)(orxHANDLE _hResource, orxS64 _s64Offset, orxSEEK_OFFSET_WHENCE _eWhence);
63 typedef orxS64 (orxFASTCALL *orxRESOURCE_FUNCTION_TELL)(orxHANDLE _hResource);
64 typedef orxS64 (orxFASTCALL *orxRESOURCE_FUNCTION_READ)(orxHANDLE _hResource, orxS64 _s64Size, void *_pBuffer);
65 typedef orxS64 (orxFASTCALL *orxRESOURCE_FUNCTION_WRITE)(orxHANDLE _hResource, orxS64 _s64Size, const void *_pBuffer);
66 
69 typedef struct __orxRESOURCE_TYPE_INFO_t
70 {
71  const orxSTRING zTag;
83 
86 typedef enum __orxRESOURCE_EVENT_t
87 {
91 
93 
94  orxRESOURCE_EVENT_NONE = orxENUM_NONE
95 
97 
100 typedef struct __orxRESOURCE_EVENT_PAYLOAD_t
101 {
102  orxS64 s64Time;
103  const orxSTRING zLocation;
105  orxU32 u32GroupID;
106  orxU32 u32NameID;
109 
110 
113 extern orxDLLAPI void orxFASTCALL orxResource_Setup();
114 
118 extern orxDLLAPI orxSTATUS orxFASTCALL orxResource_Init();
119 
122 extern orxDLLAPI void orxFASTCALL orxResource_Exit();
123 
124 
128 extern orxDLLAPI orxU32 orxFASTCALL orxResource_GetGroupCounter();
129 
134 extern orxDLLAPI const orxSTRING orxFASTCALL orxResource_GetGroup(orxU32 _u32Index);
135 
136 
143 extern orxDLLAPI orxSTATUS orxFASTCALL orxResource_AddStorage(const orxSTRING _zGroup, const orxSTRING _zStorage, orxBOOL _bAddFirst);
144 
150 extern orxDLLAPI orxSTATUS orxFASTCALL orxResource_RemoveStorage(const orxSTRING _zGroup, const orxSTRING _zStorage);
151 
156 extern orxDLLAPI orxU32 orxFASTCALL orxResource_GetStorageCounter(const orxSTRING _zGroup);
157 
163 extern orxDLLAPI const orxSTRING orxFASTCALL orxResource_GetStorage(const orxSTRING _zGroup, orxU32 _u32Index);
164 
168 extern orxDLLAPI orxSTATUS orxFASTCALL orxResource_ReloadStorage();
169 
170 
176 extern orxDLLAPI const orxSTRING orxFASTCALL orxResource_Locate(const orxSTRING _zGroup, const orxSTRING _zName);
177 
184 extern orxDLLAPI const orxSTRING orxFASTCALL orxResource_LocateInStorage(const orxSTRING _zGroup, const orxSTRING _zStorage, const orxSTRING _zName);
185 
190 extern orxDLLAPI const orxSTRING orxFASTCALL orxResource_GetPath(const orxSTRING _zLocation);
191 
196 extern orxDLLAPI const orxRESOURCE_TYPE_INFO *orxFASTCALL orxResource_GetType(const orxSTRING _zLocation);
197 
198 
203 extern orxDLLAPI orxS64 orxFASTCALL orxResource_GetTime(const orxSTRING _zLocation);
204 
210 extern orxDLLAPI orxHANDLE orxFASTCALL orxResource_Open(const orxSTRING _zLocation, orxBOOL _bEraseMode);
211 
215 extern orxDLLAPI void orxFASTCALL orxResource_Close(orxHANDLE _hResource);
216 
221 extern orxDLLAPI const orxSTRING orxFASTCALL orxResource_GetLocation(orxHANDLE _hResource);
222 
227 extern orxDLLAPI orxS64 orxFASTCALL orxResource_GetSize(orxHANDLE _hResource);
228 
235 extern orxDLLAPI orxS64 orxFASTCALL orxResource_Seek(orxHANDLE _hResource, orxS64 _s64Offset, orxSEEK_OFFSET_WHENCE _eWhence);
236 
241 extern orxDLLAPI orxS64 orxFASTCALL orxResource_Tell(orxHANDLE _hResource);
242 
251 extern orxDLLAPI orxS64 orxFASTCALL orxResource_Read(orxHANDLE _hResource, orxS64 _s64Size, void *_pBuffer, orxRESOURCE_OP_FUNCTION _pfnCallback, void *_pContext);
252 
261 extern orxDLLAPI orxS64 orxFASTCALL orxResource_Write(orxHANDLE _hResource, orxS64 _s64Size, const void *_pBuffer, orxRESOURCE_OP_FUNCTION _pfnCallback, void *_pContext);
262 
263 
268 extern orxDLLAPI orxU32 orxFASTCALL orxResource_GetPendingOpCounter(const orxHANDLE _hResource);
269 
273 extern orxDLLAPI orxU32 orxFASTCALL orxResource_GetTotalPendingOpCounter();
274 
275 
280 extern orxDLLAPI orxSTATUS orxFASTCALL orxResource_RegisterType(const orxRESOURCE_TYPE_INFO *_pstInfo);
281 
285 extern orxDLLAPI orxU32 orxFASTCALL orxResource_GetTypeCounter();
286 
291 extern orxDLLAPI const orxSTRING orxFASTCALL orxResource_GetTypeTag(orxU32 _u32Index);
292 
293 
297 extern orxDLLAPI orxSTATUS orxFASTCALL orxResource_ClearCache();
298 
299 
300 #endif /* _orxRESOURCE_H_ */
301 
orxDLLAPI orxU32 orxFASTCALL orxResource_GetPendingOpCounter(const orxHANDLE _hResource)
orxDLLAPI void orxFASTCALL orxResource_Exit()
orxDLLAPI orxU32 orxFASTCALL orxResource_GetGroupCounter()
const orxSTRING zLocation
Definition: orxResource.h:103
orxDLLAPI orxU32 orxFASTCALL orxResource_GetStorageCounter(const orxSTRING _zGroup)
orxHANDLE(orxFASTCALL * orxRESOURCE_FUNCTION_OPEN)(const orxSTRING _zPath, orxBOOL _bEraseMode)
Definition: orxResource.h:59
orxDLLAPI orxSTATUS orxFASTCALL orxResource_AddStorage(const orxSTRING _zGroup, const orxSTRING _zStorage, orxBOOL _bAddFirst)
orxDLLAPI orxSTATUS orxFASTCALL orxResource_ReloadStorage()
orxRESOURCE_FUNCTION_WRITE pfnWrite
Definition: orxResource.h:80
orxRESOURCE_FUNCTION_CLOSE pfnClose
Definition: orxResource.h:75
orxDLLAPI const orxSTRING orxFASTCALL orxResource_GetTypeTag(orxU32 _u32Index)
orxRESOURCE_EVENT
Definition: orxResource.h:86
orxDLLAPI const orxSTRING orxFASTCALL orxResource_GetGroup(orxU32 _u32Index)
orxDLLAPI orxS64 orxFASTCALL orxResource_Write(orxHANDLE _hResource, orxS64 _s64Size, const void *_pBuffer, orxRESOURCE_OP_FUNCTION _pfnCallback, void *_pContext)
orxDLLAPI const orxSTRING orxFASTCALL orxResource_LocateInStorage(const orxSTRING _zGroup, const orxSTRING _zStorage, const orxSTRING _zName)
orxS64(orxFASTCALL * orxRESOURCE_FUNCTION_WRITE)(orxHANDLE _hResource, orxS64 _s64Size, const void *_pBuffer)
Definition: orxResource.h:65
orxRESOURCE_FUNCTION_GET_SIZE pfnGetSize
Definition: orxResource.h:76
orxDLLAPI orxS64 orxFASTCALL orxResource_GetSize(orxHANDLE _hResource)
orxDLLAPI const orxSTRING orxFASTCALL orxResource_GetPath(const orxSTRING _zLocation)
orxS64(orxFASTCALL * orxRESOURCE_FUNCTION_SEEK)(orxHANDLE _hResource, orxS64 _s64Offset, orxSEEK_OFFSET_WHENCE _eWhence)
Definition: orxResource.h:62
orxDLLAPI orxS64 orxFASTCALL orxResource_GetTime(const orxSTRING _zLocation)
orxDLLAPI orxSTATUS orxFASTCALL orxResource_RemoveStorage(const orxSTRING _zGroup, const orxSTRING _zStorage)
orxDLLAPI orxS64 orxFASTCALL orxResource_Read(orxHANDLE _hResource, orxS64 _s64Size, void *_pBuffer, orxRESOURCE_OP_FUNCTION _pfnCallback, void *_pContext)
orxDLLAPI orxSTATUS orxFASTCALL orxResource_Init()
orxRESOURCE_FUNCTION_READ pfnRead
Definition: orxResource.h:79
orxDLLAPI const orxSTRING orxFASTCALL orxResource_GetLocation(orxHANDLE _hResource)
orxDLLAPI const orxSTRING orxFASTCALL orxResource_Locate(const orxSTRING _zGroup, const orxSTRING _zName)
orxSTATUS
Definition: orxType.h:243
const orxRESOURCE_TYPE_INFO * pstTypeInfo
Definition: orxResource.h:104
orxDLLAPI const orxRESOURCE_TYPE_INFO *orxFASTCALL orxResource_GetType(const orxSTRING _zLocation)
orxDLLAPI orxSTATUS orxFASTCALL orxResource_ClearCache()
orxDLLAPI orxU32 orxFASTCALL orxResource_GetTypeCounter()
const orxSTRING(orxFASTCALL * orxRESOURCE_FUNCTION_LOCATE)(const orxSTRING _zStorage, const orxSTRING _zName, orxBOOL _bRequireExistence)
Definition: orxResource.h:57
orxDLLAPI orxU32 orxFASTCALL orxResource_GetTotalPendingOpCounter()
orxS64(orxFASTCALL * orxRESOURCE_FUNCTION_GET_TIME)(const orxSTRING _zPath)
Definition: orxResource.h:58
orxDLLAPI orxS64 orxFASTCALL orxResource_Tell(orxHANDLE _hResource)
void(orxFASTCALL * orxRESOURCE_OP_FUNCTION)(orxHANDLE _hResource, orxS64 _s64Size, void *_pBuffer, void *_pContext)
Definition: orxResource.h:52
void(orxFASTCALL * orxRESOURCE_FUNCTION_CLOSE)(orxHANDLE _hResource)
Definition: orxResource.h:60
orxSEEK_OFFSET_WHENCE
Definition: orxType.h:171
typedef void(orxFASTCALL *orxMODULE_EXIT_FUNCTION)()
#define orxDLLAPI
Definition: orxDecl.h:387
orxDLLAPI orxSTATUS orxFASTCALL orxResource_RegisterType(const orxRESOURCE_TYPE_INFO *_pstInfo)
orxDLLAPI void orxFASTCALL orxResource_Setup()
orxS64(orxFASTCALL * orxRESOURCE_FUNCTION_TELL)(orxHANDLE _hResource)
Definition: orxResource.h:63
orxS64(orxFASTCALL * orxRESOURCE_FUNCTION_GET_SIZE)(orxHANDLE _hResource)
Definition: orxResource.h:61
orxDLLAPI orxS64 orxFASTCALL orxResource_Seek(orxHANDLE _hResource, orxS64 _s64Offset, orxSEEK_OFFSET_WHENCE _eWhence)
orxDLLAPI void orxFASTCALL orxResource_Close(orxHANDLE _hResource)
orxRESOURCE_FUNCTION_OPEN pfnOpen
Definition: orxResource.h:74
orxDLLAPI orxHANDLE orxFASTCALL orxResource_Open(const orxSTRING _zLocation, orxBOOL _bEraseMode)
orxRESOURCE_FUNCTION_SEEK pfnSeek
Definition: orxResource.h:77
const orxSTRING zTag
Definition: orxResource.h:71
orxDLLAPI const orxSTRING orxFASTCALL orxResource_GetStorage(const orxSTRING _zGroup, orxU32 _u32Index)
orxRESOURCE_FUNCTION_LOCATE pfnLocate
Definition: orxResource.h:72
orxRESOURCE_FUNCTION_GET_TIME pfnGetTime
Definition: orxResource.h:73
orxS64(orxFASTCALL * orxRESOURCE_FUNCTION_READ)(orxHANDLE _hResource, orxS64 _s64Size, void *_pBuffer)
Definition: orxResource.h:64
orxRESOURCE_FUNCTION_TELL pfnTell
Definition: orxResource.h:78

Generated for orx by doxygen 1.5.6