ReactOS 0.4.15-dev-7906-g1b85a5f
time.h File Reference
#include <crtdefs.h>
Include dependency graph for time.h:

Go to the source code of this file.

Classes

struct  tm
 

Macros

#define _TIME32_T_DEFINED
 
#define _TIME64_T_DEFINED
 
#define _TIME_T_DEFINED
 
#define _CLOCK_T_DEFINED
 
#define _SIZE_T_DEFINED
 
#define _TM_DEFINED
 
#define CLOCKS_PER_SEC   1000
 
#define _WTIME_DEFINED
 
#define _INC_WTIME_INL
 
#define CLK_TCK   CLOCKS_PER_SEC
 

Typedefs

typedef long __time32_t
 
typedef __time64_t time_t
 
typedef long clock_t
 
typedef unsigned int size_t
 

Functions

 _CRTDATA (extern int _daylight)
 
 _CRTDATA (extern long _dstbias)
 
 _CRTDATA (extern char *_tzname[2])
 
_CRTIMP errno_t __cdecl _get_daylight (_Out_ int *_Daylight)
 
_CRTIMP errno_t __cdecl _get_dstbias (_Out_ long *_Daylight_savings_bias)
 
_CRTIMP errno_t __cdecl _get_timezone (_Out_ long *_Timezone)
 
_CRTIMP errno_t __cdecl _get_tzname (_Out_ size_t *_ReturnValue, _Out_writes_z_(_SizeInBytes) char *_Buffer, _In_ size_t _SizeInBytes, _In_ int _Index)
 
_Check_return_ _CRTIMP char *__cdecl asctime (_In_ const struct tm *_Tm)
 
_CRTIMP char *__cdecl _ctime32 (_In_ const __time32_t *_Time)
 
_Check_return_ _CRTIMP clock_t __cdecl clock (void)
 
_CRTIMP double __cdecl _difftime32 (_In_ __time32_t _Time1, _In_ __time32_t _Time2)
 
_Check_return_ _CRTIMP struct tm *__cdecl _gmtime32 (_In_ const __time32_t *_Time)
 
