home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / C++-7 / DISK4 / INCLUDE / SYS / STAT.H$ / STAT
Encoding:
Text File  |  1991-12-11  |  2.1 KB  |  105 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. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18.  
  19. #if (_MSC_VER <= 600)
  20. #define __cdecl     _cdecl
  21. #define __far       _far
  22. #endif
  23.  
  24. #ifndef _TIME_T_DEFINED
  25. typedef unsigned long time_t;
  26. #define _TIME_T_DEFINED
  27. #endif
  28.  
  29. /* define structure for returning status information */
  30.  
  31. #ifndef _STAT_DEFINED
  32. #pragma pack(2)
  33.  
  34. struct _stat {
  35.     _dev_t st_dev;
  36.     _ino_t st_ino;
  37.     unsigned short st_mode;
  38.     short st_nlink;
  39.     short st_uid;
  40.     short st_gid;
  41.     _dev_t st_rdev;
  42.     _off_t st_size;
  43.     time_t st_atime;
  44.     time_t st_mtime;
  45.     time_t st_ctime;
  46.     };
  47.  
  48. #ifndef __STDC__
  49. /* Non-ANSI name for compatibility */
  50. struct stat {
  51.     _dev_t st_dev;
  52.     _ino_t st_ino;
  53.     unsigned short st_mode;
  54.     short st_nlink;
  55.     short st_uid;
  56.     short st_gid;
  57.     _dev_t st_rdev;
  58.     _off_t st_size;
  59.     time_t st_atime;
  60.     time_t st_mtime;
  61.     time_t st_ctime;
  62.     };
  63. #endif
  64.  
  65. #pragma pack()
  66. #define _STAT_DEFINED
  67. #endif
  68.  
  69. #define _S_IFMT     0170000     /* file type mask */
  70. #define _S_IFDIR    0040000     /* directory */
  71. #define _S_IFCHR    0020000     /* character special */
  72. #define _S_IFREG    0100000     /* regular */
  73. #define _S_IREAD    0000400     /* read permission, owner */
  74. #define _S_IWRITE    0000200     /* write permission, owner */
  75. #define _S_IEXEC    0000100     /* execute/search permission, owner */
  76.  
  77.  
  78. /* function prototypes */
  79.  
  80. int __cdecl _fstat(int, struct _stat *);
  81. int __cdecl _stat(const char *, struct _stat *);
  82.  
  83. #ifndef __STDC__
  84. /* Non-ANSI names for compatibility */
  85.  
  86. #define S_IFMT     _S_IFMT
  87. #define S_IFDIR  _S_IFDIR
  88. #define S_IFCHR  _S_IFCHR
  89. #define S_IFREG  _S_IFREG
  90. #define S_IREAD  _S_IREAD
  91. #define S_IWRITE _S_IWRITE
  92. #define S_IEXEC  _S_IEXEC
  93.  
  94. int __cdecl fstat(int, struct stat *);
  95. int __cdecl stat(const char *, struct stat *);
  96.  
  97. #endif    /* __STDC__ */
  98.  
  99. #ifdef __cplusplus
  100. }
  101. #endif
  102.  
  103. #define _INC_STAT
  104. #endif    /* _INC_STAT */
  105.