home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / program / d / elvis / CLib / Sys / h / Stat < prev    next >
Encoding:
Text File  |  1989-04-25  |  1.8 KB  |  54 lines

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