|
|
|
| 1 |
|
/*** |
| 2 |
|
*sys/utime.h - definitions/declarations for utime() |
| 3 |
|
* |
| 4 |
|
* Copyright (c) Microsoft Corporation. All rights reserved. |
| 5 |
|
* |
| 6 |
|
*Purpose: |
| 7 |
|
* This file defines the structure used by the utime routine to set |
| 8 |
|
* new file access and modification times. NOTE - MS-DOS |
| 9 |
|
* does not recognize access time, so this field will |
| 10 |
|
* always be ignored and the modification time field will be |
| 11 |
|
* used to set the new time. |
| 12 |
|
* |
| 13 |
|
* [Public] |
| 14 |
|
* |
| 15 |
|
****/ |
| 16 |
|
|
| 17 |
|
#if _MSC_VER > 1000 |
| 18 |
|
#pragma once |
| 19 |
|
#endif |
| 20 |
|
|
| 21 |
|
#include <crtdefs.h> |
| 22 |
|
|
| 23 |
|
#ifndef _INC_UTIME |
| 24 |
|
#define _INC_UTIME |
| 25 |
|
|
| 26 |
|
#if !defined(_WIN32) |
| 27 |
|
#error ERROR: Only Win32 target supported! |
| 28 |
|
#endif |
| 29 |
|
|
| 30 |
|
#include <crtdefs.h> |
| 31 |
|
|
| 32 |
|
|
| 33 |
|
#ifdef _MSC_VER |
| 34 |
|
#pragma pack(push,_CRT_PACKING) |
| 35 |
|
#endif /* _MSC_VER */ |
| 36 |
|
|
| 37 |
|
#ifdef __cplusplus |
| 38 |
|
extern "C" { |
| 39 |
|
#endif |
| 40 |
|
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
/* Define _CRTIMP */ |
| 44 |
|
|
| 45 |
|
#ifndef _CRTIMP |
| 46 |
|
#ifdef _DLL |
| 47 |
|
#define _CRTIMP __declspec(dllimport) |
| 48 |
|
#else /* ndef _DLL */ |
| 49 |
|
#define _CRTIMP |
| 50 |
|
#endif /* _DLL */ |
| 51 |
|
#endif /* _CRTIMP */ |
| 52 |
|
|
| 53 |
|
|
| 54 |
|
/* Define __cdecl for non-Microsoft compilers */ |
| 55 |
|
|
| 56 |
|
#if ( !defined(_MSC_VER) && !defined(__cdecl) ) |
| 57 |
|
#define __cdecl |
| 58 |
|
#endif |
| 59 |
|
|
| 60 |
|
#ifndef _WCHAR_T_DEFINED |
| 61 |
|
typedef unsigned short wchar_t; |
| 62 |
|
#define _WCHAR_T_DEFINED |
| 63 |
|
#endif |
| 64 |
|
|
| 65 |
|
#if !defined(_W64) |
| 66 |
|
#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 |
| 67 |
|
#define _W64 __w64 |
| 68 |
|
#else |
| 69 |
|
#define _W64 |
| 70 |
|
#endif |
| 71 |
|
#endif |
| 72 |
|
|
| 73 |
|
#ifdef _USE_32BIT_TIME_T |
| 74 |
|
#ifdef _WIN64 |
| 75 |
|
#include <crtwrn.h> |
| 76 |
|
#pragma _CRT_WARNING( _NO_32BIT_TIME_T ) |
| 77 |
|
#undef _USE_32BIT_TIME_T |
| 78 |
|
#endif |
| 79 |
|
#endif |
| 80 |
|
|
| 81 |
|
#ifndef _TIME32_T_DEFINED |
| 82 |
|
typedef _W64 long __time32_t; /* 32-bit time value */ |
| 83 |
|
#define _TIME32_T_DEFINED |
| 84 |
|
#endif |
| 85 |
|
|
| 86 |
|
#ifndef _TIME64_T_DEFINED |
| 87 |
|
typedef __int64 __time64_t; /* 64-bit time value */ |
| 88 |
|
#define _TIME64_T_DEFINED |
| 89 |
|
#endif |
| 90 |
|
|
| 91 |
|
#ifndef _TIME_T_DEFINED |
| 92 |
|
#ifdef _USE_32BIT_TIME_T |
| 93 |
|
typedef __time32_t time_t; /* time value */ |
| 94 |
|
#else |
| 95 |
|
typedef __time64_t time_t; /* time value */ |
| 96 |
|
#endif |
| 97 |
|
#define _TIME_T_DEFINED /* avoid multiple def's of time_t */ |
| 98 |
|
#endif |
| 99 |
|
|
| 100 |
|
/* define struct used by _utime() function */ |
| 101 |
|
|
| 102 |
|
#ifndef _UTIMBUF_DEFINED |
| 103 |
|
|
| 104 |
|
struct _utimbuf { |
| 105 |
|
time_t actime; /* access time */ |
| 116 |
|
__time64_t modtime; /* modification time */ |
| 117 |
|
}; |
| 118 |
|
|
| 119 |
|
#if !__STDC__ |
| 120 |
|
/* Non-ANSI name for compatibility */ |
| 121 |
|
struct utimbuf { |
| 122 |
|
time_t actime; /* access time */ |
| 123 |
|
time_t modtime; /* modification time */ |
| 124 |
|
}; |
| 125 |
|
|
| 126 |
|
struct utimbuf32 { |
| 127 |
|
__time32_t actime; /* access time */ |
| 128 |
|
__time32_t modtime; /* modification time */ |
| 129 |
|
}; |
| 130 |
|
|
| 131 |
|
#endif /* !__STDC__ */ |
| 132 |
|
|
| 133 |
|
#define _UTIMBUF_DEFINED |
| 134 |
|
#endif |
| 135 |
|
|
| 136 |
|
|
| 137 |
|
/* Function Prototypes */ |
| 138 |
|
|
| 139 |
|
_CRTIMP int __cdecl _utime32(_In_z_ const char * _Filename, _In_opt_ struct __utimbuf32 * _Time); |
| 140 |
|
|
| 141 |
|
_CRTIMP int __cdecl _futime32(_In_ int _FileDes, _In_opt_ struct __utimbuf32 * _Time); |
| 142 |
|
|
| 143 |
|
/* Wide Function Prototypes */ |
| 144 |
|
_CRTIMP int __cdecl _wutime32(_In_z_ const wchar_t * _Filename, _In_opt_ struct __utimbuf32 * _Time); |
| 145 |
|
|
| 146 |
|
_CRTIMP int __cdecl _utime64(_In_z_ const char * _Filename, _In_opt_ struct __utimbuf64 * _Time); |
| 147 |
|
_CRTIMP int __cdecl _futime64(_In_ int _FileDes, _In_opt_ struct __utimbuf64 * _Time); |
| 148 |
|
_CRTIMP int __cdecl _wutime64(_In_z_ const wchar_t * _Filename, _In_opt_ struct __utimbuf64 * _Time); |
| 149 |
|
|
| 150 |
|
#if !defined(RC_INVOKED) && !defined(__midl) |
| 151 |
|
#include <sys/utime.inl> |
| 152 |
|
#endif |
| 153 |
|
|
| 154 |
|
#ifdef __cplusplus |
| 155 |
|
} |
| 156 |
|
#endif |
| 157 |
|
|
| 158 |
|
#ifdef _MSC_VER |
| 159 |
|
#pragma pack(pop) |
| 160 |
|
#endif /* _MSC_VER */ |
| 161 |
|
|
| 162 |
|
#endif /* _INC_UTIME */ |
| 163 |
|
|
|
|
|