** Set all fields from structure 'tm' in the table on top of the stack */
| 211 | ** Set all fields from structure 'tm' in the table on top of the stack |
| 212 | */ |
| 213 | static void setallfields (lua_State *L, struct tm *stm) { |
| 214 | setfield(L, "sec", stm->tm_sec); |
| 215 | setfield(L, "min", stm->tm_min); |
| 216 | setfield(L, "hour", stm->tm_hour); |
| 217 | setfield(L, "day", stm->tm_mday); |
| 218 | setfield(L, "month", stm->tm_mon + 1); |
| 219 | setfield(L, "year", stm->tm_year + 1900); |
| 220 | setfield(L, "wday", stm->tm_wday + 1); |
| 221 | setfield(L, "yday", stm->tm_yday + 1); |
| 222 | setboolfield(L, "isdst", stm->tm_isdst); |
| 223 | } |
| 224 | |
| 225 | |
| 226 | static int getboolfield (lua_State *L, const char *key) { |
no test coverage detected