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

Function g_iofile

third-party/lua-5.2.4/src/liolib.c:273–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271
272
273static int g_iofile (lua_State *L, const char *f, const char *mode) {
274 if (!lua_isnoneornil(L, 1)) {
275 const char *filename = lua_tostring(L, 1);
276 if (filename)
277 opencheck(L, filename, mode);
278 else {
279 tofile(L); /* check that it's a valid file handle */
280 lua_pushvalue(L, 1);
281 }
282 lua_setfield(L, LUA_REGISTRYINDEX, f);
283 }
284 /* return current value */
285 lua_getfield(L, LUA_REGISTRYINDEX, f);
286 return 1;
287}
288
289
290static 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