Mercurial > hg > orthanc
comparison 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 |
comparison
equal
deleted
inserted
replaced
394:9784f19f7e1b | 397:941ea46e9e26 |
---|---|
68 result.append(s); | 68 result.append(s); |
69 | 69 |
70 lua_pop(L, 1); | 70 lua_pop(L, 1); |
71 } | 71 } |
72 | 72 |
73 LOG(WARNING) << "Lua: " << result; | 73 LOG(INFO) << "Lua says: " << result; |
74 | 74 |
75 return 0; | 75 return 0; |
76 } | 76 } |
77 | 77 |
78 | 78 |
119 { | 119 { |
120 std::string command; | 120 std::string command; |
121 EmbeddedResources::GetFileResource(command, resource); | 121 EmbeddedResources::GetFileResource(command, resource); |
122 Execute(command); | 122 Execute(command); |
123 } | 123 } |
124 | |
125 | |
126 bool LuaContext::IsExistingFunction(const char* name) | |
127 { | |
128 boost::mutex::scoped_lock lock(mutex_); | |
129 lua_settop(lua_, 0); | |
130 lua_getglobal(lua_, name); | |
131 return lua_type(lua_, -1) == LUA_TFUNCTION; | |
132 } | |
124 } | 133 } |