ReactOS 0.4.16-dev-2104-gb84fa49
utime.h File Reference
#include <corecrt.h>
#include <pshpack8.h>
#include <poppack.h>
Include dependency graph for utime.h:

Go to the source code of this file.

Classes

struct  _utimbuf
 
struct  __utimbuf32
 
struct  __utimbuf64
 

Macros

#define _UTIMBUF_DEFINED
 
#define utimbuf   _utimbuf
 

Functions

_ACRTIMP int __cdecl _futime32 (int, struct __utimbuf32 *)
 
_ACRTIMP int __cdecl _futime64 (int, struct __utimbuf64 *)
 
_ACRTIMP int __cdecl _utime32 (const char *, struct __utimbuf32 *)
 
_ACRTIMP int __cdecl _utime64 (const char *, struct __utimbuf64 *)
 
_ACRTIMP int __cdecl _wutime32 (const wchar_t *, struct __utimbuf32 *)
 
_ACRTIMP int __cdecl _wutime64 (const wchar_t *, struct __utimbuf64 *)
 
static int _futime (int fd, struct _utimbuf *buf)
 
static int _utime (const char *s, struct _utimbuf *buf)
 
static int _wutime (const wchar_t *s, struct _utimbuf *buf)
 
static int utime (const char *path, struct _utimbuf *buf)
 

Macro Definition Documentation

◆ _UTIMBUF_DEFINED

#define _UTIMBUF_DEFINED

Definition at line 28 of file utime.h.

◆ utimbuf

Definition at line 72 of file utime.h.

Function Documentation

◆ _futime()

static int _futime ( int  fd,
struct _utimbuf buf 
)
inlinestatic

Definition at line 62 of file utime.h.

62{ return _futime64(fd, (struct __utimbuf64*)buf); }
_ACRTIMP int __cdecl _futime64(int, struct __utimbuf64 *)
Definition: file.c:2072
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static int fd
Definition: io.c:51

Referenced by _tutime().

◆ _futime32()

_ACRTIMP int __cdecl _futime32 ( int  fd,
struct __utimbuf32 t 
)

Definition at line 2101 of file file.c.

2102{
2103 if (t)
2104 {
2105 struct __utimbuf64 t64;
2106 t64.actime = t->actime;
2107 t64.modtime = t->modtime;
2108 return _futime64( fd, &t64 );
2109 }
2110 else
2111 return _futime64( fd, NULL );
2112}
#define NULL
Definition: types.h:112
int CDECL _futime64(int fd, struct __utimbuf64 *t)
Definition: file.c:2072
GLdouble GLdouble t
Definition: gl.h:2047
__time64_t actime
Definition: utime.h:41

◆ _futime64()

_ACRTIMP int __cdecl _futime64 ( int  fd,
struct __utimbuf64 t 
)

Definition at line 2072 of file file.c.

2073{
2075 FILETIME at, wt;
2076
2077 if (!t)
2078 {
2079 time_to_filetime( _time64(NULL), &at );
2080 wt = at;
2081 }
2082 else
2083 {
2084 time_to_filetime( t->actime, &at );
2085 time_to_filetime( t->modtime, &wt );
2086 }
2087
2088 if (!SetFileTime(info->handle, NULL, &at, &wt))
2089 {
2092 return -1 ;
2093 }
2095 return 0;
2096}
BOOL WINAPI SetFileTime(IN HANDLE hFile, CONST FILETIME *lpCreationTime OPTIONAL, CONST FILETIME *lpLastAccessTime OPTIONAL, CONST FILETIME *lpLastWriteTime OPTIONAL)
Definition: fileinfo.c:948
static void time_to_filetime(__time64_t time, FILETIME *ft)
Definition: file.c:384
static ioinfo * get_ioinfo(int fd)
Definition: file.c:417
static void release_ioinfo(ioinfo *info)
Definition: file.c:514
_ACRTIMP __time64_t __cdecl _time64(__time64_t *)
Definition: time.c:780
#define msvcrt_set_errno
Definition: heap.c:50
Definition: file.c:128
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by _futime(), _futime32(), _utime64(), and _wutime64().

◆ _utime()

static int _utime ( const char s,
struct _utimbuf buf 
)
inlinestatic

Definition at line 63 of file utime.h.

63{ return _utime64(s, (struct __utimbuf64*)buf); }
_ACRTIMP int __cdecl _utime64(const char *, struct __utimbuf64 *)
Definition: file.c:3497
GLdouble s
Definition: gl.h:2039

Referenced by utime().

◆ _utime32()

_ACRTIMP int __cdecl _utime32 ( const char path,
struct __utimbuf32 t 
)

Definition at line 3513 of file file.c.

3514{
3515 if (t)
3516 {
3517 struct __utimbuf64 t64;
3518 t64.actime = t->actime;
3519 t64.modtime = t->modtime;
3520 return _utime64( path, &t64 );
3521 }
3522 else
3523 return _utime64( path, NULL );
3524}
int CDECL _utime64(const char *path, struct __utimbuf64 *t)
Definition: file.c:3497

◆ _utime64()

_ACRTIMP int __cdecl _utime64 ( const char path,
struct __utimbuf64 t 
)

Definition at line 3497 of file file.c.

3498{
3499 int fd = _open(path, _O_WRONLY | _O_BINARY);
3500
3501 if (fd > 0)
3502 {
3503 int retVal = _futime64(fd, t);
3504 _close(fd);
3505 return retVal;
3506 }
3507 return -1;
3508}
#define _O_BINARY
Definition: cabinet.h:51
#define _O_WRONLY
Definition: cabinet.h:38
int CDECL _close(int fd)
Definition: file.c:1219
int WINAPIV _open(const char *path, int flags,...)
Definition: file.c:2655

Referenced by _utime(), and _utime32().

◆ _wutime()

static int _wutime ( const wchar_t s,
struct _utimbuf buf 
)
inlinestatic

Definition at line 64 of file utime.h.

64{ return _wutime64(s, (struct __utimbuf64*)buf); }
_ACRTIMP int __cdecl _wutime64(const wchar_t *, struct __utimbuf64 *)
Definition: file.c:3529

◆ _wutime32()

_ACRTIMP int __cdecl _wutime32 ( const wchar_t path,
struct __utimbuf32 t 
)

Definition at line 3545 of file file.c.

3546{
3547 if (t)
3548 {
3549 struct __utimbuf64 t64;
3550 t64.actime = t->actime;
3551 t64.modtime = t->modtime;
3552 return _wutime64( path, &t64 );
3553 }
3554 else
3555 return _wutime64( path, NULL );
3556}
int CDECL _wutime64(const wchar_t *path, struct __utimbuf64 *t)
Definition: file.c:3529

◆ _wutime64()

_ACRTIMP int __cdecl _wutime64 ( const wchar_t path,
struct __utimbuf64 t 
)

Definition at line 3529 of file file.c.

3530{
3531 int fd = _wopen(path, _O_WRONLY | _O_BINARY);
3532
3533 if (fd > 0)
3534 {
3535 int retVal = _futime64(fd, t);
3536 _close(fd);
3537 return retVal;
3538 }
3539 return -1;
3540}
int WINAPIV _wopen(const wchar_t *path, int flags,...)
Definition: file.c:2674

Referenced by _wutime(), and _wutime32().

◆ utime()

static int utime ( const char path,
struct _utimbuf buf 
)
inlinestatic

Definition at line 74 of file utime.h.

74{ return _utime(path, buf); }
static int _utime(const char *s, struct _utimbuf *buf)
Definition: utime.h:63