_CRTIMP struct tm *__cdecl _localtime32 (_In_ const __time32_t *_Time)
 
 _Success_ (return > 0) _CRTIMP size_t __cdecl strftime(_Out_writes_z_(_SizeInBytes) char *_Buf
 
_CRTIMP char *__cdecl _strdate (_Out_writes_z_(9) char *_Buffer)
 
_CRTIMP char *__cdecl _strtime (_Out_writes_z_(9) char *_Buffer)
 
_CRTIMP __time32_t __cdecl _time32 (_Out_opt_ __time32_t *_Time)
 
_CRTIMP __time32_t __cdecl _mktime32 (_Inout_ struct tm *_Tm)
 
_CRTIMP __time32_t __cdecl _mkgmtime32 (_Inout_ struct tm *_Tm)
 
_CRTIMP void __cdecl _tzset (void)
 
 _CRT_OBSOLETE (GetLocalTime) unsigned __cdecl _getsystime(_Out_ struct tm *_Tm)
 
unsigned __cdecl _setsystime (_In_ struct tm *_Tm, unsigned _MilliSec)
 
_Check_return_wat_ _CRTIMP errno_t __cdecl asctime_s (_Out_writes_(_SizeInBytes) _Post_readable_size_(26) char *_Buf, _In_range_(>=, 26) size_t _SizeInBytes, _In_ const struct tm *_Tm)
 
 _Success_ (return==0) _CRTIMP errno_t __cdecl _ctime32_s(_Out_writes_(_SizeInBytes) _Post_readable_size_(26) char *_Buf
 
_Check_return_wat_ _CRTIMP errno_t __cdecl _gmtime32_s (_In_ struct tm *_Tm, _In_ const __time32_t *_Time)
 
_CRTIMP errno_t __cdecl _localtime32_s (_Out_ struct tm *_Tm, _In_ const __time32_t *_Time)
 
_Check_return_wat_ _CRTIMP errno_t __cdecl _strdate_s (_Out_writes_(_SizeInBytes) _Post_readable_size_(9) char *_Buf, _In_range_(>=, 9) size_t _SizeInBytes)
 
_Check_return_wat_ _CRTIMP errno_t __cdecl _strtime_s (_Out_writes_(_SizeInBytes) _Post_readable_size_(9) char *_Buf, _In_range_(>=, 9) size_t _SizeInBytes)
 
_CRTIMP wchar_t *__cdecl _wasctime (_In_ const struct tm *_Tm)
 
_CRTIMP wchar_t *__cdecl _wctime (const time_t *_Time)
 
_CRTIMP wchar_t *__cdecl _wctime32 (_In_ const __time32_t *_Time)
 
_CRTIMP wchar_t *__cdecl _wstrdate (_Out_writes_z_(9) wchar_t *_Buffer)
 
_CRTIMP wchar_t *__cdecl _wstrtime (_Out_writes_z_(9) wchar_t *_Buffer)
 
_CRTIMP errno_t __cdecl _wasctime_s (_Out_writes_(_SizeInWords) _Post_readable_size_(26) wchar_t *_Buf, _In_range_(>=, 26) size_t _SizeInWords, _In_ const struct tm *_Tm)
 
_CRTIMP errno_t __cdecl _wstrdate_s (_Out_writes_(_SizeInWords) _Post_readable_size_(9) wchar_t *_Buf, _In_ size_t _SizeInWords)
 
_CRTIMP errno_t __cdecl _wstrtime_s (_Out_writes_(_SizeInWords) _Post_readable_size_(9) wchar_t *_Buf, _In_range_(>=, 9) size_t _SizeInWords)
 
_CRTIMP double __cdecl difftime (time_t _Time1, time_t _Time2)
 
_CRTIMP char *__cdecl ctime (const time_t *_Time)
 
_CRTIMP struct tm *__cdecl gmtime (const time_t *_Time)
 
_CRTIMP struct tm *__cdecl localtime (const time_t *_Time)
 
_CRTIMP struct tm *__cdecl localtime_r (const time_t *_Time, struct tm *)
 
_CRTIMP time_t __cdecl mktime (struct tm *_Tm)
 
_CRTIMP time_t __cdecl _mkgmtime (struct tm *_Tm)
 
_CRTIMP time_t __cdecl time (time_t *_Time)
 
__CRT_INLINE errno_t __cdecl localtime_s (struct tm *_Tm, const time_t *_Time)
 
_CRTIMP void __cdecl tzset (void)
 

Variables

_In_ size_t _SizeInBytes
 
_In_ size_t _In_z_ _Printf_format_string_ const char_Format
 
_In_ size_t _In_z_ _Printf_format_string_ const char _In_ const struct tm_Tm
 
_In_ size_t _Max_size
 
_In_ size_t _In_z_ _Printf_format_string_ const char _In_ const struct tm _In_opt_ _locale_t _Locale
 
_In_ size_t _In_ const __time32_t_Time
 
_In_ size_t _SizeInWords
 
_CRTIMP int daylight
 
_CRTIMP long timezone
 
_CRTIMP chartzname [2]
 

Macro Definition Documentation

◆ _CLOCK_T_DEFINED

#define _CLOCK_T_DEFINED

Definition at line 48 of file time.h.

◆ _INC_WTIME_INL

#define _INC_WTIME_INL

Definition at line 379 of file time.h.

◆ _SIZE_T_DEFINED

#define _SIZE_T_DEFINED

Definition at line 53 of file time.h.

◆ _TIME32_T_DEFINED

#define _TIME32_T_DEFINED

This file has no copyright assigned and is placed in the Public Domain. This file is part of the w64 mingw-runtime package. No warranty is given; refer to the file DISCLAIMER within this package.

Definition at line 23 of file time.h.

◆ _TIME64_T_DEFINED

#define _TIME64_T_DEFINED

Definition at line 28 of file time.h.

◆ _TIME_T_DEFINED

#define _TIME_T_DEFINED

Definition at line 39 of file time.h.

◆ _TM_DEFINED

#define _TM_DEFINED

Definition at line 67 of file time.h.

◆ _WTIME_DEFINED

#define _WTIME_DEFINED

Definition at line 285 of file time.h.

◆ CLK_TCK

#define CLK_TCK   CLOCKS_PER_SEC

Definition at line 425 of file time.h.

◆ CLOCKS_PER_SEC

#define CLOCKS_PER_SEC   1000

Definition at line 81 of file time.h.

Typedef Documentation

◆ __time32_t

typedef long __time32_t

Definition at line 24 of file time.h.

◆ clock_t

typedef long clock_t

Definition at line 49 of file time.h.

◆ size_t

typedef unsigned int size_t

Definition at line 62 of file time.h.

◆ time_t

typedef __time64_t time_t

Definition at line 43 of file time.h.

Function Documentation

◆ _CRT_OBSOLETE()

_CRT_OBSOLETE ( GetLocalTime  )

◆ _CRTDATA() [1/3]

_CRTDATA ( extern char _tzname[2])

◆ _CRTDATA() [2/3]

_CRTDATA ( extern int  _daylight)

◆ _CRTDATA() [3/3]

_CRTDATA ( extern long  _dstbias)

◆ _ctime32()

_CRTIMP char *__cdecl _ctime32 ( _In_ const __time32_t _Time)

◆ _difftime32()

_CRTIMP double __cdecl _difftime32 ( _In_ __time32_t  _Time1,
_In_ __time32_t  _Time2 
)

◆ _get_daylight()

_CRTIMP errno_t __cdecl _get_daylight ( _Out_ int _Daylight)

◆ _get_dstbias()

_CRTIMP errno_t __cdecl _get_dstbias ( _Out_ long _Daylight_savings_bias)

◆ _get_timezone()

_CRTIMP errno_t __cdecl _get_timezone ( _Out_ long _Timezone)

◆ _get_tzname()

_CRTIMP errno_t __cdecl _get_tzname ( _Out_ size_t _ReturnValue,
_Out_writes_z_(_SizeInBytes) char _Buffer,
_In_ size_t  _SizeInBytes,
_In_ int  _Index 
)

Referenced by _Strftime().

◆ _gmtime32()

◆ _gmtime32_s()

_Check_return_wat_ _CRTIMP errno_t __cdecl _gmtime32_s ( _In_ struct tm _Tm,
_In_ const __time32_t _Time 
)

◆ _localtime32()

_CRTIMP struct tm *__cdecl _localtime32 ( _In_ const __time32_t _Time)

◆ _localtime32_s()

_CRTIMP errno_t __cdecl _localtime32_s ( _Out_ struct tm _Tm,
_In_ const __time32_t _Time 
)

◆ _mkgmtime()

__CRT_INLINE time_t __cdecl _mkgmtime ( struct tm _Tm)

Definition at line 419 of file time.h.

419{ return _mkgmtime64(_Tm); }
_In_ size_t _In_z_ _Printf_format_string_ const char _In_ const struct tm * _Tm
Definition: time.h:148
__time64_t _mkgmtime64(struct tm *ptm)
Definition: mktime.c:142

Referenced by _tzset().

◆ _mkgmtime32()

_CRTIMP __time32_t __cdecl _mkgmtime32 ( _Inout_ struct tm _Tm)

◆ _mktime32()

_CRTIMP __time32_t __cdecl _mktime32 ( _Inout_ struct tm _Tm)

◆ _setsystime()

unsigned __cdecl _setsystime ( _In_ struct tm _Tm,
unsigned  _MilliSec 
)

◆ _strdate()

_CRTIMP char *__cdecl _strdate ( _Out_writes_z_(9) char _Buffer)

Referenced by test_strdate().

◆ _strdate_s()

◆ _strtime()

_CRTIMP char *__cdecl _strtime ( _Out_writes_z_(9) char _Buffer)

Referenced by test_strtime().

◆ _strtime_s()

◆ _Success_() [1/2]

_Success_ ( return  ,
 
)

◆ _Success_() [2/2]

_Success_ ( return  = = 0)

◆ _time32()

◆ _tzset()

_CRTIMP void __cdecl _tzset ( void  )

Definition at line 92 of file timezone.c.

93{
94 const char * str;
95
96 if (_tz_is_set)
97 {
98 return;
99 }
100
101 /* Try to read the timezone from environment */
102 str = getenv("TZ");
103 if (str && str[0] != 0)
104 {
105 long hour = 0, min = 0, sec = 0;
106 size_t len = strnlen(str, 16);
107 int sign = 1;
108
109 dst_begin = 0;
110
111 for (;;)
112 {
113 /* Copy timezone name */
114 strncpy(tz_name, str, 3);
115 str += 3;
116 len -= 3;
117
118 if (len < 1) break;
119
120 if (*str == '+' || *str == '-')
121 {
122 sign = *str == '-' ? -1 : 1;
123 str++;
124 len--;
125 }
126
127 if (len < 1) break;
128
129 hour = atol(str);
130
131 while (*str != 0 && *str != ':') str++;
132 if (*str == 0) break;
133
134 min = atol(++str);
135
136 while (*str != 0 && *str != ':') str++;
137 if (*str == 0) break;
138
139 sec = atol(++str);
140
141 while (*str != 0 && *str <= '9') str++;
142 if (*str == 0) break;
143
144 /* Copy DST name */
146
147 // FIXME: set dst_begin etc
148
149 /* We are finished */
150 break;
151 }
152
153 _timezone = sign * (((hour * 60) + min) * 60 + sec);
154
155 }
156 else
157 {
159 DWORD ret;
160
163 {
164 return;
165 }
166
168 0,
169 tzi.StandardName,
170 -1,
171 tz_name,
172 sizeof(tz_name),
173 NULL,
174 NULL);
175
177 0,
178 tzi.DaylightName,
179 -1,
181 sizeof(tz_dst_name),
182 NULL,
183 NULL);
184
185 _timezone = tzi.Bias * 60;
186
187 if (tzi.DaylightDate.wMonth)
188 {
189 struct tm _tm;
190
191 _daylight = 1;
192 _dstbias = (tzi.DaylightBias - tzi.StandardBias) * 60;
193 _tm.tm_year = 70;
194 _tm.tm_mon = tzi.DaylightDate.wMonth - 1;
195 _tm.tm_mday = tzi.DaylightDate.wDay;
196 _tm.tm_hour = tzi.DaylightDate.wHour;
197 _tm.tm_min = tzi.DaylightDate.wMinute;
198 _tm.tm_sec = tzi.DaylightDate.wSecond;
199 dst_begin = (long)_mkgmtime(&_tm);
200 _tm.tm_mon = tzi.StandardDate.wMonth - 1;
201 _tm.tm_mday = tzi.StandardDate.wDay;
202 _tm.tm_hour = tzi.StandardDate.wHour;
203 _tm.tm_min = tzi.StandardDate.wMinute;
204 _tm.tm_sec = tzi.StandardDate.wSecond;
205 dst_end = (long)_mkgmtime(&_tm);
206 }
207 else
208 {
209 _daylight = 0;
210 _dstbias = 0;
211 }
212
213 }
214 _tz_is_set = 1;
215}
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
Definition: timezone.c:262
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
_Check_return_ long __cdecl atol(_In_z_ const char *_Str)
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
#define sign(x)
Definition: mapdesc.cc:613
#define min(a, b)
Definition: monoChain.cc:55
#define long
Definition: qsort.c:33
const WCHAR * str
_CRTIMP time_t __cdecl _mkgmtime(struct tm *_Tm)
Definition: time.h:419
int _daylight
Definition: timezone.c:30
long dst_begin
Definition: timezone.c:16
long _dstbias
Definition: timezone.c:62
static char tz_dst_name[64]
Definition: timezone.c:14
long _timezone
Definition: timezone.c:46
long dst_end
Definition: timezone.c:17
static char tz_name[64]
Definition: timezone.c:13
char _tz_is_set
Definition: timezone.c:10
WORD wMonth
Definition: winbase.h:906
WORD wHour
Definition: winbase.h:909
WORD wSecond
Definition: winbase.h:911
WORD wMinute
Definition: winbase.h:910
WORD wDay
Definition: winbase.h:908
SYSTEMTIME DaylightDate
Definition: winbase.h:1211
WCHAR DaylightName[32]
Definition: winbase.h:1210
WCHAR StandardName[32]
Definition: winbase.h:1207
SYSTEMTIME StandardDate
Definition: winbase.h:1208
Definition: time.h:68
int ret
#define TIME_ZONE_ID_INVALID
Definition: winbase.h:286

