* Add a struct-style (3 upvalues) metamethod to the metatable. */
| 1239 | * Add a struct-style (3 upvalues) metamethod to the metatable. |
| 1240 | */ |
| 1241 | void 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. |
nothing calls this directly
no test coverage detected