| 380 | |
| 381 | |
| 382 | static int os_setlocale (lua_State *L) { |
| 383 | static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, |
| 384 | LC_NUMERIC, LC_TIME}; |
| 385 | static const char *const catnames[] = {"all", "collate", "ctype", "monetary", |
| 386 | "numeric", "time", NULL}; |
| 387 | const char *l = luaL_optstring(L, 1, NULL); |
| 388 | int op = luaL_checkoption(L, 2, "all", catnames); |
| 389 | lua_pushstring(L, setlocale(cat[op], l)); |
| 390 | return 1; |
| 391 | } |
| 392 | |
| 393 | |
| 394 | static int os_exit (lua_State *L) { |
nothing calls this directly
no test coverage detected