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

Function os_setlocale

engine/lua/src/lua/loslib.c:218–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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