ReactOS 0.4.16-dev-2104-gb84fa49
time.h File Reference
#include <corecrt.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
 Deletes the virtual mapping and optionally gives back the page & dirty bit.
 
_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()

◆ _get_dstbias()

◆ _get_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 
)

◆ _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); }
__time64_t CDECL _mkgmtime64(struct tm *time)
Definition: time.c:350
_In_ size_t _In_z_ _Printf_format_string_ const char _In_ const struct tm * _Tm
Definition: time.h:148

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)

◆ _strdate_s()

◆ _strtime()

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

◆ _strtime_s()

◆ _Success_() [1/2]

_Success_ ( return  ,
 
)

◆ _Success_() [2/2]

_Success_ ( return  = = 0)

Deletes the virtual mapping and optionally gives back the page & dirty bit.

Parameters
Process- The process this address belongs to, or NULL if system address.
Address- The address to unmap.
WasDirty- Optional param receiving the dirty bit of the PTE.
Page- Optional param receiving the page number previously mapped to this address.
Returns
Whether there was actually a page mapped at the given address.

Definition at line 57 of file firmware.c.

207{
210
211 /* Check input parameters */
212 if (FirmwareType == NULL)
213 {
215 return FALSE;
216 }
217
218 /* Query firmware type */
220 &BootInfo,
221 sizeof(BootInfo),
222 0);
223 if (!NT_SUCCESS(Status))
224 {
226 return FALSE;
227 }
228
229 *FirmwareType = BootInfo.FirmwareType;
230 return TRUE;
231}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
Status
Definition: gdiplustypes.h:25
@ SystemBootEnvironmentInformation
Definition: extypes.h:309
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:167
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)

◆ _time32()

◆ _tzset()

_CRTIMP void __cdecl _tzset ( void  )

Definition at line 127 of file time.c.

128{
129 char *tz = getenv("TZ");
130 BOOL error;
131
133 if(tz && tz[0]) {
134 BOOL neg_zone = FALSE;
135
136 memset(&tzi, 0, sizeof(tzi));
137
138 /* Parse timezone information: tzn[+|-]hh[:mm[:ss]][dzn] */
140 tz += 3;
141
142 if(*tz == '-') {
143 neg_zone = TRUE;
144 tz++;
145 }else if(*tz == '+') {
146 tz++;
147 }
148 MSVCRT___timezone = strtol(tz, &tz, 10)*3600;
149 if(*tz == ':') {
150 MSVCRT___timezone += strtol(tz+1, &tz, 10)*60;
151 if(*tz == ':')
152 MSVCRT___timezone += strtol(tz+1, &tz, 10);
153 }
154 if(neg_zone)
156
163
167 }else {
169 MSVCRT__dstbias = 0;
170 }
171
173 sizeof(tzname_std), NULL, &error) || error)
174 *MSVCRT__tzname[0] = 0;
176 sizeof(tzname_dst), NULL, &error) || error)
177 *MSVCRT__tzname[0] = 0;
178 }
180}
#define CP_ACP
Definition: compat.h:109
#define lstrcpynA
Definition: compat.h:751
#define WideCharToMultiByte
Definition: compat.h:111
DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
Definition: timezone.c:262
char *CDECL getenv(const char *name)
Definition: environ.c:227
_ACRTIMP __msvcrt_long __cdecl strtol(const char *, char **, int)
Definition: string.c:1833
void CDECL _lock(int locknum)
Definition: lock.c:85
void CDECL _unlock(int locknum)
Definition: lock.c:114
#define _TIME_LOCK
Definition: mtdll.h:35
__msvcrt_long MSVCRT___timezone
Definition: time.c:106
int MSVCRT___daylight
Definition: time.c:101
static char tzname_std[64]
Definition: time.c:119
__msvcrt_long MSVCRT__dstbias
Definition: time.c:111
static char tzname_dst[64]
Definition: time.c:120
static TIME_ZONE_INFORMATION tzi
Definition: time.c:123
char * MSVCRT__tzname[2]
Definition: time.c:121
unsigned int BOOL
Definition: ntddk_ex.h:94
GLbyte GLbyte tz
Definition: glext.h:8756
#define error(str)
Definition: mkdosfs.c:1605
#define memset(x, y, z)
Definition: compat.h:39
SYSTEMTIME DaylightDate
Definition: winbase.h:936
WCHAR DaylightName[32]
Definition: winbase.h:935
WCHAR StandardName[32]
Definition: winbase.h:932
SYSTEMTIME StandardDate
Definition: winbase.h:933
#define TIME_ZONE_ID_INVALID
Definition: winbase.h:310

