home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 20.ddi / INCLUDE / SYS / STAT.H_ / STAT.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  2.2 KB  |  109 lines

  1. /***
  2. *sys\stat.h - defines structure used by stat() and fstat()
  3. *
  4. *   Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *   This file defines the structure used by the stat() and fstat()
  8. *   routines.
  9. *   [System V]
  10. *
  11. ****/
  12.  
  13. #ifndef _INC_STAT
  14.  
  15. #ifndef _INC_TYPES
  16. #include <sys/types.h>
  17. #endif 
  18.  
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif 
  22.  
  23. #if (_MSC_VER <= 600)
  24. #define __cdecl     _cdecl
  25. #define __far       _far
  26. #endif 
  27.  
  28. #ifndef _TIME_T_DEFINED
  29. typedef long    time_t;
  30. #define _TIME_T_DEFINED
  31. #endif 
  32.  
  33. /* define structure for returning status information */
  34.  
  35. #ifndef _STAT_DEFINED
  36. #pragma pack(2)
  37.  
  38. struct _stat {
  39.     _dev_t st_dev;
  40.     _ino_t st_ino;
  41.     unsigned short st_mode;
  42.     short st_nlink;
  43.     short st_uid;
  44.     short st_gid;
  45.     _dev_t st_rdev;
  46.     _off_t st_size;
  47.     time_t st_atime;
  48.     time_t st_mtime;
  49.     time_t st_ctime;
  50.     };
  51.  
  52. #ifndef __STDC__
  53. /* Non-ANSI name for compatibility */
  54. struct stat {
  55.     _dev_t st_dev;
  56.     _ino_t st_ino;
  57.     unsigned short st_mode;
  58.     short st_nlink;
  59.     short st_uid;
  60.     short st_gid;
  61.     _dev_t st_rdev;
  62.     _off_t st_size;
  63.     time_t st_atime;
  64.     time_t st_mtime;
  65.     time_t st_ctime;
  66.     };
  67. #endif 
  68.  
  69. #pragma pack()
  70. #define _STAT_DEFINED
  71. #endif 
  72.  
  73. #define _S_IFMT     0170000     /* file type mask */
  74. #define _S_IFDIR    0040000     /* directory */
  75. #define _S_IFCHR    0020000     /* character special */
  76. #define _S_IFREG    0100000     /* regular */
  77. #define _S_IREAD    0000400     /* read permission, owner */
  78. #define _S_IWRITE   0000200     /* write permission, owner */
  79. #define _S_IEXEC    0000100     /* execute/search permission, owner */
  80.  
  81.  
  82. /* function prototypes */
  83.  
  84. int __cdecl _fstat(int, struct _stat *);
  85. int __cdecl _stat(const char *, struct _stat *);
  86.  
  87. #ifndef __STDC__
  88. /* Non-ANSI names for compatibility */
  89.  
  90. #define S_IFMT   _S_IFMT
  91. #define S_IFDIR  _S_IFDIR
  92. #define S_IFCHR  _S_IFCHR
  93. #define S_IFREG  _S_IFREG
  94. #define S_IREAD  _S_IREAD
  95. #define S_IWRITE _S_IWRITE
  96. #define S_IEXEC  _S_IEXEC
  97.  
  98. int __cdecl fstat(int, struct stat *);
  99. int __cdecl stat(const char *, struct stat *);
  100.  
  101. #endif 
  102.  
  103. #ifdef __cplusplus
  104. }
  105. #endif 
  106.  
  107. #define _INC_STAT
  108. #endif 
  109.