MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / getfield

Function getfield

Source/Misc/lua/src/lua.c:13543–13555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13541
13542
13543static int getfield (lua_State *L, const char *key, int d) {
13544int res;
13545lua_getfield(L, -1, key);
13546if (lua_isnumber(L, -1))
13547res = (int)lua_tointeger(L, -1);
13548else {
13549if (d < 0)
13550return luaL_error(L, "field " LUA_QS " missing in date table", key);
13551res = d;
13552}
13553lua_pop(L, 1);
13554return res;
13555}
13556
13557
13558static int os_date (lua_State *L) {

Callers 1

os_timeFunction · 0.85

Calls 4

lua_getfieldFunction · 0.85
lua_isnumberFunction · 0.85
lua_tointegerFunction · 0.85
luaL_errorFunction · 0.85

Tested by

no test coverage detected