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

Function createmeta

depends/lua/src/liolib.c:735–741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

733
734
735static void createmeta (lua_State *L) {
736 luaL_newmetatable(L, LUA_FILEHANDLE); /* create metatable for file handles */
737 lua_pushvalue(L, -1); /* push metatable */
738 lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */
739 luaL_setfuncs(L, flib, 0); /* add file methods to new metatable */
740 lua_pop(L, 1); /* pop new metatable */
741}
742
743
744/*

Callers 1

luaopen_ioFunction · 0.85

Calls 4

luaL_newmetatableFunction · 0.85
lua_pushvalueFunction · 0.85
lua_setfieldFunction · 0.85
luaL_setfuncsFunction · 0.85

Tested by

no test coverage detected