Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00043 #ifndef _orxPLUGIN_CORE_H_
00044 #define _orxPLUGIN_CORE_H_
00045
00046
00047
00048
00049
00050
00051 #include "orxInclude.h"
00052
00053 #include "plugin/orxPluginType.h"
00054 #include "plugin/define/orxPlugin_CoreDefine.h"
00055
00056
00057
00058
00059
00060
00061
00062 typedef struct __orxPLUGIN_CORE_FUNCTION_t
00063 {
00064 orxPLUGIN_FUNCTION_ID eFunctionID;
00065 orxPLUGIN_FUNCTION *pfnFunction;
00066 orxPLUGIN_FUNCTION pfnDefaultFunction;
00068 orxPAD(12)
00070 } orxPLUGIN_CORE_FUNCTION;
00071
00072
00073 typedef struct __orxPLUGIN_USER_FUNCTION_INFO_t
00074 {
00075 orxPLUGIN_FUNCTION_ID eFunctionID;
00076 orxPLUGIN_FUNCTION pfnFunction;
00077 orxCHAR zFunctionArgs[orxPLUGIN_KU32_FUNCTION_ARG_SIZE];
00078 const orxSTRING zFunctionName;
00080 } orxPLUGIN_USER_FUNCTION_INFO;
00081
00082
00085 typedef orxSTATUS (*orxPLUGIN_INIT_FUNCTION)(orxU32 *_peUserFunctionNumber, orxPLUGIN_USER_FUNCTION_INFO **_pastUserFunctionInfo);
00086
00087
00088
00089
00090
00091
00100 extern orxDLLAPI void orxFASTCALL orxPlugin_AddCoreInfo(orxPLUGIN_CORE_ID _ePluginCoreID, orxMODULE_ID _eModuleID, const orxPLUGIN_CORE_FUNCTION *_astCoreFunction, orxU32 _u32CoreFunctionNumber);
00101
00102 #ifdef __orxEMBEDDED__
00103
00110 extern orxDLLAPI void orxFASTCALL orxPlugin_BindCoreInfo(orxPLUGIN_CORE_ID _ePluginCoreID, orxPLUGIN_INIT_FUNCTION _pfnPluginInit);
00111
00112 #endif
00113
00117 extern orxDLLAPI void *orxFASTCALL orxPlugin_DefaultCoreFunction(const orxSTRING _zFunctionName, const orxSTRING _zFileName, orxU32 _u32Line);
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127 #define orxPLUGIN_CORE_FUNCTION_POINTER_NAME(FUNCTION_NAME) _orxCoreFunctionPointer_##FUNCTION_NAME
00128
00129
00130 #define orxPLUGIN_DEFAULT_CORE_FUNCTION_NAME(FUNCTION_NAME) _orxDefaultCoreFunction_##FUNCTION_NAME
00131
00132
00133 #define orxPLUGIN_DEFAULT_CORE_FUNCTION_DEFINE(FUNCTION_NAME) \
00134 extern orxDLLAPI void *orxFASTCALL orxPLUGIN_DEFAULT_CORE_FUNCTION_NAME(FUNCTION_NAME)() \
00135 { \
00136 return(orxPlugin_DefaultCoreFunction(#FUNCTION_NAME, __FILE__, __LINE__)); \
00137 }
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147 #ifdef __orxMSVC__
00148 #pragma warning(disable : 4113)
00149 #endif
00150
00151 #define orxPLUGIN_DEFINE_CORE_FUNCTION(FUNCTION_NAME, RETURN, ...) \
00152 orxPLUGIN_DEFAULT_CORE_FUNCTION_DEFINE(FUNCTION_NAME) \
00153 \
00154 RETURN (orxFASTCALL *orxPLUGIN_CORE_FUNCTION_POINTER_NAME(FUNCTION_NAME))(__VA_ARGS__) = (RETURN(orxFASTCALL *)(__VA_ARGS__)) (&orxPLUGIN_DEFAULT_CORE_FUNCTION_NAME(FUNCTION_NAME))
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164 #define orxPLUGIN_BEGIN_CORE_FUNCTION_ARRAY(PLUGIN_SUFFIX) \
00165 static const orxPLUGIN_CORE_FUNCTION sastPluginFunctionInfo_##PLUGIN_SUFFIX[orxPLUGIN_FUNCTION_BASE_ID_##PLUGIN_SUFFIX##_NUMBER] = \
00166 {
00167
00168
00169 #define orxPLUGIN_ADD_CORE_FUNCTION_ARRAY(PLUGIN_SUFFIX, FUNCTION_SUFFIX, FUNCTION_NAME) \
00170 {(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)},
00171
00172
00173 #define orxPLUGIN_END_CORE_FUNCTION_ARRAY(PLUGIN_SUFFIX) \
00174 }; \
00175 extern orxIMPORT orxSTATUS orxPLUGIN_K_CORE_INIT_FUNCTION_NAME(PLUGIN_SUFFIX)(orxU32 *, orxPLUGIN_USER_FUNCTION_INFO **); \
00176 extern orxDLLAPI void orxPLUGIN_CORE_REGISTER_FUNCTION_NAME(PLUGIN_SUFFIX)() \
00177 { \
00178 orxPLUGIN_REGISTER_CORE_INFO(PLUGIN_SUFFIX); \
00179 return; \
00180 }
00181
00182
00183
00184
00185
00186
00187
00188
00189 #ifdef __orxEMBEDDED__
00190
00191
00192 #define orxPLUGIN_REGISTER_CORE_INFO(PLUGIN_SUFFIX) \
00193 orxPlugin_AddCoreInfo(orxPLUGIN_CORE_ID_##PLUGIN_SUFFIX, orxMODULE_ID_##PLUGIN_SUFFIX, sastPluginFunctionInfo_##PLUGIN_SUFFIX, sizeof(sastPluginFunctionInfo_##PLUGIN_SUFFIX) / sizeof(orxPLUGIN_CORE_FUNCTION)); \
00194 orxPlugin_BindCoreInfo(orxPLUGIN_CORE_ID_##PLUGIN_SUFFIX, orxPLUGIN_K_CORE_INIT_FUNCTION_NAME(PLUGIN_SUFFIX))
00195
00196 #else
00197
00198
00199 #define orxPLUGIN_REGISTER_CORE_INFO(PLUGIN_SUFFIX) \
00200 orxPlugin_AddCoreInfo(orxPLUGIN_CORE_ID_##PLUGIN_SUFFIX, orxMODULE_ID_##PLUGIN_SUFFIX, sastPluginFunctionInfo_##PLUGIN_SUFFIX, sizeof(sastPluginFunctionInfo_##PLUGIN_SUFFIX) / sizeof(orxPLUGIN_CORE_FUNCTION));
00201
00202 #endif
00203
00204 #endif
00205