| 216 | |
| 217 | |
| 218 | static int os_setlocale (lua_State *L) { |
| 219 | static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, |
| 220 | LC_NUMERIC, LC_TIME}; |
| 221 | static const char *const catnames[] = {"all", "collate", "ctype", "monetary", |
| 222 | "numeric", "time", NULL}; |
| 223 | const char *l = luaL_optstring(L, 1, NULL); |
| 224 | int op = luaL_checkoption(L, 2, "all", catnames); |
| 225 | lua_pushstring(L, setlocale(cat[op], l)); |
| 226 | return 1; |
| 227 | } |
| 228 | |
| 229 | |
| 230 | static int os_exit (lua_State *L) { |
nothing calls this directly
no test coverage detected