Changeset 2855 for trunk/src/crtdll/crtdll.cpp
- Timestamp:
- Feb 22, 2000, 12:11:31 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/crtdll/crtdll.cpp
r2844 r2855 1 /* $Id: crtdll.cpp,v 1.2 3 2000-02-21 10:34:01sandervl Exp $ */1 /* $Id: crtdll.cpp,v 1.24 2000-02-21 23:11:30 sandervl Exp $ */ 2 2 3 3 /* … … 14 14 * Copyright 1997 Uwe Bonnes 15 15 * Copyright 1999-2000 Jens Wiessner 16 * Copyright 2000 Przemyslaw Dobrowolski 16 17 */ 17 18 … … 1125 1126 1126 1127 /********************************************************************* 1128 * _getsystime (CRTDLL.127) 1129 */ 1130 unsigned int CDECL CRTDLL__getsystime(struct tm *tp) 1131 { 1132 SYSTEMTIME systemtime; 1133 1134 GetLocalTime(&systemtime); 1135 1136 tp->tm_isdst = -1; // FIXME: I don't know is there a correct value 1137 tp->tm_sec = systemtime.wSecond; 1138 tp->tm_min = systemtime.wMinute; 1139 tp->tm_hour = systemtime.wHour; 1140 tp->tm_mday = systemtime.wDay; 1141 tp->tm_mon = systemtime.wMonth - 1; 1142 // struct tm has time from 1900 -> 2000 = 100 1143 tp->tm_year = systemtime.wYear - 1900; 1144 tp->tm_wday = systemtime.wDayOfWeek; 1145 1146 mktime(tp); 1147 1148 return (0); // FIXME: What Can we return?? 1149 } 1150 1151 1152 /********************************************************************* 1127 1153 * _getw (CRTDLL.128) 1128 1154 */ … … 1701 1727 1702 1728 /********************************************************************* 1729 * _setsystime (CRTDLL.264) 1730 */ 1731 unsigned int CDECL CRTDLL__setsystime(struct tm *tp, unsigned int ms) 1732 { 1733 SYSTEMTIME systemtime; 1734 1735 mktime(tp); 1736 1737 systemtime.wMilliseconds = ms; 1738 systemtime.wSecond = tp->tm_sec; 1739 systemtime.wMinute = tp->tm_min; 1740 systemtime.wHour = tp->tm_hour; 1741 systemtime.wDay = tp->tm_mday; 1742 systemtime.wMonth = tp->tm_mon + 1; 1743 // struct tm has time from 1900 -> 2000 = 100 1744 systemtime.wYear = tp->tm_year + 1900; 1745 1746 if (SetLocalTime(&systemtime) != 0) return GetLastError(); 1747 1748 return (0); 1749 } 1750 1751 1752 /********************************************************************* 1703 1753 * _sleep (CRTDLL.265) 1704 1754 */
Note:
See TracChangeset
for help on using the changeset viewer.