1 /**
2 * @file utime.h
3 * Copyright 2012, 2013 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 #pragma GCC system_header
27 #include <_mingw.h>
28
29 #define __need_wchar_t
30 #define __need_size_t
31
32 #include <sys/types.h>
33
34 #ifndef RC_INVOKED
35 #include <stddef.h>
36 /*
37 * Structure used by _utime function.
38 */
39 #ifndef _UTIMBUF_DEFINED
40 struct _utimbuf
41 {
42 time_t actime; /* Access time */
43 time_t modtime; /* Modification time */
44 };
45 struct __utimbuf32
46 {
47 __time32_t actime;
48 __time32_t modtime;
49 };
50 struct __utimbuf64
51 {
52 __time64_t actime;
53 __time64_t modtime;
54 };
55
56
57 #ifndef _NO_OLDNAMES
58 /* NOTE: Must be the same as _utimbuf above. */
59 struct utimbuf
60 {
61 time_t actime;
62 time_t modtime;
63 };
64 struct utimbuf32
65 {
66 __time32_t actime;
67 __time32_t modtime;
68 };
69 #endif /* Not _NO_OLDNAMES */
70 #define _UTIMBUF_DEFINED
71 #endif /* ndef _UTIMBUF_DEFINED */
72
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76
77 _CRTIMP int __cdecl __MINGW_NOTHROW _utime64 (const char*, struct __utimbuf64*);
78 _CRTIMP int __cdecl __MINGW_NOTHROW _futime64 (int, struct __utimbuf64*);
79
80 #if MSVCRT_VERSION >= 800
81 _CRTIMP int __cdecl __MINGW_NOTHROW _utime32 (const char*, struct __utimbuf32*);
82 _CRTIMP int __cdecl __MINGW_NOTHROW _futime32 (int, struct __utimbuf32*);
83
84 #else
85 _CRTIMP int __cdecl __MINGW_NOTHROW _utime (const char*, struct _utimbuf*);
_utime32(const char * _v1,struct __utimbuf32 * _v2)86 _CRTALIAS int __cdecl __MINGW_NOTHROW _utime32 (const char* _v1, struct __utimbuf32* _v2) {
87 return _utime(_v1, (struct _utimbuf*)_v2);
88 }
89
90 _CRTIMP int __cdecl __MINGW_NOTHROW _futime (int, struct _utimbuf*);
_futime32(int _v1,struct __utimbuf32 * _v2)91 _CRTALIAS int __cdecl __MINGW_NOTHROW _futime32 (int _v1, struct __utimbuf32* _v2) {
92 return _futime(_v1, (struct _utimbuf*)_v2);
93 }
94
95 #endif
96
97 #ifndef _NO_OLDNAMES
98 #ifdef _USE_32BIT_TIME_T
99 _CRTIMP int __cdecl __MINGW_NOTHROW utime (const char*, struct utimbuf*);
100 #else
101 int __cdecl __MINGW_NOTHROW utime (const char*, struct utimbuf*);
utime(const char * _v1,struct utimbuf * _v2)102 _CRTALIAS int __cdecl __MINGW_NOTHROW utime (const char* _v1, struct utimbuf* _v2) {
103 return _utime64(_v1, (struct __utimbuf64*)_v2);
104 }
105 #endif
106 #endif /* Not _NO_OLDNAMES */
107
108 #ifndef _USE_32BIT_TIME_T
_utime(const char * _v1,struct _utimbuf * _v2)109 _CRTALIAS int __cdecl __MINGW_NOTHROW _utime (const char* _v1, struct _utimbuf* _v2) {
110 return(_utime64 (_v1,(struct __utimbuf64*)_v2));
111 }
_futime(int _v1,struct _utimbuf * _v2)112 _CRTALIAS int __cdecl __MINGW_NOTHROW _futime (int _v1, struct _utimbuf* _v2) {
113 return(_futime64 (_v1,(struct __utimbuf64*)_v2));
114 }
115
116 #else /* def _USE_32BIT_TIME_T */
117 #if MSVCRT_VERSION >= 800
_utime(const char * _v1,struct _utimbuf * _v2)118 _CRTALIAS int __cdecl __MINGW_NOTHROW _utime (const char* _v1, struct _utimbuf* _v2) {
119 return(_utime32 (_v1,(struct __utimbuf32*)_v2));
120 }
_futime(int _v1,struct _utimbuf * _v2)121 _CRTALIAS int __cdecl __MINGW_NOTHROW _futime (int _v1, struct _utimbuf* _v2) {
122 return(_futime32 (_v1,(struct __utimbuf32*)_v2));
123 }
124 #endif /* MSVCRT_VERSION >= 800 */
125
126 #endif /* ndef _USE_32BIT_TIME_T */
127
128 #ifndef _WUTIME_DEFINED
129 _CRTIMP int __cdecl __MINGW_NOTHROW _wutime64 (const wchar_t*, struct __utimbuf64*);
130 #if MSVCRT_VERSION >= 800
131 _CRTIMP int __cdecl __MINGW_NOTHROW _wutime32 (const wchar_t*, struct __utimbuf32*);
132
133 #else /* MSVCRT_VERSION < 800 */
134 _CRTIMP int __cdecl __MINGW_NOTHROW _wutime (const wchar_t*, struct _utimbuf*);
_wutime32(const wchar_t * _v1,struct __utimbuf32 * _v2)135 _CRTALIAS int __cdecl __MINGW_NOTHROW _wutime32 (const wchar_t* _v1, struct __utimbuf32* _v2) {
136 return _wutime(_v1, (struct _utimbuf*)_v2);
137 }
138
139 #endif /* MSVCRT_VERSION >= 800 */
140 #ifdef _USE_32BIT_TIME_T
141 #if MSVCRT_VERSION >= 800
_wutime(const wchar_t * _v1,struct _utimbuf * _v2)142 _CRTALIAS int __cdecl __MINGW_NOTHROW _wutime (const wchar_t* _v1, struct _utimbuf* _v2) {
143 return(_wutime32 (_v1,(struct __utimbuf32*)_v2));
144 }
145 #endif /* MSVCRT_VERSION >= 800 */
146
147 #else /* ndef _USE_32BIT_TIME_T */
_wutime(const wchar_t * _v1,struct _utimbuf * _v2)148 _CRTALIAS int __cdecl __MINGW_NOTHROW _wutime (const wchar_t* _v1, struct _utimbuf* _v2) {
149 return(_wutime64 (_v1,(struct __utimbuf64*)_v2));
150 }
151
152 #endif /* def _USE_32BIT_TIME_T */
153 #define _WUTIME_DEFINED
154 #endif /* ndef _WUTIME_DEFINED */
155
156 #ifdef __cplusplus
157 }
158 #endif
159
160 #endif /* Not RC_INVOKED */
161
162 #endif /* Not _UTIME_H_ */