home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / macutils.lzh / MACUTILS / DOC / README.unpit < prev    next >
Text File  |  1995-09-18  |  2KB  |  63 lines

  1. /*
  2.  *    @(#)unpit.c    1.2    (CWI)    87/11/05
  3.  */
  4.  
  5. /*
  6.  
  7.         unpit - Macintosh PackIt file unpacker
  8.  
  9.         Version 2, for PackIt II
  10.  
  11. This program will unpack a Macintosh PackIt file into separate files.  The
  12. data fork of a PackIt file contains both the data and resource forks of the
  13. packed files.  The program will unpack each Mac file into separate .data,
  14. .rsrc., and .info files that can be downloaded to a Mac using macput.
  15.  
  16. The program syntax is much like macput/macget:
  17.  
  18.     unpit [-rdu] packit-file.data
  19.  
  20. The  -r and -d flags will cause only the resource and data forks to be
  21. written.  The -u flag will cause only the data fork to be written and
  22. to have carriage return characters changed to Unix newline characters.
  23.  
  24. Some of the program is borrowed from the macput.c/macget.c programs.
  25.  
  26.     Author: Allan G. Weber, (Weber%Brand@USC-ECL)        
  27.     Date:   September 30, 1985
  28.     Revised: January 24, 1986 - added CRC checking
  29.          March 25, 1986 - support compressed mode of PackIt II,
  30.                   check for illegal Unix file names
  31.  
  32. */
  33.  
  34. /* There is some confusion as to what to do with the "inited" flag in the
  35.    finder info bytes that are in the header of each file in the packit file.
  36.    If this flag bit is copied to the .info file, it seems to confuse
  37.    MacTerminal into placing the file icons in the upper left corner of the
  38.    window on top of each other.  Setting this bit to zero in the .info file
  39.    seems to fix that problem but may cause others.  I haven't been able to
  40.    find any .info files that have this flag set so making it zero may be OK.
  41.    Anyway, MacTerminal seems to set the flag when it create the file on the
  42.    Mac.  The "#define INITED_BUG" can be used to try both settings.  */
  43.  
  44. /*
  45. Format of a Packit file:
  46.  
  47. Repeat the following sequence for each file in the Packit file:
  48.  
  49.     4 byte identifier ("PMag" = not compressed, "Pma4" = compressed)
  50.     variable length compression data (if compressed file)
  51.     92 byte header (see struct pit_header below) *
  52.     2 bytes CRC number *
  53.     data fork (length from header) *
  54.     resource fork (length from header) *
  55.     2 bytes CRC number *
  56.  
  57. Last file is followed by the 4 byte Ascii string, "Pend", and then the EOF.
  58.  
  59. * these are in compressed form if compression is on for the file
  60.  
  61. */
  62.  
  63.