| 202 | |
| 203 | |
| 204 | static int os_setlocale (lua_State *L) { |
| 205 | static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, |
| 206 | LC_NUMERIC, LC_TIME}; |
| 207 | static const char *const catnames[] = {"all", "collate", "ctype", "monetary", |
| 208 | "numeric", "time", NULL}; |
| 209 | const char *l = luaL_optstring(L, 1, NULL); |
| 210 | int op = luaL_checkoption(L, 2, "all", catnames); |
| 211 | lua_pushstring(L, setlocale(cat[op], l)); |
| 212 | return 1; |
| 213 | } |
| 214 | |
| 215 | |
| 216 | static int os_exit (lua_State *L) { |
nothing calls this directly
no test coverage detected