MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / os_setlocale

Function os_setlocale

deps/lua/src/loslib.c:204–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202
203
204static 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
216static int os_exit (lua_State *L) {

Callers

nothing calls this directly

Calls 2

luaL_checkoptionFunction · 0.85
lua_pushstringFunction · 0.85

Tested by

no test coverage detected