- Timestamp:
- Feb 22, 2000, 12:11:31 AM (26 years ago)
- Location:
- trunk/src/crtdll
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/crtdll/crt_wc.cpp
r2618 r2855 1 /* $Id: crt_wc.cpp,v 1. 1 2000-02-03 21:37:48sandervl Exp $ */1 /* $Id: crt_wc.cpp,v 1.2 2000-02-21 23:11:30 sandervl Exp $ */ 2 2 3 3 /* … … 12 12 * Copyright 1997 Uwe Bonnes 13 13 * Copyright 1999-2000 Jens Wiessner 14 * Copyright 2000 Przemyslaw Dobrowolski 14 15 * 15 16 * CRTDLL - widechar functions … … 184 185 185 186 /********************************************************************* 187 * _wtoi (CRTDLL.330) 188 */ 189 int CDECL CRTDLL__wtoi( const wchar_t *s ) 190 { 191 // int -32768-32768 = size 6 + null-terminatedstr 192 char tempstr[7]; 193 194 WideCharToMultiByte(0, // = CP_ACP 195 0, 196 (LPCWSTR)s, 197 -1, 198 tempstr, 199 7, 200 NULL, 201 NULL); 202 203 return (atoi(tempstr)); 204 } 205 206 207 /********************************************************************* 208 * _wtol (CRTDLL.331) 209 */ 210 long int CDECL CRTDLL__wtol( const wchar_t *s ) 211 { 212 // long int -2147483647-2147483647 = size 10 + null-terminatedstr 213 char tempstr[11]; 214 WideCharToMultiByte(0, // = CP_ACP 215 0, 216 (LPCWSTR)s, 217 -1, 218 tempstr, 219 11, 220 NULL, 221 NULL); 222 223 return (atol(tempstr)); 224 225 return 0; 226 } 227 228 229 /********************************************************************* 186 230 * fgetwc (CRTDLL.366) 187 231 */ -
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 */ -
trunk/src/crtdll/stubs.cpp
r2844 r2855 1 /* $Id: stubs.cpp,v 1. 2 2000-02-21 10:34:02sandervl Exp $ */1 /* $Id: stubs.cpp,v 1.3 2000-02-21 23:11:31 sandervl Exp $ */ 2 2 3 3 /* … … 267 267 268 268 /********************************************************************* 269 * _getsystime (CRTDLL.127)270 */271 unsigned int CDECL CRTDLL__getsystime(struct tm *tp)272 {273 dprintf(("CRTDLL: _getsystime not implemented.\n"));274 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);275 return 0;276 }277 278 279 /*********************************************************************280 269 * _heapwalk (CRTDLL.133) 281 270 */ … … 1089 1078 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1090 1079 return FALSE; 1091 }1092 1093 1094 /*********************************************************************1095 * _setsystime (CRTDLL.264)1096 */1097 unsigned int CDECL CRTDLL__setsystime(struct tm *tp, unsigned int ms)1098 {1099 dprintf(("CRTDLL: _setsystime not implemented.\n"));1100 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);1101 return 0;1102 1080 } 1103 1081 … … 1151 1129 } 1152 1130 1153 1154 /*********************************************************************1155 * _wtoi (CRTDLL.330)1156 */1157 int CDECL CRTDLL__wtoi( const wchar_t *s )1158 {1159 dprintf(("CRTDLL: _wtoi(%08xh) not implemented.\n"));1160 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);1161 return 0;1162 }1163 1164 1165 /*********************************************************************1166 * _wtol (CRTDLL.331)1167 */1168 long int CDECL CRTDLL__wtol( const wchar_t *s )1169 {1170 dprintf(("CRTDLL: _wtol(%08xh) not implemented.\n"));1171 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);1172 return 0;1173 }1174 1175 1131 1176 1132 /*********************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.