home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_07 / MARK_WC2.LZH / INCLUDE / STAT.H < prev    next >
C/C++ Source or Header  |  1988-04-27  |  3KB  |  87 lines

  1. /*
  2.  * stat.h -- support stat() and fstat() system calls.
  3.  *
  4.  * Copyright (c) 1986-1987, Mark Williams Company, Chicago
  5.  * This file and its contents may not be copied or distributed
  6.  * without permission.
  7.  */
  8.  
  9. #ifndef STAT_H
  10. #define    STAT_H
  11. #include <time.h>
  12. /*
  13.  * Structure returned by stat and fstat system calls.
  14.  * NB: fstat cannot work, but it does return the times.
  15.  */
  16. struct stat {
  17.     short    st_dev;            /* Device */
  18.     short    st_ino;            /* Inode number */
  19.     short    st_mode;        /* Mode */
  20.     short    st_nlink;        /* Link count */
  21.     short    st_uid;            /* User id */
  22.     short    st_gid;            /* Group id */
  23.     short    st_rdev;        /* Real device */
  24.     long    st_size;        /* Size */
  25.     time_t    st_atime;        /* Access time */
  26.     time_t    st_mtime;        /* Modify time */
  27.     time_t    st_ctime;        /* Change time */
  28. };
  29.  
  30. /*
  31.  * Modes, a la GEM-DOS:
  32.  */
  33. #define S_IJRON    0x01            /* Read-only */
  34. #define S_IJHID    0x02            /* Hidden from search */
  35. #define S_IJSYS    0x04            /* System, hidden from search */
  36. #define S_IJVOL    0x08            /* Volume label in first 11 bytes */
  37. #define S_IJDIR    0x10            /* Directory */
  38. #define S_IJWAC    0x20            /* Written to and closed */
  39.  
  40. /*
  41.  * "DMA" buffer structure for Fsfirst() and Fsnext().
  42.  */
  43. typedef struct {
  44.     char    d_glob[12];    /* GEMDOS wildcard string from Fsfirst */
  45.     char    d_mask;        /* Attribute mask from Fsfirst */
  46.     char    d_dirent[4];    /* Offset into directory, MSB first */
  47.     char    d_dirid[4];    /* Pointer to directory structure in GEM mem */
  48.     char    d_fattr;    /* File attributes */
  49.     long    d_tandd;    /* Time and date words */
  50.     long    d_fsize;    /* File size */
  51.     char     d_fname[14];    /* File name */
  52. } DMABUFFER;
  53.  
  54. /*
  55.  * COHERENT compatibility.
  56.  */
  57. #define S_IFMT    (S_IJDIR|S_IJVOL)    /* Type */
  58. #define S_IFDIR    S_IJDIR            /* Directory */
  59. #define S_IFCHR    0xFFFF            /* Character special */
  60. #define S_IFBLK    0xFFFF            /* Block special */
  61. #define S_IFREG    0            /* Regular */
  62. #define S_IFMPC    0xFFFF            /* Multiplexed character special */
  63. #define S_IFMPB    0xFFFF            /* Multiplexed block special */
  64. #define    S_IFPIP    0xFFFF            /* Pipe */
  65. #define    S_ISUID    0            /* Set user id on execution */
  66. #define S_ISGID    0            /* Set group id on execution */
  67. #define    S_ISVTX    0            /* Save swapped text even after use */
  68. #define S_IREAD    0            /* Read permission, owner */
  69. #define S_IWRITE 0            /* Write permission, owner */
  70. #define S_IEXEC    0            /* Execute/search permission, owner */
  71.  
  72. /*
  73.  * Non-existent device.
  74.  */
  75. #define NODEV    (-1)
  76.  
  77. /*
  78.  * Functions:
  79.  */
  80. #define    major(dev)    ((dev>>8)&0377)
  81. #define minor(dev)    (dev&0377)
  82. #define makedev(m1, m2)    ((m1<<8)|m2)
  83.  
  84. #endif
  85.  
  86. /* End of stat.h */
  87.