[ros-diffs] [gschneider] 42422: Switch from time to time_new 1/2: -Get updated headers into place, prepare rbuild file, delete old dir

gschneider at svn.reactos.org gschneider at svn.reactos.org
Thu Aug 6 13:37:09 CEST 2009


Author: gschneider
Date: Thu Aug  6 13:37:09 2009
New Revision: 42422

URL: http://svn.reactos.org/svn/reactos?rev=42422&view=rev
Log:
Switch from time to time_new 1/2:
-Get updated headers into place, prepare rbuild file, delete old dir

Added:
    trunk/reactos/lib/sdk/crt/include/internal/time.h   (with props)
Removed:
    trunk/reactos/lib/sdk/crt/time/
Modified:
    trunk/reactos/lib/sdk/crt/crt.rbuild
    trunk/reactos/lib/sdk/crt/include/internal/file.h
    trunk/reactos/lib/sdk/crt/include/internal/tls.h
    trunk/reactos/lib/sdk/crt/precomp.h

Modified: trunk/reactos/lib/sdk/crt/crt.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/crt.rbuild?rev=42422&r1=42421&r2=42422&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/crt.rbuild [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/crt.rbuild [iso-8859-1] Thu Aug  6 13:37:09 2009
@@ -429,18 +429,46 @@
 		<file>systime.c</file>
 	</directory>
 	<directory name="time">
+		<file>asctime.c</file>
 		<file>clock.c</file>
+		<file>ctime32.c</file>
+		<file>ctime64.c</file>
 		<file>ctime.c</file>
+		<file>difftime32.c</file>
+		<file>difftime64.c</file>
 		<file>difftime.c</file>
+		<file>ftime32.c</file>
+		<file>ftime64.c</file>
 		<file>ftime.c</file>
+		<file>futime32.c</file>
+		<file>futime64.c</file>
+		<file>futime.c</file>
+		<file>gmtime.c</file>
+		<file>localtime32.c</file>
+		<file>localtime64.c</file>
+		<file>localtime.c</file>
+		<file>mktime.c</file>
 		<file>strdate.c</file>
 		<file>strftime.c</file>
 		<file>strtime.c</file>
+		<file>time32.c</file>
+		<file>time64.c</file>
 		<file>time.c</file>
-		<file>tz_vars.c</file>
+		<file>timezone.c</file>
+		<file>tzname.c</file>
+		<file>utime32.c</file>
+		<file>utime64.c</file>
+		<file>utime.c</file>
+		<file>wasctime.c</file>
+		<file>wcsftime.c</file>
+		<file>wctime32.c</file>
+		<file>wctime64.c</file>
 		<file>wctime.c</file>
 		<file>wstrdate.c</file>
 		<file>wstrtime.c</file>
+		<file>wutime32.c</file>
+		<file>wutime64.c</file>
+		<file>wutime.c</file>
 	</directory>
 	<directory name="wstring">
 		<file>wcscoll.c</file>

Modified: trunk/reactos/lib/sdk/crt/include/internal/file.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/include/internal/file.h?rev=42422&r1=42421&r2=42422&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/include/internal/file.h [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/include/internal/file.h [iso-8859-1] Thu Aug  6 13:37:09 2009
@@ -49,8 +49,6 @@
 void sigabort_handler(int sig);
 
 void UnixTimeToFileTime(time_t unix_time, FILETIME* filetime, DWORD remainder);
-time_t FileTimeToUnixTime(const FILETIME* filetime, DWORD *remainder);
-
 
 #define __FILE_REC_MAX 20
 typedef struct __file_rec

Added: trunk/reactos/lib/sdk/crt/include/internal/time.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/include/internal/time.h?rev=42422&view=auto
==============================================================================
--- trunk/reactos/lib/sdk/crt/include/internal/time.h (added)
+++ trunk/reactos/lib/sdk/crt/include/internal/time.h [iso-8859-1] Thu Aug  6 13:37:09 2009
@@ -1,0 +1,55 @@
+#define DIFFTIME 0x19db1ded53e8000ULL
+#define DIFFDAYS (3 * DAYSPER100YEARS + 17 * DAYSPER4YEARS + 1 * DAYSPERYEAR)
+
+#define DAYSPERYEAR 365
+#define DAYSPER4YEARS (4*DAYSPERYEAR+1)
+#define DAYSPER100YEARS (25*DAYSPER4YEARS-1)
+#define DAYSPER400YEARS (4*DAYSPER100YEARS+1)
+#define SECONDSPERDAY (24*60*60)
+#define SECONDSPERHOUR (60*60)
+#define LEAPDAY 59
+
+static __inline
+__time64_t
+FileTimeToUnixTime(const FILETIME *FileTime, USHORT *millitm)
+{
+    ULARGE_INTEGER ULargeInt;
+    __time64_t time;
+
+    ULargeInt.LowPart = FileTime->dwLowDateTime;
+    ULargeInt.HighPart = FileTime->dwHighDateTime;
+    ULargeInt.QuadPart -= DIFFTIME;
+
+    time = ULargeInt.QuadPart / 10000;
+    if (millitm)
+        *millitm = (ULargeInt.QuadPart % 10000) / 10;
+
+    return time;
+}
+
+static __inline
+long leapyears_passed(long days)
+{
+    long quadcenturies, centuries, quadyears;
+    quadcenturies = days / DAYSPER400YEARS;
+    days -= quadcenturies;
+    centuries = days / DAYSPER100YEARS;
+    days += centuries;
+    quadyears = days / DAYSPER4YEARS;
+    return quadyears - centuries + quadcenturies;
+}
+
+static __inline
+long leapdays_passed(long days)
+{
+    return leapyears_passed(days + DAYSPERYEAR - LEAPDAY + 1);
+}
+
+static __inline
+long years_passed(long days)
+{
+    return (days - leapdays_passed(days)) / 365;
+}
+
+extern long dst_begin;
+extern long dst_end;

Propchange: trunk/reactos/lib/sdk/crt/include/internal/time.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/reactos/lib/sdk/crt/include/internal/tls.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/include/internal/tls.h?rev=42422&r1=42421&r2=42422&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/include/internal/tls.h [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/include/internal/tls.h [iso-8859-1] Thu Aug  6 13:37:09 2009
@@ -12,6 +12,7 @@
 #include <windef.h>
 #include <winbase.h>
 #include <winnt.h>
+#include <time.h>
 
 #include <stddef.h>
 
@@ -29,6 +30,10 @@
 
   EXCEPTION_RECORD *exc_record; /* Head of exception record list */
 
+  struct tm tmbuf;              /* Used by gmtime, mktime, mkgmtime, localtime */
+  char asctimebuf[26];          /* Buffer for asctime and ctime */
+  wchar_t wasctimebuf[26];      /* Buffer for wasctime and wctime */
+
 } THREADDATA, *PTHREADDATA;
 
 
@@ -41,4 +46,3 @@
 #endif /* __MSVCRT_INTERNAL_TLS_H */
 
 /* EOF */
-

Modified: trunk/reactos/lib/sdk/crt/precomp.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/precomp.h?rev=42422&r1=42421&r2=42422&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/precomp.h [iso-8859-1] Thu Aug  6 13:37:09 2009
@@ -58,6 +58,7 @@
 #include <internal/mbstring.h>
 #include <internal/mtdll.h>
 #include <internal/rterror.h>
+#include <internal/time.h>
 #include <internal/tls.h>
 #include <internal/printf.h>
 




More information about the Ros-diffs mailing list