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

Function getfield

lua/loslib.c:125–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123
124
125static int getfield (lua_State *L, const char *key, int d) {
126 int res;
127 lua_getfield(L, -1, key);
128 if (lua_isnumber(L, -1))
129 res = (int)lua_tointeger(L, -1);
130 else {
131 if (d < 0)
132 return luaL_error(L, "field " LUA_QS " missing in date table", key);
133 res = d;
134 }
135 lua_pop(L, 1);
136 return res;
137}
138
139
140static 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