*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
- * DISCLAMED. This includes but is not limited to warranties of
+ * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision$
#include <msvcrt/sys/types.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
#ifndef _WCHAR_T_
#define _WCHAR_T_
#define _WCHAR_T
#define _WCHAR_T_DEFINED
#ifndef __WCHAR_TYPE__
-#define __WCHAR_TYPE__ short unsigned int
+#define __WCHAR_TYPE__ short unsigned int
#endif
#ifndef __cplusplus
-typedef __WCHAR_TYPE__ wchar_t;
-#endif /* C++ */
-#endif /* wchar_t not already defined */
+typedef __WCHAR_TYPE__ wchar_t;
+#endif /* C++ */
+#endif /* wchar_t not already defined */
/*
* Constants for the stat st_mode member.
*/
-#define S_IFIFO 0x1000 /* FIFO */
-#define S_IFCHR 0x2000 /* Character */
-#define S_IFBLK 0x3000 /* Block */
-#define S_IFDIR 0x4000 /* Directory */
-#define S_IFREG 0x8000 /* Regular */
+#define S_IFIFO 0x1000 /* FIFO */
+#define S_IFCHR 0x2000 /* Character */
+#define S_IFBLK 0x3000 /* Block */
+#define S_IFDIR 0x4000 /* Directory */
+#define S_IFREG 0x8000 /* Regular */
-#define S_IFMT 0xF000 /* File type mask */
+#define S_IFMT 0xF000 /* File type mask */
-#define S_IEXEC 0x0040
-#define S_IWRITE 0x0080
-#define S_IREAD 0x0100
+#define S_IEXEC 0x0040
+#define S_IWRITE 0x0080
+#define S_IREAD 0x0100
-#define S_ISDIR(m) ((m) & S_IFDIR)
-#define S_ISFIFO(m) ((m) & S_IFIFO)
-#define S_ISCHR(m) ((m) & S_IFCHR)
-#define S_ISBLK(m) ((m) & S_IFBLK)
-#define S_ISREG(m) ((m) & S_IFREG)
+#define S_ISDIR(m) ((m) & S_IFDIR)
+#define S_ISFIFO(m) ((m) & S_IFIFO)
+#define S_ISCHR(m) ((m) & S_IFCHR)
+#define S_ISBLK(m) ((m) & S_IFBLK)
+#define S_ISREG(m) ((m) & S_IFREG)
-#define S_IRWXU (S_IREAD | S_IWRITE | S_IEXEC)
-#define S_IXUSR S_IEXEC
-#define S_IWUSR S_IWRITE
-#define S_IRUSR S_IREAD
+#define S_IRWXU (S_IREAD | S_IWRITE | S_IEXEC)
+#define S_IXUSR S_IEXEC
+#define S_IWUSR S_IWRITE
+#define S_IRUSR S_IREAD
-#define _S_IEXEC S_IEXEC
-#define _S_IREAD S_IREAD
-#define _S_IWRITE S_IWRITE
+#define _S_IEXEC S_IEXEC
+#define _S_IREAD S_IREAD
+#define _S_IWRITE S_IWRITE
/*
* The structure manipulated and returned by stat and fstat.
*/
struct stat
{
- long st_dev; /* Equivalent to drive number 0=A 1=B ... */
- short st_ino; /* Always zero ? */
- short st_mode; /* See above constants */
- short st_nlink; /* Number of links. */
- int st_uid; /* User: Maybe significant on NT ? */
- short st_gid; /* Group: Ditto */
- short st_rdev; /* Seems useless (not even filled in) */
- long st_size; /* File size in bytes */
- time_t st_atime; /* Accessed date (always 00:00 hrs local
- * on FAT) */
- time_t st_mtime; /* Modified time */
- time_t st_ctime; /* Creation time */
+#ifdef _MSVCRT_LIB_
+ long st_dev; /* Equivalent to drive number 0=A 1=B ... */
+#else
+ short st_dev; /* Equivalent to drive number 0=A 1=B ... */
+ short st_padding; /* Pad structure to equal msvcrt version req */
+#endif
+ short st_ino; /* Always zero ? */
+ short st_mode; /* See above constants */
+ short st_nlink; /* Number of links. */
+ int st_uid; /* User: Maybe significant on NT ? */
+ short st_gid; /* Group: Ditto */
+ short st_rdev; /* Seems useless (not even filled in) */
+ long st_size; /* File size in bytes */
+ time_t st_atime; /* Accessed date (always 00:00 hrs local on FAT) */
+ time_t st_mtime; /* Modified time */
+ time_t st_ctime; /* Creation time */
};
+
struct _stati64
{
- short st_dev; /* Equivalent to drive number 0=A 1=B ... */
- short st_ino; /* Always zero ? */
- short st_mode; /* See above constants */
- short st_nlink; /* Number of links. */
- int st_uid; /* User: Maybe significant on NT ? */
- short st_gid; /* Group: Ditto */
- short st_rdev; /* Seems useless (not even filled in) */
- __int64 st_size; /* File size in bytes */
- time_t st_atime; /* Accessed date (always 00:00 hrs local
- * on FAT) */
- time_t st_mtime; /* Modified time */
- time_t st_ctime; /* Creation time */
+ short st_dev; /* Equivalent to drive number 0=A 1=B ... */
+ short st_ino; /* Always zero ? */
+ short st_mode; /* See above constants */
+ short st_nlink; /* Number of links. */
+ int st_uid; /* User: Maybe significant on NT ? */
+ short st_gid; /* Group: Ditto */
+ short st_rdev; /* Seems useless (not even filled in) */
+ __int64 st_size; /* File size in bytes */
+ time_t st_atime; /* Accessed date (always 00:00 hrs local on FAT) */
+ time_t st_mtime; /* Modified time */
+ time_t st_ctime; /* Creation time */
};
-int _fstat (int nFileNo, struct stat* pstat);
-__int64 _fstati64 (int nFileNo, struct _stati64* pstat);
-int _stat (const char* szPath, struct stat* pstat);
-__int64 _stati64 (const char* szPath, struct _stati64* pstat);
-int _wstat (const wchar_t* szPath, struct stat* pstat);
-__int64 _wstati64 (const wchar_t* szPath, struct _stati64* pstat);
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int _fstat(int, struct stat*);
+int _stat(const char*, struct stat*);
+
+__int64 _fstati64(int nFileNo, struct _stati64* pstat);
+__int64 _stati64(const char* szPath, struct _stati64* pstat);
+int _wstat(const wchar_t* szPath, struct stat* pstat);
+__int64 _wstati64(const wchar_t* szPath, struct _stati64* pstat);
+
-#ifndef _NO_OLDNAMES
+#ifndef _NO_OLDNAMES
-#define fstat(nFileNo, pstat) _fstat(nFileNo, pstat)
-#define stat(szPath,pstat) _stat(szPath,pstat)
+#define fstat(nFileNo, pstat) _fstat(nFileNo, pstat)
+#define stat(szPath,pstat) _stat(szPath,pstat)
-#endif /* Not _NO_OLDNAMES */
+#endif /* Not _NO_OLDNAMES */
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
-#endif /* Not _STAT_H_ */
+#endif /* Not _STAT_H_ */
-#endif /* Not __STRICT_ANSI__ */
+#endif /* Not __STRICT_ANSI__ */