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

Function AddMethodWrapper

library/LuaTypes.cpp:1298–1303  ·  view source on GitHub ↗

* Create a closure invoking the given function, and add it to the field table. */

Source from the content-addressed store, hash-verified

1296 * Create a closure invoking the given function, and add it to the field table.
1297 */
1298static void AddMethodWrapper(lua_State *state, int meta_idx, int field_idx,
1299 const char *name, function_identity_base *fun)
1300{
1301 PushFunctionWrapper(state, meta_idx, name, fun);
1302 lua_setfield(state, field_idx, name);
1303}
1304
1305/**
1306 * Wrap functions and add them to the table on the top of the stack.

Callers 3

SetFunctionWrappersMethod · 0.85
IndexFieldsFunction · 0.85
IndexStaticsMethod · 0.85

Calls 1

lua_setfieldFunction · 0.85

Tested by

no test coverage detected