Lines Matching refs:timespec
66 * Utility function to convert ZIP's time format to a timespec struct.
68 * NOTE: this method will clear all existing state from |timespec|.
70 static inline void zipTimeToTimespec(uint32_t when, struct tm* timespec) {
73 memset(timespec, 0, sizeof(struct tm));
74 timespec->tm_year = ((date >> 9) & 0x7F) + 80; // Zip is years since 1980
75 timespec->tm_mon = ((date >> 5) & 0x0F) - 1;
76 timespec->tm_mday = date & 0x1F;
78 timespec->tm_hour = (when >> 11) & 0x1F;
79 timespec->tm_min = (when >> 5) & 0x3F;
80 timespec->tm_sec = (when & 0x1F) << 1;
81 timespec->tm_isdst = -1;