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

Function luaL_execresult

depends/lua/src/lauxlib.c:274–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272
273
274LUALIB_API int luaL_execresult (lua_State *L, int stat) {
275 const char *what = "exit"; /* type of termination */
276 if (stat == -1) /* error? */
277 return luaL_fileresult(L, 0, NULL);
278 else {
279 l_inspectstat(stat, what); /* interpret result */
280 if (*what == 'e' && stat == 0) /* successful termination? */
281 lua_pushboolean(L, 1);
282 else
283 lua_pushnil(L);
284 lua_pushstring(L, what);
285 lua_pushinteger(L, stat);
286 return 3; /* return true/nil,what,code */
287 }
288}
289
290/* }====================================================== */
291

Callers 2

os_executeFunction · 0.85
io_pcloseFunction · 0.85

Calls 5

luaL_fileresultFunction · 0.85
lua_pushbooleanFunction · 0.85
lua_pushnilFunction · 0.85
lua_pushstringFunction · 0.85
lua_pushintegerFunction · 0.85

Tested by

no test coverage detected