summaryrefslogtreecommitdiff
path: root/plugins/MirLua/include
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-09-12 22:02:30 +0300
committeraunsane <aunsane@gmail.com>2017-09-12 22:03:37 +0300
commit6f99f13cf590c323fd5bd5b4d6855e59f582fb0e (patch)
tree4b9a66758433be8273c7c20e06ab305901b4fdfb /plugins/MirLua/include
parent6611ef6791a897d23cb79ab7b56eb48d49452b80 (diff)
MirLua: massive refactoring
- m_msg_buttonbar moved to m_srrm - version bump
Diffstat (limited to 'plugins/MirLua/include')
-rw-r--r--plugins/MirLua/include/mirlua.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/plugins/MirLua/include/mirlua.h b/plugins/MirLua/include/mirlua.h
new file mode 100644
index 0000000000..eee10289bb
--- /dev/null
+++ b/plugins/MirLua/include/mirlua.h
@@ -0,0 +1,23 @@
+#ifndef _MIRLUA_H_
+#define _MIRLUA_H_
+
+#include <lua.hpp>
+
+__forceinline UINT_PTR luaM_tomparam(lua_State *L, int idx)
+{
+ switch (lua_type(L, idx))
+ {
+ case LUA_TBOOLEAN:
+ return lua_toboolean(L, idx);
+ case LUA_TSTRING:
+ return (UINT_PTR)lua_tostring(L, idx);
+ case LUA_TLIGHTUSERDATA:
+ return (UINT_PTR)lua_touserdata(L, idx);
+ case LUA_TNUMBER:
+ if (lua_isinteger(L, idx))
+ return (UINT_PTR)lua_tointeger(L, idx);
+ }
+ return NULL;
+}
+
+#endif //_MIRLUA_H_ \ No newline at end of file