** Set all fields from structure 'tm' in the table on top of the stack */
| 228 | ** Set all fields from structure 'tm' in the table on top of the stack |
| 229 | */ |
| 230 | static void setallfields (lua_State *L, struct tm *stm) { |
| 231 | setfield(L, "year", stm->tm_year, 1900); |
| 232 | setfield(L, "month", stm->tm_mon, 1); |
| 233 | setfield(L, "day", stm->tm_mday, 0); |
| 234 | setfield(L, "hour", stm->tm_hour, 0); |
| 235 | setfield(L, "min", stm->tm_min, 0); |
| 236 | setfield(L, "sec", stm->tm_sec, 0); |
| 237 | setfield(L, "yday", stm->tm_yday, 1); |
| 238 | setfield(L, "wday", stm->tm_wday, 1); |
| 239 | setboolfield(L, "isdst", stm->tm_isdst); |
| 240 | } |
| 241 | |
| 242 | |
| 243 | static int getboolfield (lua_State *L, const char *key) { |
no test coverage detected