ReactOS 0.4.16-dev-336-gb667d82
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
33 __MINGW_EXTENSION typedef __int64 __time64_t;
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
43 typedef __time64_t time_t;
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;
73 int tm_mon;
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,
97 _Out_writes_z_(_SizeInBytes) char *_Buffer,
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
110 _CRT_INSECURE_DEPRECATE(_ctime32_s)
111 char *
112 __cdecl
114 _In_ const __time32_t *_Time);
115
117
118 _CRTIMP
119 double
120 __cdecl
122 _In_ __time32_t _Time1,
123 _In_ __time32_t _Time2);
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
154 _strftime_l(
155 _Out_writes_z_(_Max_size) char *_Buf,
160
161 _CRTIMP char *__cdecl _strdate(_Out_writes_z_(9) char *_Buffer);
162 _CRTIMP char *__cdecl _strtime(_Out_writes_z_(9) char *_Buffer);
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
186 _CRTIMP
187 errno_t
188 __cdecl
189 _ctime32_s(
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
231 _difftime64(
232 _In_ __time64_t _Time1,
233 _In_ __time64_t _Time2);
234
235 _CRTIMP
236 _CRT_INSECURE_DEPRECATE(_ctime64_s)
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
250 _CRT_INSECURE_DEPRECATE(_localtime64_s)
251 struct tm *
252 __cdecl
253 _localtime64(
254 _In_ const __time64_t *_Time);
255
256 _CRTIMP __time64_t __cdecl _mktime64(_Inout_ struct tm *_Tm);
257 _CRTIMP __time64_t __cdecl _mkgmtime64(_Inout_ struct tm *_Tm);
258 _CRTIMP __time64_t __cdecl _time64(_Out_opt_ __time64_t *_Time);
259
260 _CRTIMP
261 errno_t
262 __cdecl
263 _ctime64_s(
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
278 _localtime64_s(
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
317 _wcsftime_l(
318 _Out_writes_z_(_SizeInWords) wchar_t *_Buf,
319 _In_ size_t _SizeInWords,
323
324 _CRTIMP wchar_t *__cdecl _wstrdate(_Out_writes_z_(9) wchar_t *_Buffer);
325 _CRTIMP wchar_t *__cdecl _wstrtime(_Out_writes_z_(9) wchar_t *_Buffer);
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
361 _CRT_INSECURE_DEPRECATE(_wctime64_s)
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
371 _wctime64_s(
373 _In_ size_t _SizeInWords,
374 _In_ const __time64_t *_Time);
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
390 _CRTIMP double __cdecl difftime(time_t _Time1,time_t _Time2);
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
#define __cdecl
Definition: accygwin.h:79
#define __int64
Definition: basetyps.h:16
return
Definition: dirsup.c:529
#define _CRT_OBSOLETE(_NewItem)
Definition: crtdefs.h:185
#define _Check_return_wat_
Definition: crtdefs.h:303
#define _CRTDATA(x)
Definition: crtdefs.h:83
int errno_t
Definition: crtdefs.h:223
#define __attribute__(x)
Definition: wpp_private.h:207
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
__kernel_time_t time_t
Definition: linux.h:252
__kernel_clock_t clock_t
Definition: linux.h:257
GLenum mode
Definition: glext.h:6217
struct tm * _gmtime64(const __time64_t *ptime)
Definition: gmtime.c:104
errno_t _gmtime64_s(struct tm *ptm, const __time64_t *ptime)
Definition: gmtime.c:122
_CRTIMP errno_t __cdecl _wctime32_s(_Out_writes_(_SizeInWords) _Post_readable_size_(26) wchar_t *_Buf, _In_ size_t _SizeInWords, _In_ const __time32_t *_Time)
__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
_Check_return_wat_ _CRTIMP errno_t __cdecl _strdate_s(_Out_writes_(_SizeInBytes) _Post_readable_size_(9) char *_Buf, _In_range_(>=, 9) size_t _SizeInBytes)
_CRTIMP struct tm *__cdecl _localtime32(_In_ const __time32_t *_Time)
_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)
_In_ size_t _In_z_ _Printf_format_string_ const char _In_ const struct tm * _Tm
Definition: time.h:148
_CRTIMP errno_t __cdecl _wstrdate_s(_Out_writes_(_SizeInWords) _Post_readable_size_(9) wchar_t *_Buf, _In_ size_t _SizeInWords)
_CRTIMP __time32_t __cdecl _mktime32(_Inout_ struct tm *_Tm)
_CRTIMP char *__cdecl _strtime(_Out_writes_z_(9) char *_Buffer)
_CRTIMP char * tzname[2]
_CRTIMP double __cdecl difftime(time_t _Time1, time_t _Time2)
Definition: time.h:413
_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)
_Check_return_ _CRTIMP char *__cdecl asctime(_In_ const struct tm *_Tm)
_CRTIMP struct tm *__cdecl gmtime(const time_t *_Time)
Definition: time.h:415
_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)
long clock_t
Definition: time.h:49
__CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm, const time_t *_Time)
Definition: time.h:417
unsigned int size_t
Definition: time.h:62
_CRTIMP time_t __cdecl mktime(struct tm *_Tm)
Definition: time.h:418
_Check_return_wat_ _CRTIMP errno_t __cdecl _strtime_s(_Out_writes_(_SizeInBytes) _Post_readable_size_(9) char *_Buf, _In_range_(>=, 9) size_t _SizeInBytes)
unsigned __cdecl _setsystime(_In_ struct tm *_Tm, unsigned _MilliSec)
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
Definition: clock.c:23
__time64_t time_t
Definition: time.h:43
_In_ size_t _In_z_ _Printf_format_string_ const char * _Format
Definition: time.h:147
_Check_return_ _CRTIMP struct tm *__cdecl _gmtime32(_In_ const __time32_t *_Time)
_CRTIMP wchar_t *__cdecl _wstrtime(_Out_writes_z_(9) wchar_t *_Buffer)
_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 char *__cdecl _strdate(_Out_writes_z_(9) char *_Buffer)
_CRTIMP wchar_t *__cdecl _wasctime(_In_ const struct tm *_Tm)
_CRTIMP time_t __cdecl _mkgmtime(struct tm *_Tm)
Definition: time.h:419
_CRTIMP double __cdecl _difftime32(_In_ __time32_t _Time1, _In_ __time32_t _Time2)
_In_ size_t _In_z_ _Printf_format_string_ const char _In_ const struct tm _In_opt_ _locale_t _Locale
Definition: time.h:159
_CRTIMP __time32_t __cdecl _time32(_Out_opt_ __time32_t *_Time)
_CRTIMP __time32_t __cdecl _mkgmtime32(_Inout_ struct tm *_Tm)
_CRTIMP wchar_t *__cdecl _wstrdate(_Out_writes_z_(9) wchar_t *_Buffer)
_CRTIMP errno_t __cdecl _get_dstbias(_Out_ long *_Daylight_savings_bias)
_CRTIMP char *__cdecl _ctime32(_In_ const __time32_t *_Time)
_CRTIMP int daylight
_CRTIMP struct tm *__cdecl localtime_r(const time_t *_Time, struct tm *)
_CRTIMP long timezone
_CRTIMP void __cdecl _tzset(void)
Definition: timezone.c:92
_CRTIMP struct tm *__cdecl localtime(const time_t *_Time)
Definition: time.h:416
_Check_return_wat_ _CRTIMP errno_t __cdecl _gmtime32_s(_In_ struct tm *_Tm, _In_ const __time32_t *_Time)
_CRTIMP errno_t __cdecl _get_timezone(_Out_ long *_Timezone)
_In_ size_t _Max_size
Definition: time.h:156
_CRTIMP errno_t __cdecl _localtime32_s(_Out_ struct tm *_Tm, _In_ const __time32_t *_Time)
long __time32_t
Definition: time.h:24
__time64_t _mkgmtime64(struct tm *ptm)
Definition: mktime.c:142
__time64_t _mktime64(struct tm *ptm)
Definition: mktime.c:148
int _daylight
Definition: timezone.c:30
char * _tzname[2]
Definition: timezone.c:22
long _dstbias
Definition: timezone.c:62
long _timezone
Definition: timezone.c:46
size_t CDECL strftime(char *str, size_t max, const char *format, const struct tm *mstm)
Definition: strftime.c:294
size_t CDECL wcsftime(wchar_t *str, size_t max, const wchar_t *format, const struct tm *mstm)
Definition: strftime.c:303
Definition: time.h:68
int tm_mon
Definition: time.h:73
int tm_year
Definition: time.h:74
int tm_hour
Definition: time.h:71
int tm_sec
Definition: time.h:69
int tm_isdst
Definition: time.h:77
int tm_yday
Definition: time.h:76
int tm_mday
Definition: time.h:72
int tm_min
Definition: time.h:70
int tm_wday
Definition: time.h:75
unsigned int _getsystime(struct tm *tp)
Definition: systime.c:18
#define _CRT_INSECURE_DEPRECATE(_Replacement)
Definition: vcruntime.h:99
#define _CRTIMP
Definition: vcruntime.h:54
#define const
Definition: zconf.h:233