STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
corecrt_wtime.h
Go to the documentation of this file.
1 //
2 // corecrt_wtime.h
3 //
4 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //
6 // This file declares the wide character (wchar_t) time functionality, shared
7 // by <time.h> and <wchar.h>.
8 //
9 #pragma once
10 
11 #include <corecrt.h>
12 
14 
15 
16 
17 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
18 //
19 // Types
20 //
21 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
22 struct tm
23 {
24  int tm_sec; // seconds after the minute - [0, 60] including leap second
25  int tm_min; // minutes after the hour - [0, 59]
26  int tm_hour; // hours since midnight - [0, 23]
27  int tm_mday; // day of the month - [1, 31]
28  int tm_mon; // months since January - [0, 11]
29  int tm_year; // years since 1900
30  int tm_wday; // days since Sunday - [0, 6]
31  int tm_yday; // days since January 1 - [0, 365]
32  int tm_isdst; // daylight savings time flag
33 };
34 
35 
36 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
37 //
38 // Wide String Time Functions
39 //
40 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
42 _Success_(return != 0)
44 _ACRTIMP wchar_t* __cdecl _wasctime(
45  _In_ struct tm const* _Tm
46  );
47 
48 _Success_(return == 0)
50 _ACRTIMP errno_t __cdecl _wasctime_s(
52  _In_range_(>=,26) size_t _SizeInWords,
53  _In_ struct tm const* _Tm
54  );
55 
57  _Success_(return == 0)
58  errno_t, _wasctime_s,
59  _Post_readable_size_(26) wchar_t, _Buffer,
60  _In_ struct tm const*, _Time
61  )
62 
63 _Success_(return > 0)
65 _ACRTIMP size_t __cdecl wcsftime(
66  _Out_writes_z_(_SizeInWords) wchar_t* _Buffer,
67  _In_ size_t _SizeInWords,
68  _In_z_ wchar_t const* _Format,
69  _In_ struct tm const* _Tm
70  );
71 
72 _Success_(return > 0)
74 _ACRTIMP size_t __cdecl _wcsftime_l(
75  _Out_writes_z_(_SizeInWords) wchar_t* _Buffer,
76  _In_ size_t _SizeInWords,
77  _In_z_ wchar_t const* _Format,
78  _In_ struct tm const* _Tm,
80  );
81 
82 _Success_(return != 0)
84 _ACRTIMP wchar_t* __cdecl _wctime32(
85  _In_ __time32_t const* _Time
86  );
87 
89 _ACRTIMP errno_t __cdecl _wctime32_s(
90  _Out_writes_z_(_SizeInWords) _Post_readable_size_(26) wchar_t* _Buffer,
91  _In_ _In_range_(>=, 26) size_t _SizeInWords,
92  _In_ __time32_t const* _Time
93  );
94 
96  errno_t, _wctime32_s,
97  _Post_readable_size_(26) wchar_t, _Buffer,
98  _In_ __time32_t const*, _Time
99  )
100 
101 _Success_(return != 0)
102 _Ret_writes_z_(26)
104 _ACRTIMP wchar_t* __cdecl _wctime64(
105  _In_ __time64_t const* _Time
106  );
107 
109 _ACRTIMP errno_t __cdecl _wctime64_s(
110  _Out_writes_z_(_SizeInWords) _Post_readable_size_(26) wchar_t* _Buffer,
111  _In_ _In_range_(>=, 26) size_t _SizeInWords,
112  _In_ __time64_t const* _Time);
113 
115  errno_t, _wctime64_s,
116  _Post_readable_size_(26) wchar_t, _Buffer,
117  _In_ __time64_t const*, _Time
118  )
119 
121 _ACRTIMP errno_t __cdecl _wstrdate_s(
122  _Out_writes_z_(_SizeInWords) _Post_readable_size_(9) wchar_t* _Buffer,
123  _In_ _In_range_(>=, 9) size_t _SizeInWords
124  );
125 
127  errno_t, _wstrdate_s,
128  _Post_readable_size_(9) wchar_t, _Buffer
129  )
130 
133  _Out_writes_z_(9), wchar_t, _Buffer
134  )
135 
137 _ACRTIMP errno_t __cdecl _wstrtime_s(
138  _Out_writes_z_(_SizeInWords) _Post_readable_size_(9) wchar_t* _Buffer,
139  _In_ _In_range_(>=, 9) size_t _SizeInWords
140  );
141 
143  errno_t, _wstrtime_s,
144  _Post_readable_size_(9) wchar_t, _Buffer
145  )
146 
148  _Success_(return != 0) _Ret_writes_z_(9) wchar_t*, __RETURN_POLICY_DST, _ACRTIMP, _wstrtime,
149  _Out_writes_z_(9), wchar_t, _Buffer
150  )
151 
152 
153 
154 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
155 //
156 // Inline Definitions
157 //
158 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
159 #if !defined RC_INVOKED && !defined __midl && !defined _INC_WTIME_INL && !defined _CRT_NO_TIME_T
160  #pragma warning(push)
161  #pragma warning(disable: 4996)
162 
163  #ifdef _USE_32BIT_TIME_T
164 
166  static __inline wchar_t* __CRTDECL _wctime(
167  _In_ time_t const* const _Time
168  )
169  {
170  return _wctime32(_Time);
171  }
172 
174  static __inline errno_t __CRTDECL _wctime_s(
175  _Pre_notnull_ _Post_z_ _Out_writes_z_(_SizeInWords) wchar_t* const _Buffer,
176  _In_ size_t const _SizeInWords,
177  _In_ time_t const* const _Time)
178  {
179  return _wctime32_s(_Buffer, _SizeInWords, _Time);
180  }
181 
182  #else // ^^^ _USE_32BIT_TIME_T ^^^ // vvv !_USE_32BIT_TIME_T vvv //
183 
185  static __inline wchar_t * __CRTDECL _wctime(
186  _In_ time_t const* const _Time)
187  {
188  return _wctime64(_Time);
189  }
190 
192  static __inline errno_t __CRTDECL _wctime_s(
193  _Pre_notnull_ _Post_z_ _Out_writes_z_(_SizeInWords) wchar_t* const _Buffer,
194  _In_ size_t const _SizeInWords,
195  _In_ time_t const* const _Time
196  )
197  {
198  return _wctime64_s(_Buffer, _SizeInWords, _Time);
199  }
200 
201  #endif // !_USE_32BIT_TIME_T
202 
203  #pragma warning(pop)
204 #endif
205 
206 
207 
return
Definition: corecrt_memcpy_s.h:60
Definition: corecrt.h:489
__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0(errno_t, _wstrdate_s, _Post_readable_size_(9) wchar_t, _Buffer) __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0(_Success_(return!=0) _Ret_writes_z_(9) wchar_t *
int tm_min
Definition: corecrt_wtime.h:25
#define _Ret_writes_z_(size)
Definition: sal.h:535
_Success_(return==0) _Check_return_wat_ _ACRTIMP errno_t __cdecl _wasctime_s(_Out_writes_z_(_SizeInWords) _Post_readable_size_(26) wchar_t *_Buffer
int tm_mday
Definition: corecrt_wtime.h:27
int errno_t
Definition: corecrt.h:476
#define _Check_return_wat_
Definition: corecrt.h:102
int tm_year
Definition: corecrt_wtime.h:29
_ACRTIMP
Definition: corecrt_wtime.h:132
__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(_Success_(return==0) errno_t, _wasctime_s, _Post_readable_size_(26) wchar_t, _Buffer, _In_ struct tm const *, _Time) _Success_(return > 0) _Check_return_wat_ _ACRTIMP size_t __cdecl wcsftime(_Out_writes_z_(_SizeInWords) wchar_t *_Buffer
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:73
_wstrtime
Definition: corecrt_wtime.h:148
__RETURN_POLICY_DST
Definition: corecrt_wtime.h:132
_Check_return_ _CRT_INSECURE_DEPRECATE(_wasctime_s) _Success_(return!=0) _Ret_writes_z_(26) _ACRTIMP wchar_t *__cdecl _wasctime(_In_ struct tm const *_Tm)
#define __CRTDECL
Definition: vcruntime.h:156
#define _Post_z_
Definition: sal.h:688
__time64_t time_t
Definition: corecrt.h:517
_In_range_(>=, 26) size_t _SizeInWords
#define _Check_return_
Definition: sal.h:554
_In_ size_t _In_z_ wchar_t const * _Format
Definition: corecrt_wtime.h:67
#define _In_z_
Definition: sal.h:310
#define _In_
Definition: sal.h:305
int tm_mon
Definition: corecrt_wtime.h:28
#define _In_opt_
Definition: sal.h:306
long __time32_t
Definition: corecrt.h:479
_Buffer _Check_return_wat_ _ACRTIMP errno_t __cdecl _wstrtime_s(_Out_writes_z_(_SizeInWords) _Post_readable_size_(9) wchar_t *_Buffer, _In_ _In_range_(>=, 9) size_t _SizeInWords)
_Check_return_wat_ *_SizeRead wchar_t * _Buffer
Definition: corecrt_wconio.h:27
_In_ size_t _In_z_ wchar_t const _In_ struct tm const _In_opt_ _locale_t _Locale
Definition: corecrt_wtime.h:78
_Buffer static _Check_return_ __inline wchar_t *__CRTDECL _wctime(_In_ time_t const *const _Time)
Definition: corecrt_wtime.h:185
static _Check_return_wat_ __inline errno_t __CRTDECL _wctime_s(_Pre_notnull_ _Post_z_ _Out_writes_z_(_SizeInWords) wchar_t *const _Buffer, _In_ size_t const _SizeInWords, _In_ time_t const *const _Time)
Definition: corecrt_wtime.h:192
Definition: corecrt_wtime.h:22
#define _CRT_END_C_HEADER
Definition: vcruntime.h:76
int tm_wday
Definition: corecrt_wtime.h:30
int tm_yday
Definition: corecrt_wtime.h:31
_wstrdate
Definition: corecrt_wtime.h:132
__int64 __time64_t
Definition: corecrt.h:480
#define _Post_readable_size_(size)
Definition: sal.h:646
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst)
Definition: corecrt.h:709
_Check_return_wat_ _ACRTIMP errno_t __cdecl _wctime64_s(_Out_writes_z_(_SizeInWords) _Post_readable_size_(26) wchar_t *_Buffer, _In_ _In_range_(>=, 26) size_t _SizeInWords, _In_ __time64_t const *_Time)
_Check_return_wat_ _ACRTIMP errno_t __cdecl _wctime32_s(_Out_writes_z_(_SizeInWords) _Post_readable_size_(26) wchar_t *_Buffer, _In_ _In_range_(>=, 26) size_t _SizeInWords, _In_ __time32_t const *_Time)
int tm_sec
Definition: corecrt_wtime.h:24
_In_ size_t _SizeInWords
Definition: corecrt_wtime.h:67
int tm_hour
Definition: corecrt_wtime.h:26
#define _Pre_notnull_
Definition: sal.h:677
int tm_isdst
Definition: corecrt_wtime.h:32
_In_ struct tm const * _Tm
Definition: corecrt_wtime.h:53
_Out_writes_z_(9)