Mercurial > hg > orthanc
diff Core/Lua/LuaContext.cpp @ 397:941ea46e9e26 lua-scripting
lua filter of new instances
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 02 May 2013 16:34:00 +0200 |
parents | 7dec4f3c922c |
children | b79bf2f4ab2e |
line wrap: on
line diff
--- a/Core/Lua/LuaContext.cpp Thu May 02 11:02:15 2013 +0200 +++ b/Core/Lua/LuaContext.cpp Thu May 02 16:34:00 2013 +0200 @@ -70,7 +70,7 @@ lua_pop(L, 1); } - LOG(WARNING) << "Lua: " << result; + LOG(INFO) << "Lua says: " << result; return 0; } @@ -121,4 +121,13 @@ EmbeddedResources::GetFileResource(command, resource); Execute(command); } + + + bool LuaContext::IsExistingFunction(const char* name) + { + boost::mutex::scoped_lock lock(mutex_); + lua_settop(lua_, 0); + lua_getglobal(lua_, name); + return lua_type(lua_, -1) == LUA_TFUNCTION; + } }