MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / os_setlocale

Function os_setlocale

3rd/lua-5.4.3/src/loslib.c:382–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380
381
382static 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
394static 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