OSDN Git Service

Apply LICENSE to all files as appropriate.
[mingw/mingw-org-wsl.git] / include / sys / timeb.h
1 /**
2  * @file timeb.h
3  * @copy 2012 MinGW.org project
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  * 
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  * 
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 /*
25  * timeb.h
26  * This file has no copyright assigned and is placed in the Public Domain.
27  * This file is a part of the mingw-runtime package.
28  * No warranty is given; refer to the file DISCLAIMER within the package.
29  *
30  * Support for the UNIX System V ftime system call.
31  *
32  */
33
34 #ifndef _TIMEB_H_
35 #define _TIMEB_H_
36
37 /* All the headers include this file. */
38 #include <_mingw.h>
39 #include <sys/types.h>
40
41 #ifndef RC_INVOKED
42
43 /*
44  * TODO: Structure not tested.
45  */
46 struct _timeb
47 {
48         time_t  time;
49         short   millitm;
50         short   timezone;
51         short   dstflag;
52 };
53
54 #if __MSVCRT_VERSION__ >= 0x0800
55 /*
56  * TODO: Structure not tested.
57  */
58 struct __timeb32
59 {
60         __time32_t      time;
61         short   millitm;
62         short   timezone;
63         short   dstflag;
64 };
65 #endif /* __MSVCRT_VERSION__ >= 0x0800 */
66
67 #ifndef _NO_OLDNAMES
68 /*
69  * TODO: Structure not tested.
70  */
71 struct timeb
72 {
73         time_t  time;
74         short   millitm;
75         short   timezone;
76         short   dstflag;
77 };
78 #endif
79
80 #ifdef  __cplusplus
81 extern "C" {
82 #endif
83
84 /* TODO: Not tested. */
85 _CRTIMP void __cdecl __MINGW_NOTHROW    _ftime (struct _timeb*);
86
87 #ifndef _NO_OLDNAMES
88 /* FIXME for __MSVCRT_VERSION__ >= 0x0800 */
89 _CRTIMP void __cdecl __MINGW_NOTHROW    ftime (struct timeb*);
90 #endif  /* Not _NO_OLDNAMES */
91
92 /* This requires newer versions of msvcrt.dll (6.10 or higher).  */ 
93 #if __MSVCRT_VERSION__ >= 0x0601
94 struct __timeb64
95 {
96   __time64_t time;
97   short millitm;
98   short timezone;
99   short dstflag;
100 };
101
102 _CRTIMP void __cdecl __MINGW_NOTHROW    _ftime64 (struct __timeb64*);
103 #endif /* __MSVCRT_VERSION__ >= 0x0601 */
104
105 #if __MSVCRT_VERSION__ >= 0x0800
106 _CRTIMP void __cdecl __MINGW_NOTHROW    _ftime32 (struct __timeb32*);
107 #ifndef _USE_32BIT_TIME_T
108 _CRTALIAS void __cdecl __MINGW_NOTHROW  _ftime (struct _timeb* _v) { return(_ftime64 ((struct __timeb64*)_v)); }
109 #else
110 _CRTALIAS void __cdecl __MINGW_NOTHROW  _ftime (struct _timeb* _v) { return(_ftime32 ((struct __timeb32*)_v)); }
111 #endif
112 #endif /* __MSVCRT_VERSION__ >= 0x0800 */
113
114 #ifdef  __cplusplus
115 }
116 #endif
117
118 #endif  /* Not RC_INVOKED */
119
120 #endif  /* Not _TIMEB_H_ */