From e1110157f8c2989a58aa12ddeef91669525d188f Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 4 Apr 2016 08:39:22 +0000 Subject: MirLua: m_toptoolbar moved to separate project git-svn-id: http://svn.miranda-ng.org/main/trunk@16583 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ExternalAPI/m_lua.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 plugins/ExternalAPI/m_lua.h (limited to 'plugins/ExternalAPI') diff --git a/plugins/ExternalAPI/m_lua.h b/plugins/ExternalAPI/m_lua.h new file mode 100644 index 0000000000..6bf0ccc051 --- /dev/null +++ b/plugins/ExternalAPI/m_lua.h @@ -0,0 +1,43 @@ +#ifndef _M_LUA_H_ +#define _M_LUA_H_ + +#include + +static __inline WPARAM luaM_towparam(lua_State *L, int idx) +{ + switch (lua_type(L, idx)) + { + case LUA_TBOOLEAN: + return lua_toboolean(L, idx); + case LUA_TNUMBER: + return lua_tonumber(L, idx); + case LUA_TSTRING: + return (WPARAM)lua_tostring(L, idx); + break; + case LUA_TUSERDATA: + case LUA_TLIGHTUSERDATA: + return (WPARAM)lua_touserdata(L, idx); + default: + return NULL; + } +} + +static __inline LPARAM luaM_tolparam(lua_State *L, int idx) +{ + switch (lua_type(L, idx)) + { + case LUA_TBOOLEAN: + return lua_toboolean(L, idx); + case LUA_TNUMBER: + return lua_tonumber(L, idx); + case LUA_TSTRING: + return (LPARAM)lua_tostring(L, idx); + case LUA_TUSERDATA: + case LUA_TLIGHTUSERDATA: + return (LPARAM)lua_touserdata(L, idx); + default: + return NULL; + } +} + +#endif //_M_LUA_H_ -- cgit v1.2.3