UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
defs.h
Go to the documentation of this file.
1 
2 #ifndef UGDK_SCRIPT_LUA_DEFS_H_
3 #define UGDK_SCRIPT_LUA_DEFS_H_
4 
5 #ifndef lua_h
6 extern "C" {
7 struct lua_State;
8 typedef struct lua_State lua_State;
9 typedef int (*lua_CFunction)(lua_State*);
10 }
11 #endif
12 
13 #include <list>
14 #include <map>
15 
16 namespace ugdk {
17 namespace script {
18 namespace lua {
19 
20 typedef int DataID;
21 typedef std::list<DataID> DataBuffer;
22 typedef std::map<DataID,DataID> DataMap;
23 typedef void* UData;
24 
25 template <class T>
26 UData AsUData(T* p) { return static_cast<UData>(p); }
27 
28 template <class T>
29 UData AsUData(const T* p) {
30  return AsUData(const_cast<T*>(p));
31 }
32 
34 
35 #define LUA_INIT_FUNCTION_NAME(name) luaopen_##name
36 #define LUA_INIT_FUNCTION_SIGNATURE(name) int LUA_INIT_FUNCTION_NAME(name)(lua_State*)
37 #define LUA_MODULE_NAME(name) ugdk::script::lua::NameConversion(#name)
38 #define LUA_NAMESPACE ::ugdk::script::lua
39 
40 } /* namespace lua */
41 } /* namespace script */
42 } /* namespace ugdk */
43 
44 
45 #endif /* UGDK_SCRIPT_LUA_DEFS_H_ */
std::map< DataID, DataID > DataMap
Definition: defs.h:22
Definition: animation.h:11
UData AsUData(T *p)
Definition: defs.h:26
std::list< DataID > DataBuffer
Definition: defs.h:21
struct lua_State lua_State
Definition: defs.h:8
int(* lua_CFunction)(lua_State *)
Definition: defs.h:9
void * UData
Definition: defs.h:23
int DataID
Definition: defs.h:20
lua_CFunction inittype
Definition: defs.h:33