MCPcopy Create free account
hub / github.com/SOUI2/soui / call

Function call

components/ScriptModule-LUA/lua_tinker/lua_tinker.h:684–704  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

682 // call
683 template<typename RVal>
684 RVal call(lua_State* L, const char* name)
685 {
686 lua_pushcclosure(L, on_error, 0);
687 int errfunc = lua_gettop(L);
688
689 lua_getglobal(L, name);
690 if(lua_isfunction(L,-1))
691 {
692 if(lua_pcall(L, 0, 1, errfunc) != 0)
693 {
694 lua_pop(L, 1);
695 }
696 }
697 else
698 {
699 print_error(L, "lua_tinker::call() attempt to call global `%s' (not a function)", name);
700 }
701
702 lua_remove(L, -2);
703 return pop<RVal>(L);
704 }
705
706 template<typename RVal, typename T1>
707 RVal call(lua_State* L, const char* name, T1 arg)

Callers

nothing calls this directly

Calls 5

lua_pushcclosureFunction · 0.85
lua_gettopFunction · 0.85
lua_getglobalFunction · 0.85
lua_removeFunction · 0.85
pushFunction · 0.85

Tested by

no test coverage detected