home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / macutils.lzh / MACUTILS / MACUNPACK / sit.h < prev    next >
Text File  |  1995-09-18  |  3KB  |  96 lines

  1. #define S_SIGNATURE    0
  2. #define S_NUMFILES     4
  3. #define S_ARCLENGTH    6
  4. #define S_SIGNATURE2  10
  5. #define    S_VERSION     14
  6. #define SITHDRSIZE    22
  7.  
  8. #define F_COMPRMETHOD    0
  9. #define F_COMPDMETHOD    1
  10. #define F_FNAME          2
  11. #define F_FTYPE         66
  12. #define F_CREATOR       70
  13. #define F_FNDRFLAGS     74
  14. #define F_CREATIONDATE  76
  15. #define F_MODDATE       80
  16. #define F_RSRCLENGTH    84
  17. #define F_DATALENGTH    88
  18. #define F_COMPRLENGTH   92
  19. #define F_COMPDLENGTH   96
  20. #define F_RSRCCRC      100
  21. #define F_DATACRC      102
  22. #define F_HDRCRC       110
  23. #define FILEHDRSIZE    112
  24.  
  25. typedef long OSType;
  26.  
  27. typedef struct sitHdr {            /* 22 bytes */
  28.     OSType    signature;        /* = 'SIT!' -- for verification */
  29.     unsigned short    numFiles;    /* number of files in archive */
  30.     unsigned long    arcLength;    /* length of entire archive incl.
  31.                         hdr. -- for verification */
  32.     OSType    signature2;        /* = 'rLau' -- for verification */
  33.     unsigned char    version;    /* version number */
  34.     char reserved[7];
  35. };
  36.  
  37. typedef struct fileHdr {        /* 112 bytes */
  38.     unsigned char    compRMethod;    /* rsrc fork compression method */
  39.     unsigned char    compDMethod;    /* data fork compression method */
  40.     unsigned char    fName[64];    /* a STR63 */
  41.     OSType    fType;            /* file type */
  42.     OSType    fCreator;        /* er... */
  43.     unsigned short FndrFlags;    /* copy of Finder flags.  For our
  44.                         purposes, we can clear:
  45.                         busy,onDesk */
  46.     unsigned long    creationDate;
  47.     unsigned long    modDate;    /* !restored-compat w/backup prgms */
  48.     unsigned long    rsrcLength;    /* decompressed lengths */
  49.     unsigned long    dataLength;
  50.     unsigned long    compRLength;    /* compressed lengths */
  51.     unsigned long    compDLength;
  52.     unsigned short rsrcCRC;        /* crc of rsrc fork */
  53.     unsigned short dataCRC;        /* crc of data fork */
  54.     char reserved[6];
  55.     unsigned short hdrCRC;        /* crc of file header */
  56. };
  57.  
  58.  
  59. /* file format is:
  60.     sitArchiveHdr
  61.         file1Hdr
  62.             file1RsrcFork
  63.             file1DataFork
  64.         file2Hdr
  65.             file2RsrcFork
  66.             file2DataFork
  67.         .
  68.         .
  69.         .
  70.         fileNHdr
  71.             fileNRsrcFork
  72.             fileNDataFork
  73. */
  74.  
  75.  
  76.  
  77. /* compression methods */
  78. #define nocomp    0    /* just read each byte and write it to archive */
  79. #define rle    1    /* RLE compression */
  80. #define lzc    2    /* LZC compression */
  81. #define huffman    3    /* Huffman compression */
  82. #define lzah    5    /* LZ with adaptive Huffman */
  83. #define fixhuf    6    /* Fixed Huffman table */
  84. #define mw    8    /* Miller-Wegman encoding */
  85. /* this bit says whether the file is protected or not */
  86. #define prot    16    /* password protected bit */
  87. /* rsrc & data compress are identical here: */
  88. #define sfolder    32    /* start of folder */
  89. #define efolder    33    /* end of folder */
  90. #define sknown    0x16f    /* known compression methods */
  91.  
  92. /* all other numbers are reserved */
  93.  
  94. #define    ESC    0x90    /* repeat packing escape */
  95.  
  96.