mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
lua add demo scripts, atexit handler, gui_scrollbar_draw
Change-Id: Ie8794e8a487f73952dae43e036787b6972fdbbee
This commit is contained in:
parent
60c5a29408
commit
90118f14cf
22 changed files with 2374 additions and 22 deletions
|
@ -172,8 +172,11 @@ static int os_time (lua_State *L) {
|
|||
|
||||
|
||||
static int os_exit (lua_State *L) {
|
||||
lua_settop(L, 2);
|
||||
int status = luaL_optint(L, 1, EXIT_SUCCESS);
|
||||
lua_close(L);
|
||||
if (status != EXIT_SUCCESS && lua_type (L, 2) != LUA_TSTRING)
|
||||
lua_pushfstring(L, "exit (%d)", status);
|
||||
lua_pushvalue(L, 1); /* put exit status on top of stack */
|
||||
exit(status);
|
||||
return EXIT_SUCCESS; /* never reached, surpress warning */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue