MCPcopy Create free account
hub / github.com/DFHack/dfhack / PushStructMethod

Method PushStructMethod

library/LuaWrapper.cpp:1241–1248  ·  view source on GitHub ↗

* Add a struct-style (3 upvalues) metamethod to the metatable. */

Source from the content-addressed store, hash-verified

1239 * Add a struct-style (3 upvalues) metamethod to the metatable.
1240 */
1241void LuaWrapper::PushStructMethod(lua_State *state, int meta_idx, int ftable_idx,
1242 lua_CFunction function)
1243{
1244 lua_rawgetp(state, LUA_REGISTRYINDEX, &DFHACK_TYPETABLE_TOKEN);
1245 lua_pushvalue(state, meta_idx);
1246 lua_pushvalue(state, ftable_idx);
1247 lua_pushcclosure(state, function, 3);
1248}
1249
1250/**
1251 * Add a struct-style (3 upvalues) metamethod to the metatable.

Callers

nothing calls this directly

Calls 3

lua_rawgetpFunction · 0.85
lua_pushvalueFunction · 0.85
lua_pushcclosureFunction · 0.85

Tested by

no test coverage detected