ReactOS 0.4.16-dev-2104-gb84fa49
time.h
Go to the documentation of this file.
1
7#ifndef _TIME_H_
8#define _TIME_H_
9
10#include <corecrt.h>
11
12#ifndef _WIN32
13#error Only Win32 target is supported!
14#endif
15
16#pragma pack(push,_CRT_PACKING)
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#ifndef _TIME32_T_DEFINED
23#define _TIME32_T_DEFINED
24 typedef long __time32_t;
25#endif
26
27#ifndef _TIME64_T_DEFINED
28#define _TIME64_T_DEFINED
29#if _INTEGRAL_MAX_BITS >= 64
30#if defined(__GNUC__) && defined(__STRICT_ANSI__)
31 typedef int _time64_t __attribute__ ((mode (DI)));
32#else
34#endif
35#endif
36#endif
37
38#ifndef _TIME_T_DEFINED
39#define _TIME_T_DEFINED
40#ifdef _USE_32BIT_TIME_T
41 typedef __time32_t time_t;
42#else
44#endif
45#endif
46
47#ifndef _CLOCK_T_DEFINED
48#define _CLOCK_T_DEFINED
49 typedef long clock_t;
50#endif
51
52#ifndef _SIZE_T_DEFINED
53#define _SIZE_T_DEFINED
54#undef size_t
55#ifdef _WIN64
56#if defined(__GNUC__) && defined(__STRICT_ANSI__)
57 typedef unsigned int size_t __attribute__ ((mode (DI)));
58#else
59 __MINGW_EXTENSION typedef unsigned __int64 size_t;
60#endif
61#else
62 typedef unsigned int size_t;
63#endif
64#endif
65
66#ifndef _TM_DEFINED
67#define _TM_DEFINED
68 struct tm {
69 int tm_sec;
70 int tm_min;
71 int tm_hour;
72 int tm_mday;
73 int tm_mon;
74 int tm_year;
75 int tm_wday;
76 int tm_yday;
77 int tm_isdst;
78 };
79#endif
80
81#define CLOCKS_PER_SEC 1000
82
83 _CRTDATA(extern int _daylight);
84 _CRTDATA(extern long _dstbias);
85 _CRTDATA(extern long _timezone);
86 _CRTDATA(extern char * _tzname[2]);
87
89 _CRTIMP errno_t __cdecl _get_dstbias(_Out_ long *_Daylight_savings_bias);
91
96 _Out_ size_t *_ReturnValue,
98 _In_ size_t _SizeInBytes,
99 _In_ int _Index);
100
102 _CRTIMP
104 char *
105 __cdecl
107 _In_ const struct tm *_Tm);
108
109 _CRTIMP
111 char *
112 __cdecl
114 _In_ const __time32_t *_Time);
115
117
118 _CRTIMP
119 double
120 __cdecl
122 _In_ __time32_t _Time1,
124
126 _CRTIMP
128 struct tm *
129 __cdecl
131 _In_ const __time32_t *_Time);
132
133 _CRTIMP
135 struct tm *
136 __cdecl
138 _In_ const __time32_t *_Time);
139
140 _Success_(return > 0)
141 _CRTIMP
142 size_t
143 __cdecl
144 strftime(
145 _Out_writes_z_(_SizeInBytes) char *_Buf,
149
150 _Success_(return > 0)
151 _CRTIMP
152 size_t
153 __cdecl
155 _Out_writes_z_(_Max_size) char *_Buf,
160
166 _CRTIMP void __cdecl _tzset(void);
168
170 unsigned
171 __cdecl
173 _In_ struct tm *_Tm,
174 unsigned _MilliSec);
175
177 _CRTIMP
178 errno_t
179 __cdecl
182 _In_range_(>= , 26) size_t _SizeInBytes,
184
185 _Success_(return == 0)
186 _CRTIMP
187 errno_t
188 __cdecl
191 _In_ size_t _SizeInBytes,
193
195 _CRTIMP
196 errno_t
197 __cdecl
199 _In_ struct tm *_Tm,
201
202 _CRTIMP
203 errno_t
204 __cdecl
208
210 _CRTIMP
211 errno_t
212 __cdecl
215 _In_range_(>= , 9) size_t _SizeInBytes);
216
218 _CRTIMP
219 errno_t
220 __cdecl
223 _In_range_(>= , 9) size_t _SizeInBytes);
224
225#if _INTEGRAL_MAX_BITS >= 64
226
228 _CRTIMP
229 double
230 __cdecl
232 _In_ __time64_t _Time1,
234
235 _CRTIMP
237 char *
238 __cdecl
239 _ctime64(
240 _In_ const __time64_t *_Time);
241
242 _CRTIMP
244 struct tm *
245 __cdecl
246 _gmtime64(
247 _In_ const __time64_t *_Time);
248
249 _CRTIMP
251 struct tm *
252 __cdecl
254 _In_ const __time64_t *_Time);
255
259
260 _CRTIMP
261 errno_t
262 __cdecl
264 _Out_writes_z_(_SizeInBytes) char *_Buf,
265 _In_ size_t _SizeInBytes,
266 _In_ const __time64_t *_Time);
267
268 _CRTIMP
269 errno_t
270 __cdecl
272 _Out_ struct tm *_Tm,
273 _In_ const __time64_t *_Time);
274
275 _CRTIMP
276 errno_t
277 __cdecl
279 _Out_ struct tm *_Tm,
280 _In_ const __time64_t *_Time);
281
282#endif /* _INTEGRAL_MAX_BITS >= 64 */
283
284#ifndef _WTIME_DEFINED
285#define _WTIME_DEFINED
286
287 _CRTIMP
289 wchar_t *
290 __cdecl
292 _In_ const struct tm *_Tm);
293
294 _CRTIMP wchar_t *__cdecl _wctime(const time_t *_Time);
295
296 _CRTIMP
298 wchar_t *
299 __cdecl
301 _In_ const __time32_t *_Time);
302
303 _Success_(return > 0)
304 _CRTIMP
305 size_t
306 __cdecl
307 wcsftime(
308 _Out_writes_z_(_SizeInWords) wchar_t *_Buf,
312
313 _Success_(return > 0)
314 _CRTIMP
315 size_t
316 __cdecl
318 _Out_writes_z_(_SizeInWords) wchar_t *_Buf,
319 _In_ size_t _SizeInWords,
323
326
327 _CRTIMP
328 errno_t
329 __cdecl
332 _In_range_(>= , 26) size_t _SizeInWords,
334
335 _Success_(return == 0)
336 _CRTIMP
337 errno_t
338 __cdecl
341 _In_ size_t _SizeInWords,
343
344 _CRTIMP
345 errno_t
346 __cdecl
349 _In_ size_t _SizeInWords);
350
351 _CRTIMP
352 errno_t
353 __cdecl
356 _In_range_(>= , 9) size_t _SizeInWords);
357
358#if _INTEGRAL_MAX_BITS >= 64
359
360 _CRTIMP
362 wchar_t *
363 __cdecl
364 _wctime64(
365 _In_ const __time64_t *_Time);
366
367 _Success_(return == 0)
368 _CRTIMP
369 errno_t
370 __cdecl
373 _In_ size_t _SizeInWords,
375
376#endif /* _INTEGRAL_MAX_BITS >= 64 */
377
378#if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL)
379#define _INC_WTIME_INL
380#ifdef _USE_32BIT_TIME_T
381/* Do it like this to be compatible to msvcrt.dll on 32 bit windows XP and before */
382__CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime32(_Time); }
383#else
384__CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); }
385#endif
386#endif
387
388#endif /* !_WTIME_DEFINED */
389
391 _CRTIMP char *__cdecl ctime(const time_t *_Time);
392 _CRTIMP struct tm *__cdecl gmtime(const time_t *_Time);
393 _CRTIMP struct tm *__cdecl localtime(const time_t *_Time);
394 _CRTIMP struct tm *__cdecl localtime_r(const time_t *_Time,struct tm *);
395
399
400#if !defined(RC_INVOKED) && !defined(_NO_INLINING) && !defined(_CRTBLD)
401#ifdef _USE_32BIT_TIME_T
402#if 0
403__CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2) { return _difftime32(_Time1,_Time2); }
404__CRT_INLINE char *__cdecl ctime(const time_t *_Time) { return _ctime32(_Time); }
405__CRT_INLINE struct tm *__cdecl gmtime(const time_t *_Time) { return _gmtime32(_Time); }
406__CRT_INLINE struct tm *__cdecl localtime(const time_t *_Time) { return _localtime32(_Time); }
407__CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime32_s(_Tm,_Time); }
408__CRT_INLINE time_t __cdecl mktime(struct tm *_Tm) { return _mktime32(_Tm); }
409__CRT_INLINE time_t __cdecl _mkgmtime(struct tm *_Tm) { return _mkgmtime32(_Tm); }
410__CRT_INLINE time_t __cdecl time(time_t *_Time) { return _time32(_Time); }
411#endif
412#else
413__CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2) { return _difftime64(_Time1,_Time2); }
414__CRT_INLINE char *__cdecl ctime(const time_t *_Time) { return _ctime64(_Time); }
415__CRT_INLINE struct tm *__cdecl gmtime(const time_t *_Time) { return _gmtime64(_Time); }
416__CRT_INLINE struct tm *__cdecl localtime(const time_t *_Time) { return _localtime64(_Time); }
417__CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime64_s(_Tm,_Time); }
418__CRT_INLINE time_t __cdecl mktime(struct tm *_Tm) { return _mktime64(_Tm); }
419__CRT_INLINE time_t __cdecl _mkgmtime(struct tm *_Tm) { return _mkgmtime64(_Tm); }
420__CRT_INLINE time_t __cdecl time(time_t *_Time) { return _time64(_Time); }
421#endif
422#endif
423
424#if !defined(NO_OLDNAMES) || defined(_POSIX)
425#define CLK_TCK CLOCKS_PER_SEC
426
427 _CRTIMP extern int daylight;
428 _CRTIMP extern long timezone;
429 _CRTIMP extern char *tzname[2];
431#endif
432
433#ifdef __cplusplus
434}
435#endif
436
437#pragma pack(pop)
438
439#endif /* End _TIME_H_ */
#define __MINGW_EXTENSION
Definition: _mingw.h:166
return
Definition: dirsup.c:529
#define __attribute__(x)
Definition: wpp_private.h:207
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
__msvcrt_long __time32_t
Definition: corecrt.h:209
int errno_t
Definition: corecrt.h:249
#define __cdecl
Definition: corecrt.h:121
#define __int64
Definition: corecrt.h:72
__time32_t time_t
Definition: corecrt.h:228
_ACRTIMP wchar_t *__cdecl _wctime64(const __time64_t *)
Definition: time.c:1782
_ACRTIMP size_t __cdecl _wcsftime_l(wchar_t *, size_t, const wchar_t *, const struct tm *, _locale_t)
Definition: time.c:1576
_ACRTIMP size_t __cdecl wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *)
Definition: time.c:1585
_ACRTIMP struct tm *__cdecl _gmtime32(const __time32_t *)
Definition: time.c:538
_ACRTIMP size_t __cdecl _strftime_l(char *, size_t, const char *, const struct tm *, _locale_t)
__msvcrt_long _timezone
Definition: timezone.c:46
_ACRTIMP errno_t __cdecl _strtime_s(char *, size_t)
Definition: time.c:645
_ACRTIMP double __cdecl _difftime32(__time32_t, __time32_t)
Definition: time.c:717
_ACRTIMP int __cdecl _gmtime32_s(struct tm *res, const __time32_t *secs)
Definition: time.c:524
_ACRTIMP errno_t __cdecl _localtime32_s(struct tm *, const __time32_t *)
Definition: time.c:444
_ACRTIMP struct tm *__cdecl _gmtime64(const __time64_t *)
Definition: time.c:509
int _daylight
Definition: timezone.c:30
_ACRTIMP size_t __cdecl strftime(char *, size_t, const char *, const struct tm *)
Definition: time.c:1537
_ACRTIMP clock_t __cdecl clock(void)
Definition: time.c:698
_ACRTIMP int __cdecl _gmtime64_s(struct tm *res, const __time64_t *secs)
Definition: time.c:464
_ACRTIMP __time32_t __cdecl _mktime32(struct tm *)
Definition: time.c:339
_ACRTIMP struct tm *__cdecl _localtime64(const __time64_t *)
Definition: time.c:415
_ACRTIMP errno_t __cdecl _ctime64_s(char *, size_t, const __time64_t *)
Definition: time.c:1731
__msvcrt_long _dstbias
Definition: timezone.c:62
static struct tm * gmtime(const time_t *t)
Definition: time.h:120
_ACRTIMP char *__cdecl _ctime64(const __time64_t *)
Definition: time.c:1720
_ACRTIMP char *__cdecl _ctime32(const __time32_t *)
Definition: time.c:1751
_ACRTIMP __time64_t __cdecl _mktime64(struct tm *)
Definition: time.c:331
_ACRTIMP unsigned __cdecl _setsystime(struct tm *, unsigned)
Definition: systime.cpp:41
_ACRTIMP __time64_t __cdecl _time64(__time64_t *)
Definition: time.c:780
_ACRTIMP __time32_t __cdecl _time32(__time32_t *)
Definition: time.c:794
static double difftime(time_t t1, time_t t2)
Definition: time.h:119
_ACRTIMP double __cdecl _difftime64(__time64_t, __time64_t)
Definition: time.c:709
_ACRTIMP struct tm *__cdecl _localtime32(const __time32_t *)
Definition: time.c:430
char * _tzname
Definition: timezone.c:22
static time_t mktime(struct tm *tm)
Definition: time.h:123
_ACRTIMP errno_t __cdecl _strdate_s(char *, size_t)
Definition: time.c:572
_ACRTIMP void __cdecl _tzset(void)
Definition: time.c:127
_ACRTIMP unsigned __cdecl _getsystime(struct tm *)
Definition: systime.c:18
_ACRTIMP char *__cdecl asctime(const struct tm *)
Definition: time.c:1636
_ACRTIMP errno_t __cdecl _ctime32_s(char *, size_t, const __time32_t *)
Definition: time.c:1762
static struct tm * localtime(const time_t *t)
Definition: time.h:121
__msvcrt_long clock_t
Definition: time.h:28
static errno_t localtime_s(struct tm *res, const time_t *t)
Definition: time.h:122
_ACRTIMP errno_t __cdecl _localtime64_s(struct tm *, const __time64_t *)
Definition: time.c:367
int CDECL _wctime64_s(wchar_t *buf, size_t size, const __time64_t *time)
Definition: time.c:1798
int CDECL _wctime32_s(wchar_t *buf, size_t size, const __time32_t *time)
Definition: time.c:1821
__time64_t CDECL _mkgmtime64(struct tm *time)
Definition: time.c:350
GLenum mode
Definition: glext.h:6217
__u16 ctime
Definition: mkdosfs.c:4
__u16 time
Definition: mkdosfs.c:8
#define _Out_writes_z_(s)
Definition: no_sal2.h:180
#define _Out_opt_
Definition: no_sal2.h:214
#define _Post_readable_size_(s)
Definition: no_sal2.h:536
#define _Inout_
Definition: no_sal2.h:162
#define _Success_(c)
Definition: no_sal2.h:84
#define _In_z_
Definition: no_sal2.h:164
#define _Check_return_
Definition: no_sal2.h:60
#define _Out_writes_(s)
Definition: no_sal2.h:176
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define _In_range_(l, h)
Definition: no_sal2.h:368
#define _Printf_format_string_
Definition: no_sal2.h:356
_In_ size_t _In_z_ _Printf_format_string_ const char * _Format
Definition: time.h:147
_CRTIMP errno_t __cdecl _get_tzname(_Out_ size_t *_ReturnValue, _Out_writes_z_(_SizeInBytes) char *_Buffer, _In_ size_t _SizeInBytes, _In_ int _Index)
_CRTIMP wchar_t *__cdecl _wctime32(_In_ const __time32_t *_Time)
_CRTIMP errno_t __cdecl _wstrdate_s(_Out_writes_(_SizeInWords) _Post_readable_size_(9) wchar_t *_Buf, _In_ size_t _SizeInWords)
_CRTIMP char * tzname[2]
_CRTIMP errno_t __cdecl _get_daylight(_Out_ int *_Daylight)
_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 wchar_t *__cdecl _wctime(const time_t *_Time)
Definition: time.h:384
_In_ size_t _In_ const __time32_t * _Time
Definition: time.h:192
_In_ size_t _SizeInBytes
Definition: time.h:146
_CRTIMP void __cdecl tzset(void)
_CRTIMP errno_t __cdecl _wstrtime_s(_Out_writes_(_SizeInWords) _Post_readable_size_(9) wchar_t *_Buf, _In_range_(>=, 9) size_t _SizeInWords)
unsigned int size_t
Definition: time.h:62
__time64_t time_t
Definition: time.h:43
_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)
_In_ size_t _SizeInWords
Definition: time.h:309
_CRTIMP wchar_t *__cdecl _wasctime(_In_ const struct tm *_Tm)
_CRTIMP time_t __cdecl _mkgmtime(struct tm *_Tm)
Definition: time.h:419
_CRTIMP __time32_t __cdecl _mkgmtime32(_Inout_ struct tm *_Tm)
_CRTIMP errno_t __cdecl _get_dstbias(_Out_ long *_Daylight_savings_bias)
_CRTIMP int daylight
_CRTIMP struct tm *__cdecl localtime_r(const time_t *_Time, struct tm *)
_CRTIMP long timezone
_In_ size_t _In_z_ _Printf_format_string_ const char _In_ const struct tm _In_opt_ _locale_t _Locale
Definition: time.h:159
_CRTIMP errno_t __cdecl _get_timezone(_Out_ long *_Timezone)
_In_ size_t _In_z_ _Printf_format_string_ const char _In_ const struct tm * _Tm
Definition: time.h:148
_In_ size_t _Max_size
Definition: time.h:156
long __time32_t
Definition: time.h:24
#define _CRT_OBSOLETE(_NewItem)
Definition: corecrt.h:549
__int64 __time64_t
Definition: corecrt.h:619
#define _Check_return_wat_
Definition: corecrt.h:230
_wstrtime
_wstrdate
_In_ _Pre_notnull_ _Buffer
Definition: stdlib.h:644
_In_ size_t _In_ int _Index
Definition: time.h:111
_strdate
Definition: time.h:297
_strtime
Definition: time.h:313
_In_ __time32_t _Time2
Definition: time.h:190
#define _CRTDATA(x)
Definition: crtdefs.h:83
int tm_mon
Definition: corecrt_wtime.h:16
int tm_year
Definition: corecrt_wtime.h:17
int tm_hour
Definition: corecrt_wtime.h:14
int tm_sec
Definition: corecrt_wtime.h:12
int tm_isdst
Definition: corecrt_wtime.h:20
int tm_yday
Definition: corecrt_wtime.h:19
int tm_mday
Definition: corecrt_wtime.h:15
int tm_min
Definition: corecrt_wtime.h:13
int tm_wday
Definition: corecrt_wtime.h:18
#define _CRT_INSECURE_DEPRECATE(_Replacement)
Definition: vcruntime.h:99
#define _CRTIMP
Definition: vcruntime.h:54
#define const
Definition: zconf.h:233