Index: trunk/src/crtdll/crt_wc.cpp
===================================================================
--- trunk/src/crtdll/crt_wc.cpp	(revision 2853)
+++ trunk/src/crtdll/crt_wc.cpp	(revision 2855)
@@ -1,3 +1,3 @@
-/* $Id: crt_wc.cpp,v 1.1 2000-02-03 21:37:48 sandervl Exp $ */
+/* $Id: crt_wc.cpp,v 1.2 2000-02-21 23:11:30 sandervl Exp $ */
 
 /*
@@ -12,4 +12,5 @@
  * Copyright 1997 Uwe Bonnes
  * Copyright 1999-2000 Jens Wiessner
+ * Copyright 2000 Przemyslaw Dobrowolski
  *
  * CRTDLL - widechar functions
@@ -184,4 +185,47 @@
 
 /*********************************************************************
+ *      _wtoi			 		(CRTDLL.330)
+ */
+int CDECL CRTDLL__wtoi( const wchar_t *s )
+{
+  // int -32768-32768 = size 6 + null-terminatedstr
+  char tempstr[7];
+
+  WideCharToMultiByte(0, // = CP_ACP
+                      0,
+                      (LPCWSTR)s,
+                      -1,
+                      tempstr,
+                      7,
+                      NULL,
+                      NULL);
+
+  return (atoi(tempstr));
+}
+
+
+/*********************************************************************
+ *	_wtol			 		(CRTDLL.331)
+ */
+long int CDECL CRTDLL__wtol( const wchar_t *s )
+{
+  // long int -2147483647-2147483647 = size 10 + null-terminatedstr
+  char tempstr[11];
+  WideCharToMultiByte(0, // = CP_ACP
+                      0,
+                      (LPCWSTR)s,
+                      -1,
+                      tempstr,
+                      11,
+                      NULL,
+                      NULL);
+
+  return (atol(tempstr));
+
+  return 0;
+}
+
+
+/*********************************************************************
  *                  fgetwc	(CRTDLL.366)
  */
Index: trunk/src/crtdll/crtdll.cpp
===================================================================
--- trunk/src/crtdll/crtdll.cpp	(revision 2853)
+++ trunk/src/crtdll/crtdll.cpp	(revision 2855)
@@ -1,3 +1,3 @@
-/* $Id: crtdll.cpp,v 1.23 2000-02-21 10:34:01 sandervl Exp $ */
+/* $Id: crtdll.cpp,v 1.24 2000-02-21 23:11:30 sandervl Exp $ */
 
 /*
@@ -14,4 +14,5 @@
  * Copyright 1997 Uwe Bonnes
  * Copyright 1999-2000 Jens Wiessner
+ * Copyright 2000 Przemyslaw Dobrowolski
  */
 
@@ -1125,4 +1126,29 @@
 
 /*********************************************************************
+ *                  _getsystime    (CRTDLL.127)
+ */
+unsigned int CDECL CRTDLL__getsystime(struct tm *tp)
+{
+  SYSTEMTIME  systemtime;
+
+  GetLocalTime(&systemtime);
+
+  tp->tm_isdst = -1; // FIXME: I don't know is there a correct value
+  tp->tm_sec   = systemtime.wSecond;
+  tp->tm_min   = systemtime.wMinute;
+  tp->tm_hour  = systemtime.wHour;
+  tp->tm_mday  = systemtime.wDay;
+  tp->tm_mon   = systemtime.wMonth - 1;
+  // struct tm has time from 1900  -> 2000 = 100
+  tp->tm_year  = systemtime.wYear - 1900;
+  tp->tm_wday  = systemtime.wDayOfWeek;
+
+  mktime(tp);
+
+  return (0); // FIXME: What Can we return??
+}
+
+
+/*********************************************************************
  *                  _getw     (CRTDLL.128)
  */
@@ -1701,4 +1727,28 @@
 
 /*********************************************************************
+ *                  _setsystime    (CRTDLL.264)
+ */
+unsigned int CDECL CRTDLL__setsystime(struct tm *tp, unsigned int ms)
+{
+  SYSTEMTIME  systemtime;
+
+  mktime(tp);
+
+  systemtime.wMilliseconds = ms;
+  systemtime.wSecond       = tp->tm_sec;
+  systemtime.wMinute       = tp->tm_min;
+  systemtime.wHour         = tp->tm_hour;
+  systemtime.wDay          = tp->tm_mday;
+  systemtime.wMonth        = tp->tm_mon + 1;
+  // struct tm has time from 1900 -> 2000 = 100
+  systemtime.wYear         = tp->tm_year + 1900;
+
+  if (SetLocalTime(&systemtime) != 0) return GetLastError();
+
+  return (0);
+}
+
+
+/*********************************************************************
  *                  _sleep           (CRTDLL.265)
  */
Index: trunk/src/crtdll/stubs.cpp
===================================================================
--- trunk/src/crtdll/stubs.cpp	(revision 2853)
+++ trunk/src/crtdll/stubs.cpp	(revision 2855)
@@ -1,3 +1,3 @@
-/* $Id: stubs.cpp,v 1.2 2000-02-21 10:34:02 sandervl Exp $ */
+/* $Id: stubs.cpp,v 1.3 2000-02-21 23:11:31 sandervl Exp $ */
 
 /*
@@ -267,15 +267,4 @@
 
 /*********************************************************************
- *                  _getsystime    (CRTDLL.127)
- */
-unsigned int CDECL CRTDLL__getsystime(struct tm *tp)
-{
-  dprintf(("CRTDLL: _getsystime not implemented.\n"));
-  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-  return 0;
-}
-
-
-/*********************************************************************
  *	_heapwalk				(CRTDLL.133)
  */
@@ -1089,15 +1078,4 @@
   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
   return FALSE;
-}
-
-
-/*********************************************************************
- *                  _setsystime    (CRTDLL.264)
- */
-unsigned int CDECL CRTDLL__setsystime(struct tm *tp, unsigned int ms)
-{
-  dprintf(("CRTDLL: _setsystime not implemented.\n"));
-  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-  return 0;
 }
 
@@ -1151,26 +1129,4 @@
 }
 
-			
-/*********************************************************************
- *      _wtoi			 		(CRTDLL.330)
- */
-int CDECL CRTDLL__wtoi( const wchar_t *s )
-{
-  dprintf(("CRTDLL: _wtoi(%08xh) not implemented.\n"));
-  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-  return 0;
-}
-
-						
-/*********************************************************************
- *	_wtol			 		(CRTDLL.331)
- */
-long int CDECL CRTDLL__wtol( const wchar_t *s )
-{
-  dprintf(("CRTDLL: _wtol(%08xh) not implemented.\n"));
-  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-  return 0;
-}
-
 
 /*********************************************************************
