Mercurial > projects > ldc
comparison tango/tango/stdc/time.d @ 132:1700239cab2e trunk
[svn r136] MAJOR UNSTABLE UPDATE!!!
Initial commit after moving to Tango instead of Phobos.
Lots of bugfixes...
This build is not suitable for most things.
author | lindquist |
---|---|
date | Fri, 11 Jan 2008 17:57:40 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:5825d48b27d1 | 132:1700239cab2e |
---|---|
1 /** | |
2 * D header file for C99. | |
3 * | |
4 * Copyright: Public Domain | |
5 * License: Public Domain | |
6 * Authors: Sean Kelly | |
7 * Standards: ISO/IEC 9899:1999 (E) | |
8 */ | |
9 module tango.stdc.time; | |
10 | |
11 private import tango.stdc.config; | |
12 private import tango.stdc.stddef; | |
13 | |
14 extern (C): | |
15 | |
16 version( Win32 ) | |
17 { | |
18 struct tm | |
19 { | |
20 int tm_sec; // seconds after the minute - [0, 60] | |
21 int tm_min; // minutes after the hour - [0, 59] | |
22 int tm_hour; // hours since midnight - [0, 23] | |
23 int tm_mday; // day of the month - [1, 31] | |
24 int tm_mon; // months since January - [0, 11] | |
25 int tm_year; // years since 1900 | |
26 int tm_wday; // days since Sunday - [0, 6] | |
27 int tm_yday; // days since January 1 - [0, 365] | |
28 int tm_isdst; // Daylight Saving Time flag | |
29 } | |
30 } | |
31 else | |
32 { | |
33 struct tm | |
34 { | |
35 int tm_sec; // seconds after the minute [0-60] | |
36 int tm_min; // minutes after the hour [0-59] | |
37 int tm_hour; // hours since midnight [0-23] | |
38 int tm_mday; // day of the month [1-31] | |
39 int tm_mon; // months since January [0-11] | |
40 int tm_year; // years since 1900 | |
41 int tm_wday; // days since Sunday [0-6] | |
42 int tm_yday; // days since January 1 [0-365] | |
43 int tm_isdst; // Daylight Savings Time flag | |
44 c_long tm_gmtoff; // offset from CUT in seconds | |
45 char* tm_zone; // timezone abbreviation | |
46 } | |
47 } | |
48 | |
49 alias int time_t; | |
50 alias int clock_t; | |
51 | |
52 version( Win32 ) | |
53 { | |
54 clock_t CLOCKS_PER_SEC = 1000; | |
55 } | |
56 else version( darwin ) | |
57 { | |
58 clock_t CLOCKS_PER_SEC = 100; | |
59 } | |
60 else | |
61 { | |
62 clock_t CLOCKS_PER_SEC = 1000000; | |
63 } | |
64 | |
65 clock_t clock(); | |
66 double difftime(time_t time1, time_t time0); | |
67 time_t mktime(tm* timeptr); | |
68 time_t time(time_t* timer); | |
69 char* asctime(tm* timeptr); | |
70 char* ctime(time_t* timer); | |
71 tm* gmtime(time_t* timer); | |
72 tm* localtime(time_t* timer); | |
73 size_t strftime(char* s, size_t maxsize, char* format, tm* timeptr); | |
74 size_t wcsftime(wchar_t* s, size_t maxsize, wchar_t* format, tm* timeptr); | |
75 | |
76 version( Win32 ) | |
77 { | |
78 void tzset(); | |
79 void _tzset(); | |
80 char* _strdate(char* s); | |
81 char* _strtime(char* s); | |
82 | |
83 wchar_t* _wasctime(tm*); | |
84 wchar_t* _wctime(time_t*); | |
85 wchar_t* _wstrdate(wchar_t*); | |
86 wchar_t* _wstrtime(wchar_t*); | |
87 } | |
88 else version( linux ) | |
89 { | |
90 void tzset(); | |
91 } |