[PATCH 2/2] add the declarations for _stat32, _fstat32, _wstat32 and other missing stat functions

Vijay Kiran Kamuju infyquest at gmail.com
Sat Nov 20 08:31:04 CST 2010


Changelog
---------------
Part 2 of the series, this is based on the w64 mingw32 runtime headers
[PATCH 2/2] add the declarations for _stat32, _fstat32, _wstat32 and other
missing stat functions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20101120/0c0fdd17/attachment.htm>
-------------- next part --------------
From bd465e06215cd9ed0b55e9108c48ad7768b6c5c3 Mon Sep 17 00:00:00 2001
From: Vijay Kiran Kamuju <infyquest at gmail.com>
Date: Sat, 20 Nov 2010 09:20:09 -0500
Subject: [PATCH 2/2] [PATCH 2/2] add declarations for _stat32,_fstat32,_wstat32 and other missing _*stat* functions based on w64 mingw-runtime headers

---
 include/msvcrt/sys/stat.h |   59 ++++++++++++++++++++++++++++++++++++++++++--
 include/msvcrt/wchar.h    |   45 ++++++++++++++++++++++++++++++++++
 2 files changed, 101 insertions(+), 3 deletions(-)

diff --git a/include/msvcrt/sys/stat.h b/include/msvcrt/sys/stat.h
index 9362d2d..600cfa3 100644
--- a/include/msvcrt/sys/stat.h
+++ b/include/msvcrt/sys/stat.h
@@ -83,6 +83,20 @@ struct stat {
   time_t st_ctime;
 };
 
