ReactOS 0.4.16-dev-2104-gb84fa49
time.h
Go to the documentation of this file.
1/*
2 * Time definitions
3 *
4 * Copyright 2000 Francois Gouget.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20#ifndef __WINE_TIME_H
21#define __WINE_TIME_H
22
23#include <corecrt_wtime.h>
24
25#include <pshpack8.h>
26
27#ifndef _CLOCK_T_DEFINED
29#define _CLOCK_T_DEFINED
30#endif
31
32#ifndef CLOCKS_PER_SEC
33#define CLOCKS_PER_SEC 1000
34#endif
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
41{
44};
45
47{
50};
51
53{
56};
57
58#ifdef __i386__
59#define _daylight (*__p__daylight())
60#define _dstbias (*__p__dstbias())
61#define _timezone (*__p__timezone())
62#define _tzname (__p__tzname())
63
67_ACRTIMP char ** __cdecl __p__tzname(void);
68#else
69extern int _daylight;
72extern char *_tzname;
73#endif
74
75#if !defined(_UCRT) && defined(_USE_32BIT_TIME_T)
76#define _ctime32 ctime
77#define _difftime32 difftime
78#define _gmtime32 gmtime
79#define _localtime32 localtime
80#define _mktime32 mktime
81#define _time32 time
82#endif
83
84_ACRTIMP unsigned __cdecl _getsystime(struct tm*);
85_ACRTIMP unsigned __cdecl _setsystime(struct tm*,unsigned);
86_ACRTIMP char* __cdecl _strdate(char*);
88_ACRTIMP char* __cdecl _strtime(char*);
90_ACRTIMP void __cdecl _tzset(void);
91
92_ACRTIMP char* __cdecl asctime(const struct tm*);
95_ACRTIMP errno_t __cdecl _ctime32_s(char*,size_t,const __time32_t*);
97_ACRTIMP errno_t __cdecl _ctime64_s(char*,size_t,const __time64_t*);
100_ACRTIMP struct tm* __cdecl _gmtime32(const __time32_t*);
101_ACRTIMP int __cdecl _gmtime32_s(struct tm *res, const __time32_t *secs);
102_ACRTIMP struct tm* __cdecl _gmtime64(const __time64_t*);
103_ACRTIMP int __cdecl _gmtime64_s(struct tm *res, const __time64_t *secs);
104
111_ACRTIMP size_t __cdecl strftime(char*,size_t,const char*,const struct tm*);
112_ACRTIMP size_t __cdecl _strftime_l(char*,size_t,const char*,const struct tm*,_locale_t);
115
116#ifndef _USE_32BIT_TIME_T
117static inline char* ctime(const time_t *t) { return _ctime64(t); }
118static inline errno_t ctime_s(char *res, size_t len, const __time64_t *t) { return _ctime64_s(res, len, t); }
119static inline double difftime(time_t t1, time_t t2) { return _difftime64(t1, t2); }
120static inline struct tm* gmtime(const time_t *t) { return _gmtime64(t); }
121static inline struct tm* localtime(const time_t *t) { return _localtime64(t); }
122static inline errno_t localtime_s(struct tm *res, const time_t *t) { return _localtime64_s(res, t); }
123static inline time_t mktime(struct tm *tm) { return _mktime64(tm); }
124static inline time_t time(time_t *t) { return _time64(t); }
125#elif defined(_UCRT)
126static inline char* ctime(const time_t *t) { return _ctime32(t); }
127static inline errno_t ctime_s(char *res, size_t len, const __time32_t *t) { return _ctime32_s(res, len, t); }
128static inline double difftime(time_t t1, time_t t2) { return _difftime32(t1, t2); }
129static inline struct tm* gmtime(const time_t *t) { return _gmtime32(t); }
130static inline struct tm* localtime(const time_t *t) { return _localtime32(t); }
131static inline errno_t localtime_s(struct tm *res, const time_t *t) { return _localtime32_s(res, t); }
132static inline time_t mktime(struct tm *tm) { return _mktime32(tm); }
133static inline time_t time(time_t *t) { return _time32(t); }
134#endif
135
136#ifdef __cplusplus
137}
138#endif
139
140#include <poppack.h>
141
142#endif /* __WINE_TIME_H */
__msvcrt_long __time32_t
Definition: corecrt.h:209
int errno_t
Definition: corecrt.h:249
long __msvcrt_long
Definition: corecrt.h:167
#define __cdecl
Definition: corecrt.h:121
#define _ACRTIMP
Definition: corecrt.h:153
__time32_t time_t
Definition: corecrt.h:228
_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
static errno_t ctime_s(char *res, size_t len, const __time64_t *t)
Definition: time.h:118
_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
char **CDECL __p__tzname(void)
Definition: time.c:883
__msvcrt_long *CDECL __p__dstbias(void)
Definition: time.c:816
__msvcrt_long *CDECL __p__timezone(void)
Definition: time.c:836
int *CDECL __p__daylight(void)
Definition: time.c:808
GLdouble GLdouble t
Definition: gl.h:2047
GLuint res
Definition: glext.h:9613
GLenum GLsizei len
Definition: glext.h:6722
__u16 ctime
Definition: mkdosfs.c:4
__u16 time
Definition: mkdosfs.c:8
__int64 __time64_t
Definition: corecrt.h:619
_strdate
Definition: time.h:297
_strtime
Definition: time.h:313
__time32_t tv_sec
Definition: time.h:42
__msvcrt_long tv_nsec
Definition: time.h:43
__time64_t tv_sec
Definition: time.h:48
__msvcrt_long tv_nsec
Definition: time.h:49
Definition: time.h:53
__msvcrt_long tv_nsec
Definition: time.h:55
time_t tv_sec
Definition: time.h:54