Referenced by _tzset_init(), strftime_impl(), 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); }
_ACRTIMP wchar_t *__cdecl _wctime64(const __time64_t *)
Definition: time.c:1782
_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)

◆ _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)

◆ _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()

Definition at line 698 of file time.c.

699{
700 LARGE_INTEGER systime;
701
702 NtQuerySystemTime(&systime);
703 return (systime.QuadPart - init_time) / (TICKSPERSEC / CLOCKS_PER_SEC);
704}
#define CLOCKS_PER_SEC
Definition: time.h:33
#define TICKSPERSEC
Definition: time.c:236
static LONGLONG init_time
Definition: time.c:47
NTSTATUS NTAPI NtQuerySystemTime(OUT PLARGE_INTEGER SystemTime)
Definition: time.c:569
LONGLONG QuadPart
Definition: typedefs.h:114

◆ ctime()

_CRTIMP char *__cdecl ctime ( const time_t _Time)

Definition at line 414 of file time.h.

414{ return _ctime64(_Time); }
_ACRTIMP char *__cdecl _ctime64(const __time64_t *)
Definition: time.c:1720

◆ 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); }
_ACRTIMP double __cdecl _difftime64(__time64_t, __time64_t)
Definition: time.c:709
_In_ __time32_t _Time2
Definition: time.h:190

◆ gmtime()

__CRT_INLINE struct tm *__cdecl gmtime ( const time_t _Time)

Definition at line 415 of file time.h.

415{ return _gmtime64(_Time); }
_ACRTIMP struct tm *__cdecl _gmtime64(const __time64_t *)
Definition: time.c:509

◆ localtime()

__CRT_INLINE struct tm *__cdecl localtime ( const time_t _Time)

Definition at line 416 of file time.h.

416{ return _localtime64(_Time); }
_ACRTIMP struct tm *__cdecl _localtime64(const __time64_t *)
Definition: time.c:415

◆ 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); }
_ACRTIMP errno_t __cdecl _localtime64_s(struct tm *, const __time64_t *)
Definition: time.c:367

◆ mktime()

__CRT_INLINE time_t __cdecl mktime ( struct tm _Tm)

Definition at line 418 of file time.h.

418{ return _mktime64(_Tm); }
_ACRTIMP __time64_t __cdecl _mktime64(struct tm *)
Definition: time.c:331

◆ time()

_CRTIMP time_t __cdecl time ( time_t _Time)

Definition at line 420 of file time.h.

420{ return _time64(_Time); }
_ACRTIMP __time64_t __cdecl _time64(__time64_t *)
Definition: time.c:780

◆ tzset()

_CRTIMP void __cdecl tzset ( void  )

Referenced by init_client().

Variable Documentation

◆ _Format

Definition at line 147 of file time.h.

◆ _Locale

Initial value:
{
_In_ size_t _In_z_ _Printf_format_string_ const char _In_ const struct tm _In_opt_ _locale_t _Locale
Definition: time.h:159
#define _CRT_UNUSED(x)
Definition: corecrt.h:340

Definition at line 159 of file time.h.

Referenced by __DECLARE_CPP_OVERLOAD_INLINE_NFUNC_0_3_EX(), __DEFINE_CPP_OVERLOAD_INLINE_NFUNC_0_3_EX(), _chvalidchk_l(), _cprintf_l(), _cprintf_p_l(), _cprintf_s_l(), _CRT_INSECURE_DEPRECATE(), _cscanf_s_l(), _ischartype_l(), _strnset_s_l(), _tccpy_l(), _vcprintf_l(), _vcprintf_p_l(), _vcprintf_s_l(), and _vcscanf_s_l().

◆ _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.

Referenced by _mbccpy_s_l(), _mbscat_s_l(), _mbscpy_s_l(), and _mbsset_s_l().

◆ _SizeInWords

_In_ size_t _SizeInWords

Definition at line 309 of file time.h.

Referenced by swprintf(), and vswprintf().

◆ _Time

◆ _Tm

Definition at line 148 of file time.h.

Referenced by _mkgmtime(), localtime_s(), and mktime().

◆ daylight

◆ timezone

◆ tzname