MCPcopy Create free account
hub / github.com/Segs/Segs / compat53_call_lua

Function compat53_call_lua

3rd_party/lua_sol2/include/sol.hpp:2428–2440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2426}
2427
2428static void compat53_call_lua(lua_State *L, char const code[], size_t len,
2429 int nargs, int nret) {
2430 lua_rawgetp(L, LUA_REGISTRYINDEX, (void*)code);
2431 if (lua_type(L, -1) != LUA_TFUNCTION) {
2432 lua_pop(L, 1);
2433 if (luaL_loadbuffer(L, code, len, "=none"))
2434 lua_error(L);
2435 lua_pushvalue(L, -1);
2436 lua_rawsetp(L, LUA_REGISTRYINDEX, (void*)code);
2437 }
2438 lua_insert(L, -nargs - 1);
2439 lua_call(L, nargs, nret);
2440}
2441
2442static const char compat53_arith_code[] =
2443"local op,a,b=...\n"

Callers 2

lua_arithFunction · 0.85
lua_compareFunction · 0.85

Calls 2

lua_rawgetpFunction · 0.85
lua_rawsetpFunction · 0.85

Tested by

no test coverage detected