Lines Matching defs:dos
840 /* convert Unix time to MS-DOS date and time, assuming current timezone
845 unsigned long dos;
852 dos = (tm->tm_year - 80) << 25;
853 dos += (tm->tm_mon + 1) << 21;
854 dos += tm->tm_mday << 16;
855 dos += tm->tm_hour << 11;
856 dos += tm->tm_min << 5;
857 dos += (tm->tm_sec + 1) >> 1; /* round to double-seconds */
858 return dos;
2292 /* convert MS-DOS date and time to a Unix time, assuming current timezone
2294 local time_t dos2time(unsigned long dos)
2298 if (dos == 0)
2300 tm.tm_year = ((int)(dos >> 25) & 0x7f) + 80;
2301 tm.tm_mon = ((int)(dos >> 21) & 0xf) - 1;
2302 tm.tm_mday = (int)(dos >> 16) & 0x1f;
2303 tm.tm_hour = (int)(dos >> 11) & 0x1f;
2304 tm.tm_min = (int)(dos >> 5) & 0x3f;
2305 tm.tm_sec = (int)(dos << 1) & 0x3e;