MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / g_iofile

Function g_iofile

3rd/lua-5.4.3/src/liolib.c:318–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

io_inputFunction · 0.85
io_outputFunction · 0.85

Calls 5

opencheckFunction · 0.85
tofileFunction · 0.85
lua_pushvalueFunction · 0.85
lua_setfieldFunction · 0.85
lua_getfieldFunction · 0.85

Tested by

no test coverage detected