MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / unsafe_script

Method unsafe_script

extlibs/sol3/include/sol/sol.hpp:24667–24681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24665
24666 template <typename E>
24667 unsafe_function_result unsafe_script(lua_Reader reader, void* data, const basic_environment<E>& env, const std::string& chunkname = detail::default_chunk_name(), load_mode mode = load_mode::any) {
24668 detail::typical_chunk_name_t basechunkname = {};
24669 const char* chunknametarget = detail::make_chunk_name("lua_Reader", chunkname, basechunkname);
24670 int index = lua_gettop(L);
24671 if (lua_load(L, reader, data, chunknametarget, to_string(mode).c_str())) {
24672 lua_error(L);
24673 }
24674 set_environment(env, stack_reference(L, raw_index(index + 1)));
24675 if (lua_pcall(L, 0, LUA_MULTRET, 0)) {
24676 lua_error(L);
24677 }
24678 int postindex = lua_gettop(L);
24679 int returns = postindex - index;
24680 return unsafe_function_result(L, (std::max)(postindex - (returns - 1), 1), returns);
24681 }
24682
24683 unsafe_function_result unsafe_script(lua_Reader reader, void* data, const std::string& chunkname = detail::default_chunk_name(), load_mode mode = load_mode::any) {
24684 int index = lua_gettop(L);

Callers

nothing calls this directly

Calls 14

make_chunk_nameFunction · 0.85
lua_gettopFunction · 0.85
lua_errorFunction · 0.85
set_environmentFunction · 0.85
stack_referenceClass · 0.85
raw_indexClass · 0.85
scriptFunction · 0.85
lua_loadFunction · 0.70
luaL_loadbufferxFunction · 0.70
to_stringFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected