home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / source / tarsrc.sit / tar.h < prev    next >
Text File  |  1989-09-14  |  4KB  |  174 lines

  1. #ifndef USEDUMP
  2.  
  3. #include <Types.h>
  4. #include <Quickdraw.h>
  5. #include <Fonts.h>
  6. #include <OSEvents.h>
  7. #include <Controls.h>
  8. #include <Windows.h>
  9. #include <Menus.h>
  10. #include <TextEdit.h>
  11. #include <Dialogs.h>
  12. #include <Desk.h>
  13. #include <ToolUtils.h>
  14. #include <OSUtils.h>
  15. #include <Scrap.h>
  16. #include <Packages.h>
  17. #include <Lists.h>
  18. #include <Files.h>
  19. #include <Memory.h>
  20. #include <Printing.h>
  21. #include <Errors.h>
  22. #include <SetJmp.h>
  23.  
  24. #ifndef EOF
  25. #define EOF    (-1L)
  26. #endif
  27.  
  28. #define DIRECTORY(pb)    (((pb).hfileInfo.ioFlAttrib & ioDirMask) == ioDirMask)
  29.  
  30. /*
  31.  * Character definitions
  32.  */
  33. #define ENTER    0x03
  34. #define BS    0x08
  35. #define TAB    0x09
  36. #define LF    0x0a
  37. #define    RETURN    0x0d
  38.  
  39. /*
  40.  * Difference between Mac and Unix times
  41.  */
  42. #define TIMEDIFF    0x7c25b080
  43.  
  44. /*
  45.  * Global Variables
  46.  */
  47. extern Boolean    autoPage;
  48. extern Boolean    cvtNl;
  49. extern Boolean    doneFlag;
  50. extern Boolean    doPrint;
  51. extern Boolean    ignorez;
  52. extern Boolean    menusOK;
  53. extern Boolean    pOpen;
  54.  
  55. extern char    fdCreator[];
  56. extern char    fdType[];
  57. extern char    header[];
  58.  
  59. extern jmp_buf    errJmp;
  60.  
  61. extern THPrint    prRecHdl;
  62.  
  63. /*
  64.  * Standard File and GetDir saved outputs
  65.  */
  66. extern char    *arName;
  67. extern short    arVRefNum;
  68. extern long    dirDirID;
  69. extern short    dirVRefNum;
  70.  
  71. /*
  72.  * External routines
  73.  */
  74. extern Boolean    GetDir();
  75. extern Boolean    MenuInit();
  76. extern Boolean    PrSetup();
  77. extern Boolean    WindInit();
  78.  
  79. /*
  80.  * Remainder taken from:
  81.  * Header file for public domain tar (tape archive) program.
  82.  *
  83.  * @(#)tar.h 1.20 86/10/29    Public Domain.
  84.  *
  85.  * Created 25 August 1985 by John Gilmore, ihnp4!hoptoad!gnu.
  86.  */
  87.  
  88. /*
  89.  * Header block on tape.
  90.  *
  91.  * I'm going to use traditional DP naming conventions here.
  92.  * A "block" is a big chunk of stuff that we do I/O on.
  93.  * A "record" is a piece of info that we care about.
  94.  * Typically many "record"s fit into a "block".
  95.  */
  96. #define    RECORDSIZE    512
  97. #define    NAMSIZ    100
  98. #define    TUNMLEN    32
  99. #define    TGNMLEN    32
  100.  
  101. union record {
  102.     char        charptr[RECORDSIZE];
  103.     struct header {
  104.         char    name[NAMSIZ];
  105.         char    mode[8];
  106.         char    uid[8];
  107.         char    gid[8];
  108.         char    size[12];
  109.         char    mtime[12];
  110.         char    chksum[8];
  111.         char    linkflag;
  112.         char    linkname[NAMSIZ];
  113.         char    magic[8];
  114.         char    uname[TUNMLEN];
  115.         char    gname[TGNMLEN];
  116.         char    devmajor[8];
  117.         char    devminor[8];
  118.     } header;
  119. };
  120.  
  121. /* The checksum field is filled with this while the checksum is computed. */
  122. #define    CHKBLANKS    "        "    /* 8 blanks, no null */
  123.  
  124. /* The magic field is filled with this if uname and gname are valid. */
  125. #define    TMAGIC        "ustar  "    /* 7 chars and a null */
  126.  
  127. /* The linkflag defines the type of file */
  128. #define    LF_OLDNORMAL    '\0'        /* Normal disk file, Unix compat */
  129. #define    LF_NORMAL    '0'        /* Normal disk file */
  130. #define    LF_LINK        '1'        /* Link to previously dumped file */
  131. #define    LF_SYMLINK    '2'        /* Symbolic link */
  132. #define    LF_CHR        '3'        /* Character special file */
  133. #define    LF_BLK        '4'        /* Block special file */
  134. #define    LF_DIR        '5'        /* Directory */
  135. #define    LF_FIFO        '6'        /* FIFO special file */
  136. #define    LF_CONTIG    '7'        /* Contiguous file */
  137. /* Further link types may be defined later. */
  138.  
  139. /*
  140.  * Global variables
  141.  */
  142. extern int        blocking;    /* Size of each block, in records */
  143. extern int        blockSize;    /* Size of each block, in bytes */
  144. extern Boolean        reblock;
  145. extern Boolean        oldArch;
  146.  
  147. /*
  148.  * We now default to Unix Standard format rather than 4.2BSD tar format.
  149.  * The code can actually produce all three:
  150.  *    standard    ANSI standard
  151.  *    oldarch        V7
  152.  *    neither        4.2BSD
  153.  * but we don't bother, since 4.2BSD can read ANSI standard format anyway.
  154.  * The only advantage to the "neither" option is that we can cmp(1) our
  155.  * output to the output of 4.2BSD tar, for debugging.
  156.  */
  157. #define    standard    (!oldArch)
  158.  
  159. extern short    archive;    /* File descriptor for archive file */
  160.  
  161. /*
  162.  * Declarations of functions available to the world.
  163.  */
  164. union record    *FindRec();
  165. void        UseRec();
  166. union record    *EndOfRecs();
  167. Boolean        OpenArchive();
  168.  
  169. #ifdef MAKEDUMP
  170. #pragma dump "hdrs.dmp"
  171. #endif
  172. #else
  173. #pragma load "hdrs.dmp"
  174. #endif