Referenced by _Strftime(), gettimeofday(), localtime(), and test__tzset().

◆ _wasctime()

_CRTIMP wchar_t *__cdecl _wasctime ( _In_ const struct tm _Tm)

◆ _wasctime_s()

_CRTIMP errno_t __cdecl _wasctime_s ( _Out_writes_(_SizeInWords) _Post_readable_size_(26) wchar_t _Buf,
_In_range_(>=, 26) size_t  _SizeInWords,
_In_ const struct tm _Tm 
)

◆ _wctime()

__CRT_INLINE wchar_t *__cdecl _wctime ( const time_t _Time)

Definition at line 384 of file time.h.

384{ return _wctime64(_Time); }
_In_ size_t _In_ const __time32_t * _Time
Definition: time.h:192

◆ _wctime32()

_CRTIMP wchar_t *__cdecl _wctime32 ( _In_ const __time32_t _Time)

◆ _wstrdate()

_CRTIMP wchar_t *__cdecl _wstrdate ( _Out_writes_z_(9) wchar_t _Buffer)

Referenced by test_wstrdate().

◆ _wstrdate_s()

_CRTIMP errno_t __cdecl _wstrdate_s ( _Out_writes_(_SizeInWords) _Post_readable_size_(9) wchar_t _Buf,
_In_ size_t  _SizeInWords 
)

