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.zoom < prev   
Text File  |  1995-09-18  |  3KB  |  102 lines

  1. Taken from the file plugins.h in the Zoom distribution.
  2.  
  3. /*
  4.  * The Zoom archive format is:
  5.  *
  6.  * (char) Magic1
  7.  * (char) Magic2 - or - (char) Magic2B
  8.  * (char) Magic3
  9.  * (char) Magic4
  10.  * 
  11.  * IF Magic2B was received THEN
  12.  *        (long) logicalEof /* For multi-file archives * /
  13.  * END IF
  14.  * 
  15.  * <EntryChain>
  16.  * 
  17.  * The format of <EntryChain> is a linked list of
  18.  * EntryInfo, where "next" points to the next logical address
  19.  * on disk. "next" as 0 means no more entries.
  20.  *
  21.  * For a directory, the "creator" field points to the
  22.  * first file/folder entry inside the directory.
  23.  *
  24.  * For a file, IF the "what" field is ZOOM_PLUGIN,
  25.  * the EntryInfo is followed by a length byte and that
  26.  * many characters naming the compression engine.
  27.  * Right after that (or right after the EntryInfo in the
  28.  * case of uncompressed files or default compressed files)
  29.  * follows the data fork compressed, followed by the
  30.  * resource fork compressed.
  31.  *
  32.  * Note that there is no "end of compressed data" marker;
  33.  * your compressor engine will have to figure that out by
  34.  * itself. You could for instance do an ftell before
  35.  * compressing; writing a (long)0 and then write your
  36.  * compressed data, seek back and write the actual length.
  37.  *
  38.  * Note that new entries always are added last in the file,
  39.  * so you need not worry about overrunning anything else.
  40.  */
  41.  
  42. /*
  43.  * The default compressor in Zoom is the same as used in
  44.  * "better" compression mode in ZOO 2.10. A Zoo extractor
  45.  * or convertor could parse the ZOO header format, and use
  46.  * the built-in engine for "lzh" compressed files.
  47.  *
  48.  * The simplest way to do this is to call SetEngine(-1) and
  49.  * call Encode / Decode. -1 is the default compressor, 0 is
  50.  * the null compressor (fork copy)
  51.  *
  52.  * Likewise, a UNIX zoom packer/unpacker could use the source
  53.  * for zoo 2.10 functions "lzh_encode" and "lzh_decode"
  54.  * (they're wrappers) for compression.
  55.  */
  56.  
  57. /*
  58.  * This "EntryInfo" is presently also a file header.
  59.  * Some fields may be non-obvious. Don't use these.
  60.  * For instance, "comment" is currently unsupported,
  61.  * and should be left as 0
  62.  */
  63. #ifndef ZOOM_TYPES
  64. typedef enum zoomWhatType {
  65.     ZOOM_NOTHING , ZOOM_FILE , ZOOM_UCFILE , ZOOM_DIR , ZOOM_PLUGIN
  66. } ZoomWhatType ;
  67. #define ZOOM_TYPES
  68. #endif
  69.  
  70. /*
  71.  * Remember to fill in "hlen" correctly as well. When reading a header,
  72.  * Zoom checks with this field to see if it should skip some more data
  73.  * or seek back a little, so as to make future field additions at the
  74.  * end possible. You should NOT add your own fields to this structure.
  75.  */
  76. typedef struct EntryInfo {
  77.  
  78.     /* "what" is a ZoomWhatType */
  79.     char            what ;            /* Negative if deleted */
  80.     unsigned char    hlen ;            /* Header length */
  81.     unsigned short    boolFlags ;        /* Boolean flags */
  82.     long            next ;            /* Next entry */
  83.  
  84.     long            complen ;        /* Length of compressed data */
  85.     long            compdata ;        /* Data fork portion of compressed data - for dirs, number of entries */
  86.     long            uclen ;            /* Length of uncompressed entry */
  87.     long            ucdata ;        /* Data fork part of uncompressed */
  88.  
  89.     long            type ;            /* File type */
  90.     long            creator ;        /* File creator - for dir, offset of file */
  91.     long            mdate ;            /* Modification date */
  92.     long            comment ;        /* Comment offset */
  93.     short            flags ;            /* Macintosh file flags */
  94.  
  95.     short            dataCrc ;        /* Data fork crc */
  96.     short            resCrc ;        /* Resource fork crc */
  97.  
  98.     unsigned char    name [ 32 ] ;    /* File/Dir name */
  99.  
  100. } EntryInfo ;
  101.  
  102.