home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2001 January / VPR0101A.BIN / OLS / TAR32053 / tar32053.exe / SRC / TAR.H < prev    next >
C/C++ Source or Header  |  1999-05-23  |  2KB  |  85 lines

  1. #ifndef __TAR_H
  2. #define __TAR_H
  3.  
  4. #ifndef __DEFCONF_H
  5. #include "defconf.h"
  6. #endif
  7. /*
  8.  * tar header block definition
  9.  *
  10.  * From IEEE Std 1003.1-1988, pp.156
  11.  */
  12.  
  13.  
  14. #define    TMAGIC        "ustar"
  15. #define    TMAGLEN        6
  16.  
  17. #define    TOMAGIC        "ustar  "
  18. #define    TOMAGLEN    8
  19.  
  20. #define    TVERSION    "00"
  21. #define    TVERSLEN    2
  22.  
  23. #define    REGTYPE        '0'    /* Regular file */
  24. #define    AREGTYPE    '\0'    /* Regular file; old V7 format */
  25. #define    LNKTYPE        '1'    /* Link */
  26. #define    SYMTYPE        '2'    /* Symbolic link */
  27. #define    CHRTYPE        '3'    /* Character special */
  28. #define    BLKTYPE        '4'    /* Block special */
  29. #define    DIRTYPE        '5'    /* Directory */
  30. #define    FIFOTYPE    '6'    /* FIFO special */
  31. #define    CONTTYPE    '7'    /* Continguous file */
  32. #define LONGLINK    'L' /* Long name Link by tantan*/
  33.  
  34.  
  35. #define    MULTYPE        'M'    /* Added by GNUtar, not POSIX */
  36. #define    VOLTYPE        'V'    /* Added by GNUtar, not POSIX */
  37.  
  38.  
  39. #define    TSUID        04000    /* Set UID on execution */
  40. #define    TSGID        02000    /* Set GID on execution */
  41. #define    TSVTX        01000    /* Reserved */
  42.                 /* File permissions */
  43. #define    TUREAD        00400    /* read by owner */
  44. #define    TUWRITE        00200    /* write by owner */
  45. #define    TUEXEC        00100    /* execute/search by owner */
  46. #define    TGREAD        00040    /* read by group */
  47. #define    TGWRITE        00020    /* write by group */
  48. #define    TGEXEC        00010    /* execute/search by group */
  49. #define    TOREAD        00004    /* read by other */
  50. #define    TOWRITE        00002    /* write by other */
  51. #define    TOEXEC        00001    /* execute/search by other */
  52.  
  53.  
  54. #define    TBLOCK    512
  55. #define    NAMSIZ    100
  56.  
  57. typedef    union    hblock    {
  58.     char    dummy[TBLOCK];
  59.     struct    {
  60.         char    name[NAMSIZ];
  61.         char    mode[8];
  62.         char    uid[8];
  63.         char    gid[8];
  64.         char    size[12];
  65.         char    mtime[12];
  66.         char    chksum[8];
  67.         char    typeflag;
  68.         char    linkname[NAMSIZ];
  69.         char    magic[6];
  70.         char    version[2];
  71.         char    uname[32];
  72.         char    gname[32];
  73.         char    devmajor[8];
  74.         char    devminor[8];
  75.     /* Following fields were added by GNUtar */
  76.         char    atime[12];
  77.         char    ctime[12];
  78.         char    offset[12];
  79.     } dbuf;
  80. } HEADER;
  81.  
  82.  
  83.  
  84. #endif    /* __TAR_H */
  85.