◆ _wstrtime()

_CRTIMP wchar_t *__cdecl _wstrtime ( _Out_writes_z_(9) wchar_t _Buffer)

Referenced by test_wstrtime().

◆ _wstrtime_s()

_CRTIMP errno_t __cdecl _wstrtime_s ( _Out_writes_(_SizeInWords) _Post_readable_size_(9) wchar_t _Buf,
_In_range_(>=, 9) size_t  _SizeInWords 
)

◆ asctime()

◆ asctime_s()

◆ clock()

◆ ctime()

_CRTIMP char *__cdecl ctime ( const time_t _Time)

Definition at line 414 of file time.h.

414{ return _ctime64(_Time); }

◆ difftime()

__CRT_INLINE double __cdecl difftime ( time_t  _Time1,
time_t  _Time2 
)

Definition at line 413 of file time.h.

413{ return _difftime64(_Time1,_Time2); }

◆ gmtime()

__CRT_INLINE struct tm *__cdecl gmtime ( const time_t _Time)

Definition at line 415 of file time.h.

415{ return _gmtime64(_Time); }
struct tm * _gmtime64(const __time64_t *ptime)
Definition: gmtime.c:104

Referenced by getit(), GetUTCOffset(), GmTimeStr(), HTTP_HttpQueryInfoW(), iso9660_date(), iso9660_ldate(), localtime(), rdp_send_logon_info(), time_to_filetime(), and write_client_lease().

