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

Method unsafe_script

Libs/sol/sol.hpp:25471–25486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25469
25470 template <typename E>
25471 unsafe_function_result unsafe_script(lua_Reader reader, void* data, const basic_environment<E>& env,
25472 const std::string& chunkname = detail::default_chunk_name(), load_mode mode = load_mode::any) {
25473 detail::typical_chunk_name_t basechunkname = {};
25474 const char* chunknametarget = detail::make_chunk_name("lua_Reader", chunkname, basechunkname);
25475 int index = lua_gettop(L);
25476 if (lua_load(L, reader, data, chunknametarget, to_string(mode).c_str())) {
25477 lua_error(L);
25478 }
25479 set_environment(env, stack_reference(L, raw_index(index + 1)));
25480 if (lua_pcall(L, 0, LUA_MULTRET, 0)) {
25481 lua_error(L);
25482 }
25483 int postindex = lua_gettop(L);
25484 int returns = postindex - index;
25485 return unsafe_function_result(L, (std::max)(postindex - (returns - 1), 1), returns);
25486 }
25487
25488 unsafe_function_result unsafe_script(
25489 lua_Reader reader, void* data, const std::string& chunkname = detail::default_chunk_name(), load_mode mode = load_mode::any) {

Callers

nothing calls this directly

Calls 12

make_chunk_nameFunction · 0.85
lua_loadFunction · 0.85
to_stringFunction · 0.85
set_environmentFunction · 0.85
raw_indexClass · 0.85
scriptFunction · 0.85
luaL_loadbufferxFunction · 0.85
stack_referenceClass · 0.70
c_strMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected