home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Amiga / Workbench / Archivers / PPCDeTar.lha / PPCDeTar / DeTar.h < prev    next >
C/C++ Source or Header  |  1998-02-07  |  2KB  |  68 lines

  1. /*
  2.  *      MSDOS TAR Extractor
  3.  */
  4.  
  5.  /* last changed: 28.3.95 */
  6.  
  7. #define RECORDSIZE      512
  8. #define NAMSIZ          100
  9. #define TUNMLEN         32
  10. #define TGNMLEN         32
  11.  
  12. /*
  13.  *      Header block on tape.
  14.  *
  15.  *      no byte swapping
  16.  */
  17.  
  18. union record {
  19.         char    charptr[RECORDSIZE];
  20.         struct  {
  21.                 char    name[NAMSIZ];
  22.                 char    mode[8];
  23.                 char    uid[8];
  24.                 char    gid[8];
  25.                 char    size[12];
  26.                 char    mtime[12];
  27.                 char    chksum[8];
  28.                 char    linkflag;
  29.                 char    linkname[NAMSIZ];
  30.                 char    magic[8];
  31.                 char    uname[TUNMLEN];
  32.                 char    gname[TGNMLEN];
  33.                 char    devmajor[8];
  34.                 char    devminor[8];
  35.         } header;
  36. };
  37.  
  38. #define CHKBLANKS       "        "      /* Checksum: 8 blanks, no null */
  39. #define TMAGIC          "ustar  "       /* Majic: 7 bytes and a null */
  40.  
  41. /* The linkflag defines the type of file */
  42.  
  43. #define LF_OLDNORMAL    '\0'            /* Normal disk file, Unix compat */
  44. #define LF_NORMAL       '0'             /* Normal disk file */
  45. #define LF_LINK         '1'             /* Link to previously dumped file */
  46. #define LF_SYMLINK      '2'             /* Symbolic link */
  47. #define LF_CHR          '3'             /* Character special file */
  48. #define LF_BLK          '4'             /* Block special file */
  49. #define LF_DIR          '5'             /* Directory */
  50. #define LF_FIFO         '6'             /* FIFO special file */
  51. #define LF_CONTIG       '7'             /* Contiguous file */
  52.  
  53. /*
  54.  *      Unix Stat Header (K&R)
  55.  *
  56.  */
  57.  
  58. #include <stat.h>
  59.  
  60. #define S_ISUID         0004000  /* SAS/C misses these */
  61. #define S_ISGID         0002000
  62. #define S_ISVTX         0001000
  63.  
  64. #ifdef NEEDSTRING
  65. extern char *strrchr(const char *, int);
  66. extern char *strcat(char *, const char *);
  67. #endif /* NEEDSTRING */
  68.