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

Function getiofile

lib/lua/src/liolib.c:311–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309
310
311static FILE *getiofile (lua_State *L, const char *findex) {
312 LStream *p;
313 lua_getfield(L, LUA_REGISTRYINDEX, findex);
314 p = (LStream *)lua_touserdata(L, -1);
315 if (l_unlikely(isclosed(p)))
316 luaL_error(L, "default %s file is closed", findex + IOPREF_LEN);
317 return p->f;
318}
319
320
321static int g_iofile (lua_State *L, const char *f, const char *mode) {

Callers 3

io_readFunction · 0.85
io_writeFunction · 0.85
io_flushFunction · 0.85

Calls 3

lua_getfieldFunction · 0.85
lua_touserdataFunction · 0.85
luaL_errorFunction · 0.85

Tested by

no test coverage detected