home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / gzip-1.2.4-src.lha / src / amiga / gzip-1.2.4 / primos / include / sysStat.h < prev    next >
C/C++ Source or Header  |  1993-05-26  |  2KB  |  93 lines

  1. /*
  2. ** sys/stat.h
  3. **
  4. ** Emulation of the Unix sys/stat.h header file for PRIMOS
  5. **
  6. ** Author: Peter Eriksson <pen@lysator.liu.se>
  7. */
  8.  
  9. #ifndef __SYS_STAT_H__
  10. #define __SYS_STAT_H__
  11.  
  12.  
  13. #include <sys/types.h>
  14.  
  15. struct    stat {
  16.         /* First some PRIMOS standard entries */
  17.     off_t    st_size;
  18.     time_t    st_mtime;
  19.     short    st_type;        /* Primos file type */
  20.     short    st_rwlock;      /* Primos read/write lock */
  21.  
  22.     /* Begin Unix compatibility - don't believe these entries! */
  23.     dev_t    st_dev;       
  24.     ino_t    st_ino;
  25.     mode_t    st_mode;
  26.     short    st_nlink;
  27.     uid_t    st_uid;
  28.     gid_t    st_gid;
  29.     dev_t    st_rdev;
  30.     time_t    st_atime;
  31.     time_t    st_ctime;
  32.     long    st_blksize;
  33.     long    st_blocks;
  34. };
  35.  
  36. #define    _IFMT        0170000    /* type of file */
  37. #define    _IFREG        0100000    /* regular */
  38. #define    _IFDIR        0040000    /* directory */
  39.  
  40. /* Some stupid programs check if these are defined and then
  41.    believe these are supported in the OS - not so in PRIMOS ... */
  42. #ifndef __50SERIES
  43. #  define _IFCHR    0020000
  44. #  define _IFBLK    0060000
  45. #  define _IFLNK    0120000
  46. #  define _IFSOCK    0140000
  47. #  define _IFIFO    0010000
  48. #endif
  49.  
  50. #define    S_ISUID        0004000
  51. #define    S_ISGID        0002000
  52. #define    S_ISVTX        0001000
  53. #define    S_IREAD        0000400
  54. #define    S_IWRITE     0000200
  55. #define    S_IEXEC        0000100
  56.  
  57. #define    S_ENFMT     0002000
  58.  
  59. #define    S_IFMT        _IFMT
  60. #define    S_IFREG        _IFREG
  61. #define    S_IFDIR        _IFDIR
  62. #ifndef __50SERIES
  63. #  define S_IFCHR    _IFCHR
  64. #  define S_IFBLK    _IFBLK
  65. #  define S_IFLNK    _IFLNK
  66. #  define S_IFSOCK    _IFSOCK
  67. #  define S_IFIFO    _IFIFO
  68. #endif
  69.  
  70. #define    S_IRWXU     0000700
  71. #define    S_IRUSR        0000400
  72. #define    S_IWUSR        0000200
  73. #define    S_IXUSR        0000100
  74. #define    S_IRWXG        0000070
  75. #define    S_IRGRP        0000040
  76. #define    S_IWGRP        0000020
  77. #define    S_IXGRP        0000010
  78. #define    S_IRWXO        0000007
  79. #define    S_IROTH        0000004
  80. #define    S_IWOTH        0000002
  81. #define    S_IXOTH        0000001
  82.  
  83. #define    S_ISREG(m)    (((m) & _IFMT) == _IFREG)
  84. #define    S_ISDIR(m)    (((m) & _IFMT) == _IFDIR)
  85. #ifndef __50SERIES
  86. #  define S_ISBLK(m)    (((m) & _IFMT) == _IFBLK)
  87. #  define S_ISCHR(m)    (((m) & _IFMT) == _IFCHR)
  88. #  define S_ISFIFO(m)    (((m) & _IFMT) == _IFIFO)
  89. #endif
  90.  
  91.  
  92. #endif
  93.