MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / os_exit

Function os_exit

xrepo/packages/l/lua/port/lua/src/loslib.c:394–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392
393
394static int os_exit (lua_State *L) {
395 int status;
396 if (lua_isboolean(L, 1))
397 status = (lua_toboolean(L, 1) ? EXIT_SUCCESS : EXIT_FAILURE);
398 else
399 status = (int)luaL_optinteger(L, 1, EXIT_SUCCESS);
400 if (lua_toboolean(L, 2))
401 lua_close(L);
402 if (L) exit(status); /* 'if' to avoid warnings for unreachable 'return' */
403 return 0;
404}
405
406
407static const luaL_Reg syslib[] = {

Callers

nothing calls this directly

Calls 3

lua_tobooleanFunction · 0.70
luaL_optintegerFunction · 0.70
lua_closeFunction · 0.70

Tested by

no test coverage detected