MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / g_iofile

Function g_iofile

third-party/lua-5.3.5/src/liolib.c:303–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301
302
303static int g_iofile (lua_State *L, const char *f, const char *mode) {
304 if (!lua_isnoneornil(L, 1)) {
305 const char *filename = lua_tostring(L, 1);
306 if (filename)
307 opencheck(L, filename, mode);
308 else {
309 tofile(L); /* check that it's a valid file handle */
310 lua_pushvalue(L, 1);
311 }
312 lua_setfield(L, LUA_REGISTRYINDEX, f);
313 }
314 /* return current value */
315 lua_getfield(L, LUA_REGISTRYINDEX, f);
316 return 1;
317}
318
319
320static int io_input (lua_State *L) {

Callers 2

io_inputFunction · 0.70
io_outputFunction · 0.70

Calls 5

opencheckFunction · 0.70
tofileFunction · 0.70
lua_pushvalueFunction · 0.70
lua_setfieldFunction · 0.70
lua_getfieldFunction · 0.70

Tested by

no test coverage detected