orx 1.16
Portable Game Engine
Loading...
Searching...
No Matches
orxPluginCore.h
Go to the documentation of this file.
1/* Orx - Portable Game Engine
2 *
3 * Copyright (c) 2008- 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
32
41
42
43#ifndef _orxPLUGIN_CORE_H_
44#define _orxPLUGIN_CORE_H_
45
46
47/*********************************************
48 Constants
49 *********************************************/
50
51#include "orxInclude.h"
52
55
56
57/*********************************************
58 Structures
59 *********************************************/
60
61/* Structure */
69
70/* Structure */
79
80
83typedef orxSTATUS (*orxPLUGIN_INIT_FUNCTION)(orxU32 *_peUserFunctionNumber, orxPLUGIN_USER_FUNCTION_INFO **_pastUserFunctionInfo);
86
87
88/*********************************************
89 Function prototypes
90 *********************************************/
91
99extern orxDLLAPI void orxFASTCALL orxPlugin_AddCoreInfo(orxPLUGIN_CORE_ID _ePluginCoreID, orxMODULE_ID _eModuleID, const orxPLUGIN_CORE_FUNCTION *_astCoreFunction, orxU32 _u32CoreFunctionNumber);
100
101#ifdef __orxEMBEDDED__
102
108extern orxDLLAPI void orxFASTCALL orxPlugin_BindCoreInfo(orxPLUGIN_CORE_ID _ePluginCoreID, orxPLUGIN_INIT_FUNCTION _pfnPluginInit);
109
110#endif /* __orxEMBEDDED__ */
111
115extern orxDLLAPI void *orxFASTCALL orxPlugin_DefaultCoreFunction(const orxSTRING _zFunctionName, const orxSTRING _zFileName, orxU32 _u32Line);
116
117
118/***************************************************************************
119 ***************************************************************************
120 ****** CORE FUNCTION NAME HANDLING ******
121 ***************************************************************************
122 ***************************************************************************/
123
124/* *** Core function pointer name *** */
125#define orxPLUGIN_CORE_FUNCTION_POINTER_NAME(FUNCTION_NAME) _orxCoreFunctionPointer_##FUNCTION_NAME
126
127/* *** Core function default name *** */
128#define orxPLUGIN_DEFAULT_CORE_FUNCTION_NAME(FUNCTION_NAME) _orxDefaultCoreFunction_##FUNCTION_NAME
129
130/* *** Default core function declaration *** */
131#define orxPLUGIN_DEFAULT_CORE_FUNCTION_DEFINE(FUNCTION_NAME) \
132 extern orxDLLAPI void *orxFASTCALL orxPLUGIN_DEFAULT_CORE_FUNCTION_NAME(FUNCTION_NAME)() \
133 { \
134 return(orxPlugin_DefaultCoreFunction(#FUNCTION_NAME, __FILE__, __LINE__)); \
135 }
136
137
138/***************************************************************************
139 ***************************************************************************
140 ****** CORE FUNCTION DEFINITION HANDLING ******
141 ***************************************************************************
142 ***************************************************************************/
143
144/* *** Definition macro *** */
145#ifdef __orxMSVC__
146 #pragma warning(push)
147 #pragma warning(disable : 4113)
148#endif /* __orxMSVC__ */
149
150#define orxPLUGIN_DEFINE_CORE_FUNCTION(FUNCTION_NAME, RETURN, ...) \
151 orxPLUGIN_DEFAULT_CORE_FUNCTION_DEFINE(FUNCTION_NAME) \
152 \
153 RETURN (orxFASTCALL *orxPLUGIN_CORE_FUNCTION_POINTER_NAME(FUNCTION_NAME))(__VA_ARGS__) = (RETURN(orxFASTCALL *)(__VA_ARGS__)) (&orxPLUGIN_DEFAULT_CORE_FUNCTION_NAME(FUNCTION_NAME))
154
155
156/***************************************************************************
157 ***************************************************************************
158 ****** CORE INFO ARRAY HANDLING ******
159 ***************************************************************************
160 ***************************************************************************/
161
162/* *** Core info array begin macro *** */
163#define orxPLUGIN_BEGIN_CORE_FUNCTION_ARRAY(PLUGIN_SUFFIX) \
164 static const orxPLUGIN_CORE_FUNCTION sastPluginFunctionInfo_##PLUGIN_SUFFIX[orxPLUGIN_FUNCTION_BASE_ID_##PLUGIN_SUFFIX##_NUMBER] = \
165 {
166
167/* *** Core info array add macro *** */
168#define orxPLUGIN_ADD_CORE_FUNCTION_ARRAY(PLUGIN_SUFFIX, FUNCTION_SUFFIX, FUNCTION_NAME) \
169 {(orxPLUGIN_FUNCTION_ID)orxPLUGIN_FUNCTION_BASE_ID_##PLUGIN_SUFFIX##_##FUNCTION_SUFFIX, (orxPLUGIN_FUNCTION *)&orxPLUGIN_CORE_FUNCTION_POINTER_NAME(FUNCTION_NAME), (orxPLUGIN_FUNCTION)&orxPLUGIN_DEFAULT_CORE_FUNCTION_NAME(FUNCTION_NAME)},
170
171/* *** Core info array end macro *** */
172#define orxPLUGIN_END_CORE_FUNCTION_ARRAY(PLUGIN_SUFFIX) \
173 }; \
174 extern orxIMPORT orxSTATUS orxPLUGIN_K_CORE_INIT_FUNCTION_NAME(PLUGIN_SUFFIX)(orxU32 *, orxPLUGIN_USER_FUNCTION_INFO **); \
175 extern orxDLLAPI void orxPLUGIN_CORE_REGISTER_FUNCTION_NAME(PLUGIN_SUFFIX)() \
176 { \
177 orxPLUGIN_REGISTER_CORE_INFO(PLUGIN_SUFFIX); \
178 return; \
179 }
180
181
182/***************************************************************************
183 ***************************************************************************
184 ****** CORE INFO REGISTRATION HANDLING ******
185 ***************************************************************************
186 ***************************************************************************/
187
188 #ifdef __orxEMBEDDED__
189
190 /* *** Core info register macro *** */
191 #define orxPLUGIN_REGISTER_CORE_INFO(PLUGIN_SUFFIX) \
192 orxPlugin_AddCoreInfo(orxPLUGIN_CORE_ID_##PLUGIN_SUFFIX, orxMODULE_ID_##PLUGIN_SUFFIX, sastPluginFunctionInfo_##PLUGIN_SUFFIX, sizeof(sastPluginFunctionInfo_##PLUGIN_SUFFIX) / sizeof(orxPLUGIN_CORE_FUNCTION)); \
193 orxPlugin_BindCoreInfo(orxPLUGIN_CORE_ID_##PLUGIN_SUFFIX, orxPLUGIN_K_CORE_INIT_FUNCTION_NAME(PLUGIN_SUFFIX))
194
195 #else /* __orxEMBEDDED__ */
196
197 /* *** Core info register macro *** */
198 #define orxPLUGIN_REGISTER_CORE_INFO(PLUGIN_SUFFIX) \
199 orxPlugin_AddCoreInfo(orxPLUGIN_CORE_ID_##PLUGIN_SUFFIX, orxMODULE_ID_##PLUGIN_SUFFIX, sastPluginFunctionInfo_##PLUGIN_SUFFIX, sizeof(sastPluginFunctionInfo_##PLUGIN_SUFFIX) / sizeof(orxPLUGIN_CORE_FUNCTION));
200
201 #endif /* __orxEMBEDDED__ */
202
203#ifdef __orxMSVC__
204 #pragma warning(pop)
205#endif /* __orxMSVC__ */
206
207#endif /* _orxPLUGIN_CORE_H_ */
208
#define orxDLLAPI
Definition orxDecl.h:381
orxMODULE_ID
Definition orxModule.h:54
orxPLUGIN_FUNCTION_ID
orxSTATUS(* orxPLUGIN_EXIT_FUNCTION)(orxPLUGIN_ENTRY_MODE _eMode)
#define orxPLUGIN_KU32_FUNCTION_ARG_SIZE
orxDLLAPI void *orxFASTCALL orxPlugin_DefaultCoreFunction(const orxSTRING _zFunctionName, const orxSTRING _zFileName, orxU32 _u32Line)
orxDLLAPI void orxFASTCALL orxPlugin_AddCoreInfo(orxPLUGIN_CORE_ID _ePluginCoreID, orxMODULE_ID _eModuleID, const orxPLUGIN_CORE_FUNCTION *_astCoreFunction, orxU32 _u32CoreFunctionNumber)
orxSTATUS(* orxPLUGIN_SWAP_FUNCTION)(orxPLUGIN_ENTRY_MODE _eMode)
orxPLUGIN_CORE_ID
orxSTATUS(* orxPLUGIN_INIT_FUNCTION)(orxU32 *_peUserFunctionNumber, orxPLUGIN_USER_FUNCTION_INFO **_pastUserFunctionInfo)
orxPLUGIN_ENTRY_MODE
orxSTATUS(orxFASTCALL * orxPLUGIN_FUNCTION)()
orxSTATUS
Definition orxType.h:270
orxPLUGIN_FUNCTION * pfnFunction
orxPLUGIN_FUNCTION pfnDefaultFunction
orxPLUGIN_FUNCTION_ID eFunctionID
orxPLUGIN_FUNCTION_ID eFunctionID
orxCHAR zFunctionArgs[orxPLUGIN_KU32_FUNCTION_ARG_SIZE]
orxPLUGIN_FUNCTION pfnFunction

Generated for orx by doxygen 1.8.11