MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / os_setlocale

Function os_setlocale

extlibs/lua/src/loslib.c:380–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378
379
380static int os_setlocale (lua_State *L) {
381 static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY,
382 LC_NUMERIC, LC_TIME};
383 static const char *const catnames[] = {"all", "collate", "ctype", "monetary",
384 "numeric", "time", NULL};
385 const char *l = luaL_optstring(L, 1, NULL);
386 int op = luaL_checkoption(L, 2, "all", catnames);
387 lua_pushstring(L, setlocale(cat[op], l));
388 return 1;
389}
390
391
392static 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