+struct _stat32 {
+  _dev_t st_dev;
+  _ino_t st_ino;
+  unsigned short st_mode;
+  short          st_nlink;
+  short          st_uid;
+  short          st_gid;
+  _dev_t st_rdev;
+  _off_t st_size;
+  __time32_t st_atime;
+  __time32_t st_mtime;
+  __time32_t st_ctime;
+};
+
 struct _stat32i64 {
   _dev_t st_dev;
   _ino_t st_ino;
@@ -146,8 +160,12 @@ extern "C" {
 
 int __cdecl _fstat(int,struct _stat*);
 int __cdecl _stat(const char*,struct _stat*);
+int __cdecl _fstat32(int,struct _stat32*);
+int __cdecl _stat32(const char*,struct _stat32*);
 int __cdecl _fstati64(int,struct _stati64*);
 int __cdecl _stati64(const char*,struct _stati64*);
+int __cdecl _fstat32i64(int,struct _stat32i64*);
+int __cdecl _stat32i64(const char*,struct _stat32i64*);
 int __cdecl _fstat64(int,struct _stat64*);
 int __cdecl _stat64(const char*,struct _stat64*);
 int __cdecl _umask(int);
@@ -155,7 +173,10 @@ int __cdecl _umask(int);
 #ifndef _WSTAT_DEFINED
 #define _WSTAT_DEFINED
 int __cdecl _wstat(const wchar_t*,struct _stat*);
+int __cdecl _wstat32(const wchar_t*,struct _stat32*);
 int __cdecl _wstati64(const wchar_t*,struct _stati64*);
+int __cdecl _wstat32i64(const wchar_t*,struct _stat32i64*);
+int __cdecl _wstat64i32(const wchar_t*,struct _stat64i32*);
 int __cdecl _wstat64(const wchar_t*,struct _stat64*);
 #endif /* _WSTAT_DEFINED */
 
@@ -172,10 +193,42 @@ int __cdecl _wstat64(const wchar_t*,struct _stat64*);
 #define S_IWRITE _S_IWRITE
 #define S_IEXEC  _S_IEXEC
 
-static inline int fstat(int fd, struct stat* ptr) { return _fstat(fd, (struct _stat*)ptr); }
-static inline int stat(const char* path, struct stat* ptr) { return _stat(path, (struct _stat*)ptr); }
+static inline int __cdecl _fstat64i32(int fd,struct _stat64i32* ptr) {
+   struct _stat64 st;
+   int ret=_fstat64(fd,&st);
+    ptr->st_dev=st.st_dev;
+    ptr->st_ino=st.st_ino;
+    ptr->st_mode=st.st_mode;
+    ptr->st_nlink=st.st_nlink;
+    ptr->st_uid=st.st_uid;
+    ptr->st_gid=st.st_gid;
+    ptr->st_rdev=st.st_rdev;
+    ptr->st_size=(_off_t) st.st_size;
+    ptr->st_atime=st.st_atime;
+    ptr->st_mtime=st.st_mtime;
+    ptr->st_ctime=st.st_ctime;
+    return ret;
+}
+static inline int __cdecl _stat64i32(const char* path,struct _stat64i32* ptr) {
+   struct _stat64 st;
+   int ret=_stat64(path,&st);
+    ptr->st_dev=st.st_dev;
+    ptr->st_ino=st.st_ino;
+    ptr->st_mode=st.st_mode;
+    ptr->st_nlink=st.st_nlink;
+    ptr->st_uid=st.st_uid;
+    ptr->st_gid=st.st_gid;
+    ptr->st_rdev=st.st_rdev;
+    ptr->st_size=(_off_t) st.st_size;
+    ptr->st_atime=st.st_atime;
+    ptr->st_mtime=st.st_mtime;
+    ptr->st_ctime=st.st_ctime;
+    return ret;
+}
+static inline int __cdecl fstat(int fd, struct stat* ptr) { return _fstat(fd, (struct _stat*)ptr); }
+static inline int __cdecl stat(const char* path, struct stat* ptr) { return _stat(path, (struct _stat*)ptr); }
 #ifndef _UMASK_DEFINED
-static inline int umask(int fd) { return _umask(fd); }
+static inline int __cdecl umask(int fd) { return _umask(fd); }
 #define _UMASK_DEFINED
 #endif
 
diff --git a/include/msvcrt/wchar.h b/include/msvcrt/wchar.h
index c5ab25f..cc7dd91 100644
--- a/include/msvcrt/wchar.h
+++ b/include/msvcrt/wchar.h
@@ -148,6 +148,48 @@ struct stat {
   time_t st_ctime;
 };
 
+struct _stat32 {
+  _dev_t st_dev;
+  _ino_t st_ino;
+  unsigned short st_mode;
+  short          st_nlink;
+  short          st_uid;
+  short          st_gid;
+  _dev_t st_rdev;
+  _off_t st_size;
+  __time32_t st_atime;
+  __time32_t st_mtime;
+  __time32_t st_ctime;
+};
+
+struct _stat32i64 {
+  _dev_t st_dev;
+  _ino_t st_ino;
+  unsigned short st_mode;
+  short st_nlink;
+  short st_uid;
+  short st_gid;
+  _dev_t st_rdev;
+  __int64 DECLSPEC_ALIGN(8) st_size;
+  time_t st_atime;
+  time_t st_mtime;
+  time_t st_ctime;
+};
+
+struct _stat64i32 {
+  _dev_t st_dev;
+  _ino_t st_ino;
+  unsigned short st_mode;
+  short st_nlink;
+  short st_uid;
+  short st_gid;
+  _dev_t st_rdev;
+  _off_t st_size;
+  __time64_t st_atime;
+  __time64_t st_mtime;
+  __time64_t st_ctime;
+};
+
 struct _stati64 {
   _dev_t st_dev;
   _ino_t st_ino;
@@ -264,7 +306,10 @@ int      __cdecl _wsystem(const wchar_t*);
 #ifndef _WSTAT_DEFINED
 #define _WSTAT_DEFINED
 int __cdecl _wstat(const wchar_t*,struct _stat*);
+int __cdecl _wstat32(const wchar_t*,struct _stat32*);
 int __cdecl _wstati64(const wchar_t*,struct _stati64*);
+int __cdecl _wstat32i64(const wchar_t*,struct _stat32i64*);
+int __cdecl _wstat64i32(const wchar_t*,struct _stat64i32*);
 int __cdecl _wstat64(const wchar_t*,struct _stat64*);
 #endif /* _WSTAT_DEFINED */
 
-- 
1.7.1


More information about the wine-patches mailing list