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

Function g_iofile

third-party/lua-5.5.0/src/liolib.c:320–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318
319
320static int g_iofile (lua_State *L, const char *f, const char *mode) {
321 if (!lua_isnoneornil(L, 1)) {
322 const char *filename = lua_tostring(L, 1);
323 if (filename)
324 opencheck(L, filename, mode);
325 else {
326 tofile(L); /* check that it's a valid file handle */
327 lua_pushvalue(L, 1);
328 }
329 lua_setfield(L, LUA_REGISTRYINDEX, f);
330 }
331 /* return current value */
332 lua_getfield(L, LUA_REGISTRYINDEX, f);
333 return 1;
334}
335
336
337static 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