OSDN Git Service

760ea5fbe5e8248ad831e46770fd9ddd565b9c9c
[mingw/mingw-org-wsl.git] / include / sys / utime.h
1 /**
2  * @file utime.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 #ifndef _UTIME_H_
25 #define _UTIME_H_
26
27 /* All the headers include this file. */
28 #include <_mingw.h>
29
30 #define __need_wchar_t
31 #define __need_size_t
32 #ifndef RC_INVOKED
33 #include <stddef.h>
34 #endif  /* Not RC_INVOKED */
35 #include <sys/types.h>
36
37 #ifndef RC_INVOKED
38
39 /*
40  * Structure used by _utime function.
41  */
42 struct _utimbuf
43 {
44         time_t  actime;         /* Access time */
45         time_t  modtime;        /* Modification time */
46 };
47 #if __MSVCRT_VERSION__ >= 0x0800
48 struct __utimbuf32
49 {
50         __time32_t actime;
51         __time32_t modtime;
52 };
53 #endif /* __MSVCRT_VERSION__ >= 0x0800 */
54
55
56 #ifndef _NO_OLDNAMES
57 /* NOTE: Must be the same as _utimbuf above. */
58 struct utimbuf
59 {
60         time_t  actime;
61         time_t  modtime;
62 };
63 #endif  /* Not _NO_OLDNAMES */
64
65 #ifdef  __cplusplus
66 extern "C" {
67 #endif
68
69 #if __MSVCRT_VERSION__ < 0x0800
70 _CRTIMP int __cdecl __MINGW_NOTHROW     _utime (const char*, struct _utimbuf*);
71 #endif
72
73 #ifndef _NO_OLDNAMES
74 /* FIXME for __MSVCRT_VERSION__ >= 0x0800 */
75 _CRTIMP int __cdecl __MINGW_NOTHROW     utime (const char*, struct utimbuf*);
76 #endif  /* Not _NO_OLDNAMES */
77
78 #if __MSVCRT_VERSION__ < 0x0800
79 _CRTIMP int __cdecl __MINGW_NOTHROW     _futime (int, struct _utimbuf*);
80 #endif
81
82 /* The wide character version, only available for MSVCRT versions of the
83  * C runtime library. */
84 #if __MSVCRT_VERSION__ < 0x0800
85 _CRTIMP int __cdecl __MINGW_NOTHROW     _wutime (const wchar_t*, struct _utimbuf*);
86 #endif
87
88 /* These require newer versions of msvcrt.dll (6.10 or higher).  */ 
89 #if __MSVCRT_VERSION__ >= 0x0601
90 struct __utimbuf64
91 {
92         __time64_t actime;
93         __time64_t modtime;
94 };
95
96 _CRTIMP int __cdecl __MINGW_NOTHROW     _utime64 (const char*, struct __utimbuf64*);
97 _CRTIMP int __cdecl __MINGW_NOTHROW     _wutime64 (const wchar_t*, struct __utimbuf64*);
98 _CRTIMP int __cdecl __MINGW_NOTHROW     _futime64 (int, struct __utimbuf64*);
99 #endif /* __MSVCRT_VERSION__ >= 0x0601 */
100
101 #if __MSVCRT_VERSION__ >= 0x0800
102 _CRTIMP int __cdecl __MINGW_NOTHROW     _utime32 (const char*, struct __utimbuf32*);
103 _CRTIMP int __cdecl __MINGW_NOTHROW     _wutime32 (const wchar_t*, struct __utimbuf32*);
104 _CRTIMP int __cdecl __MINGW_NOTHROW     _futime32 (int, struct __utimbuf32*);
105 #ifndef _USE_32BIT_TIME_T
106 _CRTALIAS int __cdecl __MINGW_NOTHROW   _utime (const char* _v1, struct _utimbuf* _v2)     { return(_utime64  (_v1,(struct __utimbuf64*)_v2)); }
107 _CRTALIAS int __cdecl __MINGW_NOTHROW   _wutime (const wchar_t* _v1, struct _utimbuf* _v2) { return(_wutime64 (_v1,(struct __utimbuf64*)_v2)); }
108 _CRTALIAS int __cdecl __MINGW_NOTHROW   _futime (int _v1, struct _utimbuf* _v2)            { return(_futime64 (_v1,(struct __utimbuf64*)_v2)); }
109 #else
110 _CRTALIAS int __cdecl __MINGW_NOTHROW   _utime (const char* _v1, struct _utimbuf* _v2)     { return(_utime32  (_v1,(struct __utimbuf32*)_v2)); }
111 _CRTALIAS int __cdecl __MINGW_NOTHROW   _wutime (const wchar_t* _v1, struct _utimbuf* _v2) { return(_wutime32 (_v1,(struct __utimbuf32*)_v2)); }
112 _CRTALIAS int __cdecl __MINGW_NOTHROW   _futime (int _v1, struct _utimbuf* _v2)            { return(_futime32 (_v1,(struct __utimbuf32*)_v2)); }
113 #endif
114 #endif /* __MSVCRT_VERSION__ >= 0x0800 */
115
116 #ifdef  __cplusplus
117 }
118 #endif
119
120 #endif  /* Not RC_INVOKED */
121
122 #endif  /* Not _UTIME_H_ */