MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / os_setlocale

Function os_setlocale

lua/loslib.c:221–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219
220
221static int os_setlocale (lua_State *L) {
222 static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY,
223 LC_NUMERIC, LC_TIME};
224 static const char *const catnames[] = {"all", "collate", "ctype", "monetary",
225 "numeric", "time", NULL};
226 const char *l = luaL_optstring(L, 1, NULL);
227 int op = luaL_checkoption(L, 2, "all", catnames);
228 lua_pushstring(L, setlocale(cat[op], l));
229 return 1;
230}
231
232
233static 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