home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / online / source / c / compilers / Tickle-4.0.sit.hqx / Tickle-4.0 / src / tar.h < prev    next >
Text File  |  1993-11-18  |  5KB  |  202 lines

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