utime.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _INC_UTIME
  7. #define _INC_UTIME
  8. #ifndef _WIN32
  9. #error Only Win32 target is supported!
  10. #endif
  11. #include <crtdefs.h>
  12. #pragma pack(push,_CRT_PACKING)
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #ifndef _CRTIMP
  17. #define _CRTIMP __declspec(dllimport)
  18. #endif
  19. #ifndef _WCHAR_T_DEFINED
  20. typedef unsigned short wchar_t;
  21. #define _WCHAR_T_DEFINED
  22. #endif
  23. #ifdef _USE_32BIT_TIME_T
  24. #ifdef _WIN64
  25. #undef _USE_32BIT_TIME_T
  26. #endif
  27. #endif
  28. #ifndef _TIME32_T_DEFINED
  29. #define _TIME32_T_DEFINED
  30. typedef long __time32_t;
  31. #endif
  32. #ifndef _TIME64_T_DEFINED
  33. #define _TIME64_T_DEFINED
  34. __MINGW_EXTENSION typedef __int64 __time64_t;
  35. #endif
  36. #ifndef _TIME_T_DEFINED
  37. #define _TIME_T_DEFINED
  38. #ifdef _USE_32BIT_TIME_T
  39. typedef __time32_t time_t;
  40. #else
  41. typedef __time64_t time_t;
  42. #endif
  43. #endif
  44. #ifndef _UTIMBUF_DEFINED
  45. #define _UTIMBUF_DEFINED
  46. struct _utimbuf {
  47. time_t actime;
  48. time_t modtime;
  49. };
  50. struct __utimbuf32 {
  51. __time32_t actime;
  52. __time32_t modtime;
  53. };
  54. struct __utimbuf64 {
  55. __time64_t actime;
  56. __time64_t modtime;
  57. };
  58. #ifndef NO_OLDNAMES
  59. struct utimbuf {
  60. time_t actime;
  61. time_t modtime;
  62. };
  63. struct utimbuf32 {
  64. __time32_t actime;
  65. __time32_t modtime;
  66. };
  67. #endif
  68. #endif
  69. _CRTIMP int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Time);
  70. _CRTIMP int __cdecl _futime32(int _FileDes,struct __utimbuf32 *_Time);
  71. _CRTIMP int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Time);
  72. _CRTIMP int __cdecl _utime64(const char *_Filename,struct __utimbuf64 *_Time);
  73. _CRTIMP int __cdecl _futime64(int _FileDes,struct __utimbuf64 *_Time);
  74. _CRTIMP int __cdecl _wutime64(const wchar_t *_Filename,struct __utimbuf64 *_Time);
  75. #ifndef RC_INVOKED
  76. int __cdecl _utime(const char *,struct _utimbuf *);
  77. int __cdecl _futime(int,struct _utimbuf *);
  78. int __cdecl _wutime(const wchar_t *,struct _utimbuf *);
  79. #ifndef __CRT__NO_INLINE
  80. #ifdef _USE_32BIT_TIME_T
  81. __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) {
  82. return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf);
  83. }
  84. __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) {
  85. return _futime32(_Desc,(struct __utimbuf32 *)_Utimbuf);
  86. }
  87. __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) {
  88. return _wutime32(_Filename,(struct __utimbuf32 *)_Utimbuf);
  89. }
  90. #else
  91. __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) {
  92. return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
  93. }
  94. __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) {
  95. return _futime64(_Desc,(struct __utimbuf64 *)_Utimbuf);
  96. }
  97. __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) {
  98. return _wutime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
  99. }
  100. #endif
  101. #endif /* !__CRT__NO_INLINE */
  102. #ifndef NO_OLDNAMES
  103. int __cdecl utime(const char *, struct utimbuf *);
  104. #ifndef __CRT__NO_INLINE
  105. #ifndef _USE_32BIT_TIME_T
  106. __CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) {
  107. return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
  108. }
  109. #endif /* !_USE_32BIT_TIME_T */
  110. #endif /* !__CRT__NO_INLINE */
  111. #endif
  112. #endif
  113. #ifdef __cplusplus
  114. }
  115. #endif
  116. #pragma pack(pop)
  117. #endif