ReactOS 0.4.16-dev-1104-ge0ef51b
utime.h
Go to the documentation of this file.
1//
2// sys/utime.h
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// The _utime() family of functions.
7//
8#pragma once
9
10#include <corecrt.h>
11
12#pragma warning(push)
13#pragma warning(disable: _UCRT_DISABLED_WARNINGS)
15
17
18//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
19//
20// Types
21//
22//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
23#ifndef _CRT_NO_TIME_T
24 struct _utimbuf
25 {
26 time_t actime; // access time
27 time_t modtime; // modification time
28 };
29#endif
30
31struct __utimbuf32
32{
33 __time32_t actime; // access time
34 __time32_t modtime; // modification time
35};
36
38{
39 __time64_t actime; // access time
40 __time64_t modtime; // modification time
41};
42
43#if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES && !defined _CRT_NO_TIME_T
44
45 struct utimbuf
46 {
47 time_t actime; // access time
48 time_t modtime; // modification time
49 };
50
51 struct utimbuf32
52 {
53 __time32_t actime; // access time
54 __time32_t modtime; // modification time
55 };
56
57#endif
58
59
60
61//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
62//
63// Functions
64//
65//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
67 _In_z_ char const* _FileName,
69 );
70
72 _In_ int _FileHandle,
74 );
75
77 _In_z_ wchar_t const* _FileName,
79 );
80
82 _In_z_ char const* _FileName,
84 );
85
87 _In_ int _FileHandle,
89 );
90
92 _In_z_ wchar_t const* _FileName,
94 );
95
96
97
98#if !defined RC_INVOKED && !defined __midl && !defined _CRT_NO_TIME_T
99 #ifdef _USE_32BIT_TIME_T
100
101 static __inline int __CRTDECL _utime(char const* const _FileName, struct _utimbuf* const _Time)
102 {
103 _STATIC_ASSERT(sizeof(struct _utimbuf) == sizeof(struct __utimbuf32));
104 return _utime32(_FileName, (struct __utimbuf32*)_Time);
105 }
106
107 static __inline int __CRTDECL _futime(int const _FileHandle, struct _utimbuf* const _Time)
108 {
109 _STATIC_ASSERT(sizeof(struct _utimbuf) == sizeof(struct __utimbuf32));
110 return _futime32(_FileHandle, (struct __utimbuf32*)_Time);
111 }
112
113 static __inline int __CRTDECL _wutime(wchar_t const* const _FileName, struct _utimbuf* const _Time)
114 {
115 _STATIC_ASSERT(sizeof(struct _utimbuf) == sizeof(struct __utimbuf32));
116 return _wutime32(_FileName, (struct __utimbuf32*)_Time);
117 }
118
119 #else
120 static __inline int __CRTDECL _utime(char const* const _FileName, struct _utimbuf* const _Time)
121 {
122 _STATIC_ASSERT(sizeof(struct _utimbuf) == sizeof(struct __utimbuf64));
123 return _utime64(_FileName, (struct __utimbuf64*)_Time);
124 }
125
126 static __inline int __CRTDECL _futime(int const _FileHandle, struct _utimbuf* const _Time)
127 {
128 _STATIC_ASSERT(sizeof(struct _utimbuf) == sizeof(struct __utimbuf64));
129 return _futime64(_FileHandle, (struct __utimbuf64*)_Time);
130 }
131
132 static __inline int __CRTDECL _wutime(wchar_t const* const _FileName, struct _utimbuf* const _Time)
133 {
134 _STATIC_ASSERT(sizeof(struct _utimbuf) == sizeof(struct __utimbuf64));
135 return _wutime64(_FileName, (struct __utimbuf64*)_Time);
136 }
137
138 #endif
139
140 #if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES
141 #ifdef _USE_32BIT_TIME_T
142
143 static __inline int __CRTDECL utime(char const* const _FileName, struct utimbuf* const _Time)
144 {
145 _STATIC_ASSERT(sizeof(struct utimbuf) == sizeof(struct __utimbuf32));
146 return _utime32(_FileName, (struct __utimbuf32*)_Time);
147 }
148
149 #else
150
151 static __inline int __CRTDECL utime(char const* const _FileName, struct utimbuf* const _Time)
152 {
153 _STATIC_ASSERT(sizeof(struct utimbuf) == sizeof(struct __utimbuf64));
154 return _utime64(_FileName, (struct __utimbuf64*)_Time);
155 }
156
157 #endif
158 #endif
159#endif
160
163#pragma warning(pop) // _UCRT_DISABLED_WARNINGS
#define __inline
Definition: _wctype.cpp:15
#define __cdecl
Definition: accygwin.h:79
void modtime(int argc, const char *argv[])
Definition: cmds.c:2232
_Out_ int * _FileHandle
_CRTIMP int __cdecl _utime32(_In_z_ const char *_Filename, _In_opt_ struct __utimbuf32 *_Time)
_CRTIMP int __cdecl _futime32(_In_ int _FileDes, _In_opt_ struct __utimbuf32 *_Time)
_CRTIMP int __cdecl _futime(_In_ int _FileDes, _In_opt_ struct _utimbuf *_Time)
_CRTIMP int __cdecl _utime(_In_z_ const char *_Filename, _In_opt_ struct _utimbuf *_Time)
_CRTIMP int __cdecl _wutime(_In_z_ const wchar_t *_Filename, _In_opt_ struct _utimbuf *_Time)
_CRTIMP int __cdecl _wutime32(_In_z_ const wchar_t *_Filename, _In_opt_ struct __utimbuf32 *_Time)
__kernel_time_t time_t
Definition: linux.h:252
#define utime
Definition: getline.c:47
#define _In_z_
Definition: no_sal2.h:164
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
_In_ size_t _In_ const __time32_t * _Time
Definition: time.h:192
long __time32_t
Definition: time.h:24
__time32_t actime
Definition: utime.h:30
__time32_t modtime
Definition: utime.h:31
__time64_t modtime
Definition: utime.h:40
__time64_t actime
Definition: utime.h:39
Definition: utime.h:24
time_t modtime
Definition: utime.h:26
time_t actime
Definition: utime.h:25
__time32_t modtime
Definition: utime.h:49
__time32_t actime
Definition: utime.h:48
#define _STATIC_ASSERT(expr)
Definition: corecrt.h:305
__int64 __time64_t
Definition: corecrt.h:619
#define _ACRTIMP
Definition: corecrt.h:138
#define _UCRT_DISABLE_CLANG_WARNINGS
Definition: corecrt.h:109
#define _UCRT_RESTORE_CLANG_WARNINGS
Definition: corecrt.h:117
_ACRTIMP int __cdecl _wutime64(_In_z_ wchar_t const *_FileName, _In_opt_ struct __utimbuf64 *_Time)
_ACRTIMP int __cdecl _utime64(_In_z_ char const *_FileName, _In_opt_ struct __utimbuf64 *_Time)
_ACRTIMP int __cdecl _futime64(_In_ int _FileHandle, _In_opt_ struct __utimbuf64 *_Time)
#define _CRT_END_C_HEADER
Definition: vcruntime.h:42
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:40
#define __CRTDECL
Definition: yvals.h:17