orx  1.14
Portable Game Engine
orxPluginType.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2022 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 
43 #ifndef _orxPLUGIN_TYPE_H_
44 #define _orxPLUGIN_TYPE_H_
45 
46 #include "orxInclude.h"
47 
48 
49 /*********************************************
50  Constants / Defines
51  *********************************************/
52 
53 #define orxPLUGIN_KU32_FLAG_CORE_ID 0x10000000
55 #define orxPLUGIN_KU32_MASK_PLUGIN_ID 0x0000FF00
56 #define orxPLUGIN_KU32_SHIFT_PLUGIN_ID 8
58 #define orxPLUGIN_KU32_MASK_FUNCTION_ID 0x000000FF
60 /* Argument max size */
61 #define orxPLUGIN_KU32_FUNCTION_ARG_SIZE 128
62 
63 
64 /* Macro for getting plugin function id */
65 #define orxPLUGIN_MAKE_FUNCTION_ID(PLUGIN_ID, FUNCTION_BASE_ID) \
66  (orxPLUGIN_FUNCTION_ID)(((PLUGIN_ID << orxPLUGIN_KU32_SHIFT_PLUGIN_ID) & orxPLUGIN_KU32_MASK_PLUGIN_ID) | (FUNCTION_BASE_ID & orxPLUGIN_KU32_MASK_FUNCTION_ID))
67 
68 /* Macro for getting core plugin function id */
69 #define orxPLUGIN_MAKE_CORE_FUNCTION_ID(PLUGIN_CORE_ID, FUNCTION_BASE_ID) \
70  (orxPLUGIN_FUNCTION_ID)(orxPLUGIN_KU32_FLAG_CORE_ID | orxPLUGIN_MAKE_FUNCTION_ID(PLUGIN_CORE_ID, FUNCTION_BASE_ID))
71 
72 /* Defines plugin init function */
73 #define orxPLUGIN_K_INIT_FUNCTION_NAME orxPlugin_MainInit
76 /* Defines core plugin init function */
77 #ifdef __orxEMBEDDED__
78 
79 #define orxPLUGIN_K_CORE_INIT_FUNCTION_NAME(SUFFIX) orxPlugin_##SUFFIX##_Init
81 #else /* __orxEMBEDDED__ */
82 
83 #define orxPLUGIN_K_CORE_INIT_FUNCTION_NAME(SUFFIX) orxPlugin_MainInit
85 #endif /* __orxEMBEDDED__ */
86 
87 
88 /*********************************************
89  Structures
90  *********************************************/
91 
92 typedef enum __orxPLUGIN_FUNCTION_ID_t
93 {
95 
97 
98 typedef orxSTATUS (orxFASTCALL *orxPLUGIN_FUNCTION)();
99 
100 
101 /*********************************************
102  Function prototypes
103  *********************************************/
104 
105 #endif /* _orxPLUGIN_TYPE_H_ */
106 
orxPLUGIN_FUNCTION_ID
Definition: orxPluginType.h:92
orxSTATUS(orxFASTCALL * orxPLUGIN_FUNCTION)()
Definition: orxPluginType.h:98
orxSTATUS
Definition: orxType.h:256

Generated for orx by doxygen 1.8.11