| 155 | |
| 156 | |
| 157 | static int getfield (lua_State *L, const char *key, int d) { |
| 158 | int res, isnum; |
| 159 | lua_getfield(L, -1, key); |
| 160 | res = (int)lua_tointegerx(L, -1, &isnum); |
| 161 | if (!isnum) { |
| 162 | if (d < 0) |
| 163 | return luaL_error(L, "field " LUA_QS " missing in date table", key); |
| 164 | res = d; |
| 165 | } |
| 166 | lua_pop(L, 1); |
| 167 | return res; |
| 168 | } |
| 169 | |
| 170 | |
| 171 | static const char *checkoption (lua_State *L, const char *conv, char *buff) { |
no test coverage detected