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

Function luaL_fileresult

lib/lua/src/lauxlib.c:246–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244
245
246LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) {
247 int en = errno; /* calls to Lua API may change this value */
248 if (stat) {
249 lua_pushboolean(L, 1);
250 return 1;
251 }
252 else {
253 const char *msg;
254 luaL_pushfail(L);
255 msg = (en != 0) ? strerror(en) : "(no extra info)";
256 if (fname)
257 lua_pushfstring(L, "%s: %s", fname, msg);
258 else
259 lua_pushstring(L, msg);
260 lua_pushinteger(L, en);
261 return 3;
262 }
263}
264
265
266#if !defined(l_inspectstat) /* { */

Callers 13

luaL_execresultFunction · 0.85
os_removeFunction · 0.85
os_renameFunction · 0.85
io_fcloseFunction · 0.85
io_openFunction · 0.85
io_popenFunction · 0.85
io_tmpfileFunction · 0.85
g_readFunction · 0.85
g_writeFunction · 0.85
f_seekFunction · 0.85
f_setvbufFunction · 0.85
io_flushFunction · 0.85

Calls 5

lua_pushbooleanFunction · 0.85
strerrorFunction · 0.85
lua_pushfstringFunction · 0.85
lua_pushstringFunction · 0.85
lua_pushintegerFunction · 0.85

Tested by

no test coverage detected