◆ localtime()

◆ localtime_r()

_CRTIMP struct tm *__cdecl localtime_r ( const time_t _Time,
struct tm  
)

◆ localtime_s()

__CRT_INLINE errno_t __cdecl localtime_s ( struct tm _Tm,
const time_t _Time 
)

Definition at line 417 of file time.h.

417{ return _localtime64_s(_Tm,_Time); }

◆ mktime()

__CRT_INLINE time_t __cdecl mktime ( struct tm _Tm)

◆ time()

_CRTIMP time_t __cdecl time ( time_t _Time)

Definition at line 420 of file time.h.

420{ return _time64(_Time); }

◆ tzset()

_CRTIMP void __cdecl tzset ( void  )

Referenced by init_client().

Variable Documentation

◆ _Format

Definition at line 147 of file time.h.

Referenced by swprintf(), and vswprintf().

◆ _Locale

◆ _Max_size

_In_ size_t _Max_size

Definition at line 156 of file time.h.

◆ _SizeInBytes

_In_ size_t _SizeInBytes

Definition at line 146 of file time.h.

◆ _SizeInWords

_In_ size_t _SizeInWords

Definition at line 309 of file time.h.

Referenced by swprintf(), and vswprintf().

◆ _Time

Definition at line 192 of file time.h.

Referenced by _wctime(), ctime(), gmtime(), localtime(), localtime_s(), and time().

◆ _Tm

◆ daylight

_CRTIMP int daylight
extern

◆ timezone

◆ tzname

_CRTIMP char* tzname[2]
extern