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