MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / g_iofile

Function g_iofile

lib/lua/src/liolib.c:321–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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