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 |
|
---|
21 | /*
|
---|
22 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
23 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
24 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
25 | * a choice of LGPL license versions is made available with the language indicating
|
---|
26 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
27 | * of the LGPL is applied is otherwise unspecified.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef __WINE_TIME_H
|
---|
31 | #define __WINE_TIME_H
|
---|
32 |
|
---|
33 | #include <crtdefs.h>
|
---|
34 |
|
---|
35 | #include <pshpack8.h>
|
---|
36 |
|
---|
37 | #ifndef _CLOCK_T_DEFINED
|
---|
38 | typedef __msvcrt_long clock_t;
|
---|
39 | #define _CLOCK_T_DEFINED
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | #ifndef NULL
|
---|
43 | #ifdef __cplusplus
|
---|
44 | #define NULL 0
|
---|
45 | #else
|
---|
46 | #define NULL ((void *)0)
|
---|
47 | #endif
|
---|
48 | #endif
|
---|
49 |
|
---|
50 | #ifndef CLOCKS_PER_SEC
|
---|
51 | #define CLOCKS_PER_SEC 1000
|
---|
52 | #endif
|
---|
53 |
|
---|
54 | #ifndef _TM_DEFINED
|
---|
55 | #define _TM_DEFINED
|
---|
56 | struct tm {
|
---|
57 | int tm_sec;
|
---|
58 | int tm_min;
|
---|
59 | int tm_hour;
|
---|
60 | int tm_mday;
|
---|
61 | int tm_mon;
|
---|
62 | int tm_year;
|
---|
63 | int tm_wday;
|
---|
64 | int tm_yday;
|
---|
65 | int tm_isdst;
|
---|
66 | };
|
---|
67 | #endif /* _TM_DEFINED */
|
---|
68 |
|
---|
69 | #ifdef __cplusplus
|
---|
70 | extern "C" {
|
---|
71 | #endif
|
---|
72 |
|
---|
73 | #ifdef __i386__
|
---|
74 | #define _daylight (*__p__daylight())
|
---|
75 | #define _dstbias (*__p__dstbias())
|
---|
76 | #define _timezone (*__p__timezone())
|
---|
77 | #define _tzname (__p__tzname())
|
---|
78 |
|
---|
79 | int * __cdecl __p__daylight(void);
|
---|
80 | __msvcrt_long * __cdecl __p__dstbias(void);
|
---|
81 | __msvcrt_long * __cdecl __p__timezone(void);
|
---|
82 | char ** __cdecl __p__tzname(void);
|
---|
83 | #else
|
---|
84 | extern int _daylight;
|
---|
85 | extern __msvcrt_long _dstbias;
|
---|
86 | extern __msvcrt_long _timezone;
|
---|
87 | extern char *_tzname;
|
---|
88 | #endif
|
---|
89 |
|
---|
90 | #ifdef _USE_32BIT_TIME_T
|
---|
91 | #define _ctime32 ctime
|
---|
92 | #define _difftime32 difftime
|
---|
93 | #define _gmtime32 gmtime
|
---|
94 | #define _localtime32 localtime
|
---|
95 | #define _mktime32 mktime
|
---|
96 | #define _time32 time
|
---|
97 | #endif
|
---|
98 |
|
---|
99 | unsigned __cdecl _getsystime(struct tm*);
|
---|
100 | unsigned __cdecl _setsystime(struct tm*,unsigned);
|
---|
101 | char* __cdecl _strdate(char*);
|
---|
102 | errno_t __cdecl _strdate_s(char*,size_t);
|
---|
103 | char* __cdecl _strtime(char*);
|
---|
104 | errno_t __cdecl _strtime_s(char*,size_t);
|
---|
105 | void __cdecl _tzset(void);
|
---|
106 |
|
---|
107 | char* __cdecl asctime(const struct tm*);
|
---|
108 | clock_t __cdecl clock(void);
|
---|
109 | char* __cdecl _ctime32(const __time32_t*);
|
---|
110 | char* __cdecl _ctime64(const __time64_t*);
|
---|
111 | double __cdecl _difftime32(__time32_t,__time32_t);
|
---|
112 | double __cdecl _difftime64(__time64_t,__time64_t);
|
---|
113 | struct tm* __cdecl _gmtime32(const __time32_t*);
|
---|
114 | struct tm* __cdecl _gmtime64(const __time64_t*);
|
---|
115 | struct tm* __cdecl _localtime32(const __time32_t*);
|
---|
116 | errno_t __cdecl _localtime32_s(struct tm*, const __time64_t*);
|
---|
117 | struct tm* __cdecl _localtime64(const __time64_t*);
|
---|
118 | errno_t __cdecl _localtime64_s(struct tm*, const __time64_t*);
|
---|
119 | __time32_t __cdecl _mktime32(struct tm*);
|
---|
120 | __time64_t __cdecl _mktime64(struct tm*);
|
---|
121 | size_t __cdecl strftime(char*,size_t,const char*,const struct tm*);
|
---|
122 | __time32_t __cdecl _time32(__time32_t*);
|
---|
123 | __time64_t __cdecl _time64(__time64_t*);
|
---|
124 |
|
---|
125 | #ifndef _USE_32BIT_TIME_T
|
---|
126 | static inline char* ctime(const time_t *t) { return _ctime64(t); }
|
---|
127 | static inline double difftime(time_t t1, time_t t2) { return _difftime64(t1, t2); }
|
---|
128 | static inline struct tm* gmtime(const time_t *t) { return _gmtime64(t); }
|
---|
129 | static inline struct tm* localtime(const time_t *t) { return _localtime64(t); }
|
---|
130 | static inline time_t mktime(struct tm *tm) { return _mktime64(tm); }
|
---|
131 | static inline time_t time(time_t *t) { return _time64(t); }
|
---|
132 | #endif
|
---|
133 |
|
---|
134 | #ifndef _WTIME_DEFINED
|
---|
135 | #define _WTIME_DEFINED
|
---|
136 |
|
---|
137 | #ifdef _USE_32BIT_TIME_T
|
---|
138 | #define _wctime32 _wctime
|
---|
139 | #endif
|
---|
140 |
|
---|
141 | wchar_t* __cdecl _wasctime(const struct tm*);
|
---|
142 | size_t __cdecl wcsftime(wchar_t*,size_t,const wchar_t*,const struct tm*);
|
---|
143 | wchar_t* __cdecl _wctime32(const __time32_t*);
|
---|
144 | wchar_t* __cdecl _wctime64(const __time64_t*);
|
---|
145 | wchar_t* __cdecl _wstrdate(wchar_t*);
|
---|
146 | errno_t __cdecl _wstrdate_s(wchar_t*,size_t);
|
---|
147 | wchar_t* __cdecl _wstrtime(wchar_t*);
|
---|
148 | errno_t __cdecl _wstrtime_s(wchar_t*,size_t);
|
---|
149 |
|
---|
150 | #ifndef _USE_32BIT_TIME_T
|
---|
151 | static inline wchar_t* _wctime(const time_t *t) { return _wctime64(t); }
|
---|
152 | #endif
|
---|
153 |
|
---|
154 | #endif /* _WTIME_DEFINED */
|
---|
155 |
|
---|
156 | #ifdef __cplusplus
|
---|
157 | }
|
---|
158 | #endif
|
---|
159 |
|
---|
160 | #include <poppack.h>
|
---|
161 |
|
---|
162 | #endif /* __WINE_TIME_H */
|
---|