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

Function os_exit

extlibs/lua/src/loslib.c:392–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

lua_tobooleanFunction · 0.85
luaL_optintegerFunction · 0.85
lua_closeFunction · 0.85

Tested by

no test coverage detected