home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / clib / progs / utilslib / Sys / H / Stat < prev    next >
Encoding:
Text File  |  1991-10-20  |  1.9 KB  |  56 lines

  1. /* H.Stat: Header file for stat call */
  2.  
  3. #ifndef __sys_stat_h
  4. #define __sys_stat_h
  5.  
  6. #include <time.h>
  7.  
  8. /* ARM System time format */
  9.  
  10. #ifndef __TIME_h
  11. #define __TIME_h
  12. typedef struct
  13. {
  14.     unsigned char t[5];    /* Low byte first - ie. t[0] is low */
  15. }
  16. TIME;
  17. #endif
  18.  
  19. struct stat
  20. {
  21.         /* Unix equivalent fields */
  22.         unsigned short  st_mode;        /* mode bits */
  23.         short           st_nlink;       /* number of links to file */
  24.         short           st_uid;         /* user id of owner ( = 0 ) */
  25.         short           st_gid;         /* group id of owner ( = 0 ) */
  26.         unsigned int    st_size;        /* file size in characters */
  27.         time_t          st_mtime;       /* time file last written or created */
  28.         /* Arm file attribute details */
  29.         unsigned char   st_stamp;       /* is the file timestamped? */
  30.         unsigned int    st_load;        /* load address */
  31.         unsigned int    st_exec;        /* execution address */
  32.         unsigned short  st_type;        /* file type */
  33.         unsigned char   st_attribs;     /* file attributes */
  34.         TIME            st_time;        /* time stamp (Arm format) */
  35. };
  36.  
  37. /* Parts of st_mode field */
  38.  
  39. #define S_IFMT          0170000         /* type of file */
  40. #define   S_IFDIR       0040000         /* directory */
  41. #define   S_IFREG       0100000         /* regular */
  42. #define S_IREAD         0000400         /* read permission, owner */
  43. #define S_IWRITE        0000200         /* write permission, owner */
  44. #define S_IEXEC         0000100         /* execute permission, owner */
  45.  
  46. /* Parts of st_attribs field */
  47.  
  48. #define S_AREAD         0x01            /* Read access for user */
  49. #define S_AWRITE        0x02            /* Write access for user */
  50. #define S_ALOCK         0x08            /* File is locked */
  51.  
  52. extern int stat (char *name, struct stat *buf);
  53. extern int set_stat (char *name, struct stat *buf);
  54.  
  55. #endif
  56.