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

Function createstdfile

depends/lua/src/liolib.c:756–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

754
755
756static void createstdfile (lua_State *L, FILE *f, const char *k,
757 const char *fname) {
758 LStream *p = newprefile(L);
759 p->f = f;
760 p->closef = &io_noclose;
761 if (k != NULL) {
762 lua_pushvalue(L, -1);
763 lua_setfield(L, LUA_REGISTRYINDEX, k); /* add file to registry */
764 }
765 lua_setfield(L, -2, fname); /* add file to module */
766}
767
768
769LUAMOD_API int luaopen_io (lua_State *L) {

Callers 1

luaopen_ioFunction · 0.85

Calls 3

newprefileFunction · 0.85
lua_pushvalueFunction · 0.85
lua_setfieldFunction · 0.85

Tested by

no test coverage detected