home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c045 / 2.ddi / INCLUDE / SYS / STAT.H$ / STAT.bin
Encoding:
Text File  |  1992-01-01  |  2.3 KB  |  116 lines

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