mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 17:01:08 +02:00
CLuaInstance: Add additional tableLookup for get userdata
Origin commit data
------------------
Commit: f4c70c96a5
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-03-16 (Sun, 16 Mar 2014)
This commit is contained in:
@@ -677,6 +677,18 @@ bool CLuaInstance::tableLookup(lua_State *L, const char *what, int &value)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CLuaInstance::tableLookup(lua_State *L, const char *what, void** value)
|
||||||
|
{
|
||||||
|
bool res = false;
|
||||||
|
lua_pushstring(L, what);
|
||||||
|
lua_gettable(L, -2);
|
||||||
|
res = lua_isuserdata(L, -1);
|
||||||
|
if (res)
|
||||||
|
*value = lua_unboxpointer(L, -1);
|
||||||
|
lua_pop(L, 1);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
bool CLuaMenuChangeObserver::changeNotify(lua_State *L, const std::string &luaAction, const std::string &luaId, void *Data)
|
bool CLuaMenuChangeObserver::changeNotify(lua_State *L, const std::string &luaAction, const std::string &luaId, void *Data)
|
||||||
{
|
{
|
||||||
const char *optionValue = (const char *) Data;
|
const char *optionValue = (const char *) Data;
|
||||||
|
@@ -218,6 +218,7 @@ private:
|
|||||||
|
|
||||||
static bool tableLookup(lua_State*, const char*, std::string&);
|
static bool tableLookup(lua_State*, const char*, std::string&);
|
||||||
static bool tableLookup(lua_State*, const char*, int&);
|
static bool tableLookup(lua_State*, const char*, int&);
|
||||||
|
static bool tableLookup(lua_State*, const char*, void**);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _LUAINSTANCE_H */
|
#endif /* _LUAINSTANCE_H */
|
||||||
|
Reference in New Issue
Block a user