MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / g_iofile

Function g_iofile

extlibs/lua/src/liolib.c:304–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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