home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / BC_DICE2.DMS / in.adf / INCLUDE / sys / stat.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-10  |  1.2 KB  |  67 lines

  1.  
  2. /*
  3.  * $VER: sys/stat.h 1.0 (17.4.93)
  4.  *
  5.  * (c)Copyright 1992 Obvious Implementations Corp, All Rights Reserved
  6.  */
  7.  
  8. #ifndef SYS_STAT_H
  9. #define SYS_STAT_H
  10.  
  11. #ifndef SYS_TYPES_H
  12. #include <sys/types.h>
  13. #endif
  14.  
  15. #ifndef LIBRARIES_DOS_H
  16. #include <libraries/dos.h>
  17. #endif
  18.  
  19. #define S_IFMT 0xF0000
  20. #define S_IFREG 0x10000
  21. #define S_IFDIR 0x20000
  22. #define S_IFLNK 0x30000
  23. #define S_IFCHR 0x40000
  24. #define S_IFBLK 0x50000
  25.  
  26. #define S_ISUID 0x08000
  27. #define S_ISGID 0x04000
  28. #define S_ISVTX 0x02000
  29.  
  30. #define S_IREAD 000400
  31. #define S_IWRITE 000200
  32. #define S_IEXEC 000100
  33.  
  34. struct stat {
  35.  long st_mode;
  36.  long st_size;
  37.  long st_blksize; 
  38.  long st_blocks;
  39.  long st_ctime;
  40.  long st_mtime;
  41.  long st_atime; 
  42.  long st_dev;
  43.  short st_rdev; 
  44.  long st_ino;
  45.  short st_uid; 
  46.  short st_gid; 
  47.  short st_nlink; 
  48. };
  49.  
  50. #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
  51. #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
  52. #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
  53.  
  54. extern int stat(const char *, struct stat *);
  55. extern int lstat(const char *, struct stat *);
  56. extern int fstat(int, struct stat *);
  57. extern int readlink(char *, char *, int);
  58.  
  59.  
  60.  
  61. #define makedev(maj,min) (((maj) << 8) | (min))
  62. #define major(rdev) (unsigned char)((rdev) >> 8)
  63. #define minor(rdev) (unsigned char)(rdev)
  64.  
  65. #endif
  66.  
  67.