Ignore:
Timestamp:
Feb 22, 2000, 12:11:31 AM (26 years ago)
Author:
sandervl
Message:

PD: Added wtol, wtoi, setsystime, getsystime

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/crtdll/crtdll.cpp

    r2844 r2855  
    1 /* $Id: crtdll.cpp,v 1.23 2000-02-21 10:34:01 sandervl Exp $ */
     1/* $Id: crtdll.cpp,v 1.24 2000-02-21 23:11:30 sandervl Exp $ */
    22
    33/*
     
    1414 * Copyright 1997 Uwe Bonnes
    1515 * Copyright 1999-2000 Jens Wiessner
     16 * Copyright 2000 Przemyslaw Dobrowolski
    1617 */
    1718
     
    11251126
    11261127/*********************************************************************
     1128 *                  _getsystime    (CRTDLL.127)
     1129 */
     1130unsigned 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/*********************************************************************
    11271153 *                  _getw     (CRTDLL.128)
    11281154 */
     
    17011727
    17021728/*********************************************************************
     1729 *                  _setsystime    (CRTDLL.264)
     1730 */
     1731unsigned 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/*********************************************************************
    17031753 *                  _sleep           (CRTDLL.265)
    17041754 */
Note: See TracChangeset for help on using the changeset viewer.