MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaL_fileresult

Function luaL_fileresult

depends/lua/src/lauxlib.c:234–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232
233
234LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) {
235 int en = errno; /* calls to Lua API may change this value */
236 if (stat) {
237 lua_pushboolean(L, 1);
238 return 1;
239 }
240 else {
241 lua_pushnil(L);
242 if (fname)
243 lua_pushfstring(L, "%s: %s", fname, strerror(en));
244 else
245 lua_pushstring(L, strerror(en));
246 lua_pushinteger(L, en);
247 return 3;
248 }
249}
250
251
252#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
lua_pushnilFunction · 0.85
lua_pushfstringFunction · 0.85
lua_pushstringFunction · 0.85
lua_pushintegerFunction · 0.85

Tested by

no test coverage detected