1*04e0dc4aSTimo Kreuzer // 2*04e0dc4aSTimo Kreuzer // sys/utime.h 3*04e0dc4aSTimo Kreuzer // 4*04e0dc4aSTimo Kreuzer // Copyright (c) Microsoft Corporation. All rights reserved. 5*04e0dc4aSTimo Kreuzer // 6*04e0dc4aSTimo Kreuzer // The _utime() family of functions. 7*04e0dc4aSTimo Kreuzer // 8*04e0dc4aSTimo Kreuzer #pragma once 9*04e0dc4aSTimo Kreuzer 10*04e0dc4aSTimo Kreuzer #include <corecrt.h> 11*04e0dc4aSTimo Kreuzer 12*04e0dc4aSTimo Kreuzer #pragma warning(push) 13*04e0dc4aSTimo Kreuzer #pragma warning(disable: _UCRT_DISABLED_WARNINGS) 14*04e0dc4aSTimo Kreuzer _UCRT_DISABLE_CLANG_WARNINGS 15*04e0dc4aSTimo Kreuzer 16*04e0dc4aSTimo Kreuzer _CRT_BEGIN_C_HEADER 17*04e0dc4aSTimo Kreuzer 18*04e0dc4aSTimo Kreuzer //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 19*04e0dc4aSTimo Kreuzer // 20*04e0dc4aSTimo Kreuzer // Types 21*04e0dc4aSTimo Kreuzer // 22*04e0dc4aSTimo Kreuzer //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 23*04e0dc4aSTimo Kreuzer #ifndef _CRT_NO_TIME_T 24*04e0dc4aSTimo Kreuzer struct _utimbuf 25*04e0dc4aSTimo Kreuzer { 26*04e0dc4aSTimo Kreuzer time_t actime; // access time 27*04e0dc4aSTimo Kreuzer time_t modtime; // modification time 28*04e0dc4aSTimo Kreuzer }; 29*04e0dc4aSTimo Kreuzer #endif 30*04e0dc4aSTimo Kreuzer 31*04e0dc4aSTimo Kreuzer struct __utimbuf32 32*04e0dc4aSTimo Kreuzer { 33*04e0dc4aSTimo Kreuzer __time32_t actime; // access time 34*04e0dc4aSTimo Kreuzer __time32_t modtime; // modification time 35*04e0dc4aSTimo Kreuzer }; 36*04e0dc4aSTimo Kreuzer 37*04e0dc4aSTimo Kreuzer struct __utimbuf64 38*04e0dc4aSTimo Kreuzer { 39*04e0dc4aSTimo Kreuzer __time64_t actime; // access time 40*04e0dc4aSTimo Kreuzer __time64_t modtime; // modification time 41*04e0dc4aSTimo Kreuzer }; 42*04e0dc4aSTimo Kreuzer 43*04e0dc4aSTimo Kreuzer #if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES && !defined _CRT_NO_TIME_T 44*04e0dc4aSTimo Kreuzer 45*04e0dc4aSTimo Kreuzer struct utimbuf 46*04e0dc4aSTimo Kreuzer { 47*04e0dc4aSTimo Kreuzer time_t actime; // access time 48*04e0dc4aSTimo Kreuzer time_t modtime; // modification time 49*04e0dc4aSTimo Kreuzer }; 50*04e0dc4aSTimo Kreuzer 51*04e0dc4aSTimo Kreuzer struct utimbuf32 52*04e0dc4aSTimo Kreuzer { 53*04e0dc4aSTimo Kreuzer __time32_t actime; // access time 54*04e0dc4aSTimo Kreuzer __time32_t modtime; // modification time 55*04e0dc4aSTimo Kreuzer }; 56*04e0dc4aSTimo Kreuzer 57*04e0dc4aSTimo Kreuzer #endif 58*04e0dc4aSTimo Kreuzer 59*04e0dc4aSTimo Kreuzer 60*04e0dc4aSTimo Kreuzer 61*04e0dc4aSTimo Kreuzer //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 62*04e0dc4aSTimo Kreuzer // 63*04e0dc4aSTimo Kreuzer // Functions 64*04e0dc4aSTimo Kreuzer // 65*04e0dc4aSTimo Kreuzer //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 66*04e0dc4aSTimo Kreuzer _ACRTIMP int __cdecl _utime32( 67*04e0dc4aSTimo Kreuzer _In_z_ char const* _FileName, 68*04e0dc4aSTimo Kreuzer _In_opt_ struct __utimbuf32* _Time 69*04e0dc4aSTimo Kreuzer ); 70*04e0dc4aSTimo Kreuzer 71*04e0dc4aSTimo Kreuzer _ACRTIMP int __cdecl _futime32( 72*04e0dc4aSTimo Kreuzer _In_ int _FileHandle, 73*04e0dc4aSTimo Kreuzer _In_opt_ struct __utimbuf32* _Time 74*04e0dc4aSTimo Kreuzer ); 75*04e0dc4aSTimo Kreuzer 76*04e0dc4aSTimo Kreuzer _ACRTIMP int __cdecl _wutime32( 77*04e0dc4aSTimo Kreuzer _In_z_ wchar_t const* _FileName, 78*04e0dc4aSTimo Kreuzer _In_opt_ struct __utimbuf32* _Time 79*04e0dc4aSTimo Kreuzer ); 80*04e0dc4aSTimo Kreuzer 81*04e0dc4aSTimo Kreuzer _ACRTIMP int __cdecl _utime64( 82*04e0dc4aSTimo Kreuzer _In_z_ char const* _FileName, 83*04e0dc4aSTimo Kreuzer _In_opt_ struct __utimbuf64* _Time 84*04e0dc4aSTimo Kreuzer ); 85*04e0dc4aSTimo Kreuzer 86*04e0dc4aSTimo Kreuzer _ACRTIMP int __cdecl _futime64( 87*04e0dc4aSTimo Kreuzer _In_ int _FileHandle, 88*04e0dc4aSTimo Kreuzer _In_opt_ struct __utimbuf64* _Time 89*04e0dc4aSTimo Kreuzer ); 90*04e0dc4aSTimo Kreuzer 91*04e0dc4aSTimo Kreuzer _ACRTIMP int __cdecl _wutime64( 92*04e0dc4aSTimo Kreuzer _In_z_ wchar_t const* _FileName, 93*04e0dc4aSTimo Kreuzer _In_opt_ struct __utimbuf64* _Time 94*04e0dc4aSTimo Kreuzer ); 95*04e0dc4aSTimo Kreuzer 96*04e0dc4aSTimo Kreuzer 97*04e0dc4aSTimo Kreuzer 98*04e0dc4aSTimo Kreuzer #if !defined RC_INVOKED && !defined __midl && !defined _CRT_NO_TIME_T 99*04e0dc4aSTimo Kreuzer #ifdef _USE_32BIT_TIME_T 100*04e0dc4aSTimo Kreuzer _utime(char const * const _FileName,struct _utimbuf * const _Time)101*04e0dc4aSTimo Kreuzer static __inline int __CRTDECL _utime(char const* const _FileName, struct _utimbuf* const _Time) 102*04e0dc4aSTimo Kreuzer { 103*04e0dc4aSTimo Kreuzer _STATIC_ASSERT(sizeof(struct _utimbuf) == sizeof(struct __utimbuf32)); 104*04e0dc4aSTimo Kreuzer return _utime32(_FileName, (struct __utimbuf32*)_Time); 105*04e0dc4aSTimo Kreuzer } 106*04e0dc4aSTimo Kreuzer _futime(int const _FileHandle,struct _utimbuf * const _Time)107*04e0dc4aSTimo Kreuzer static __inline int __CRTDECL _futime(int const _FileHandle, struct _utimbuf* const _Time) 108*04e0dc4aSTimo Kreuzer { 109*04e0dc4aSTimo Kreuzer _STATIC_ASSERT(sizeof(struct _utimbuf) == sizeof(struct __utimbuf32)); 110*04e0dc4aSTimo Kreuzer return _futime32(_FileHandle, (struct __utimbuf32*)_Time); 111*04e0dc4aSTimo Kreuzer } 112*04e0dc4aSTimo Kreuzer _wutime(wchar_t const * const _FileName,struct _utimbuf * const _Time)113*04e0dc4aSTimo Kreuzer static __inline int __CRTDECL _wutime(wchar_t const* const _FileName, struct _utimbuf* const _Time) 114*04e0dc4aSTimo Kreuzer { 115*04e0dc4aSTimo Kreuzer _STATIC_ASSERT(sizeof(struct _utimbuf) == sizeof(struct __utimbuf32)); 116*04e0dc4aSTimo Kreuzer return _wutime32(_FileName, (struct __utimbuf32*)_Time); 117*04e0dc4aSTimo Kreuzer } 118*04e0dc4aSTimo Kreuzer 119*04e0dc4aSTimo Kreuzer #else _utime(char const * const _FileName,struct _utimbuf * const _Time)120*04e0dc4aSTimo Kreuzer static __inline int __CRTDECL _utime(char const* const _FileName, struct _utimbuf* const _Time) 121*04e0dc4aSTimo Kreuzer { 122*04e0dc4aSTimo Kreuzer _STATIC_ASSERT(sizeof(struct _utimbuf) == sizeof(struct __utimbuf64)); 123*04e0dc4aSTimo Kreuzer return _utime64(_FileName, (struct __utimbuf64*)_Time); 124*04e0dc4aSTimo Kreuzer } 125*04e0dc4aSTimo Kreuzer _futime(int const _FileHandle,struct _utimbuf * const _Time)126*04e0dc4aSTimo Kreuzer static __inline int __CRTDECL _futime(int const _FileHandle, struct _utimbuf* const _Time) 127*04e0dc4aSTimo Kreuzer { 128*04e0dc4aSTimo Kreuzer _STATIC_ASSERT(sizeof(struct _utimbuf) == sizeof(struct __utimbuf64)); 129*04e0dc4aSTimo Kreuzer return _futime64(_FileHandle, (struct __utimbuf64*)_Time); 130*04e0dc4aSTimo Kreuzer } 131*04e0dc4aSTimo Kreuzer _wutime(wchar_t const * const _FileName,struct _utimbuf * const _Time)132*04e0dc4aSTimo Kreuzer static __inline int __CRTDECL _wutime(wchar_t const* const _FileName, struct _utimbuf* const _Time) 133*04e0dc4aSTimo Kreuzer { 134*04e0dc4aSTimo Kreuzer _STATIC_ASSERT(sizeof(struct _utimbuf) == sizeof(struct __utimbuf64)); 135*04e0dc4aSTimo Kreuzer return _wutime64(_FileName, (struct __utimbuf64*)_Time); 136*04e0dc4aSTimo Kreuzer } 137*04e0dc4aSTimo Kreuzer 138*04e0dc4aSTimo Kreuzer #endif 139*04e0dc4aSTimo Kreuzer 140*04e0dc4aSTimo Kreuzer #if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES 141*04e0dc4aSTimo Kreuzer #ifdef _USE_32BIT_TIME_T 142*04e0dc4aSTimo Kreuzer utime(char const * const _FileName,struct utimbuf * const _Time)143*04e0dc4aSTimo Kreuzer static __inline int __CRTDECL utime(char const* const _FileName, struct utimbuf* const _Time) 144*04e0dc4aSTimo Kreuzer { 145*04e0dc4aSTimo Kreuzer _STATIC_ASSERT(sizeof(struct utimbuf) == sizeof(struct __utimbuf32)); 146*04e0dc4aSTimo Kreuzer return _utime32(_FileName, (struct __utimbuf32*)_Time); 147*04e0dc4aSTimo Kreuzer } 148*04e0dc4aSTimo Kreuzer 149*04e0dc4aSTimo Kreuzer #else 150*04e0dc4aSTimo Kreuzer utime(char const * const _FileName,struct utimbuf * const _Time)151*04e0dc4aSTimo Kreuzer static __inline int __CRTDECL utime(char const* const _FileName, struct utimbuf* const _Time) 152*04e0dc4aSTimo Kreuzer { 153*04e0dc4aSTimo Kreuzer _STATIC_ASSERT(sizeof(struct utimbuf) == sizeof(struct __utimbuf64)); 154*04e0dc4aSTimo Kreuzer return _utime64(_FileName, (struct __utimbuf64*)_Time); 155*04e0dc4aSTimo Kreuzer } 156*04e0dc4aSTimo Kreuzer 157*04e0dc4aSTimo Kreuzer #endif 158*04e0dc4aSTimo Kreuzer #endif 159*04e0dc4aSTimo Kreuzer #endif 160*04e0dc4aSTimo Kreuzer 161*04e0dc4aSTimo Kreuzer _CRT_END_C_HEADER 162*04e0dc4aSTimo Kreuzer _UCRT_RESTORE_CLANG_WARNINGS 163*04e0dc4aSTimo Kreuzer #pragma warning(pop) // _UCRT_DISABLED_WARNINGS 164