home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / unix / sit_shar / sit.h < prev    next >
C/C++ Source or Header  |  1991-01-30  |  2KB  |  73 lines

  1.  
  2. /* sit.h: contains declarations for SIT headers */
  3.  
  4. typedef struct sitHdr {        /* 22 bytes */
  5.     u_char    sig1[4];        /* = 'SIT!' -- for verification */
  6.     u_char    numFiles[2];    /* number of files in archive */
  7.     u_char    arcLen[4];        /* length of entire archive incl. */
  8.     u_char    sig2[4];        /* = 'rLau' -- for verification */
  9.     u_char    version;        /* version number */
  10.     char reserved[7];
  11. };
  12.  
  13. typedef struct fileHdr {    /* 112 bytes */
  14.     u_char    compRMethod;        /* rsrc fork compression method */
  15.     u_char    compDMethod;        /* data fork compression method */
  16.     u_char    fName[64];            /* a STR63 */
  17.     char    fType[4];            /* file type */
  18.     char    fCreator[4];        /* creator... */
  19.     char    FndrFlags[2];        /* copy of Finder flags */
  20.     char    cDate[4];            /* creation date */
  21.     char    mDate[4];            /* !restored-compat w/backup prgms */
  22.     u_char    rLen[4];            /* decom rsrc length */
  23.     u_char    dLen[4];            /* decomp data length */
  24.     u_char    cRLen[4];            /* compressed lengths */
  25.     u_char    cDLen[4];
  26.     u_char    rsrcCRC[2];            /* crc of rsrc fork */
  27.     u_char    dataCRC[2];            /* crc of data fork */
  28.     char    reserved[6];
  29.     u_char    hdrCRC[2];            /* crc of file header */
  30. };
  31.  
  32. /* file format is:
  33.     sitArchiveHdr
  34.         file1Hdr
  35.             file1RsrcFork
  36.             file1DataFork
  37.         file2Hdr
  38.             file2RsrcFork
  39.             file2DataFork
  40.         .
  41.         .
  42.         .
  43.         fileNHdr
  44.             fileNRsrcFork
  45.             fileNDataFork
  46. */
  47.  
  48.  
  49.  
  50. /* compression methods */
  51. #define noComp    0    /* just read each byte and write it to archive */
  52. #define repComp 1    /* RLE compression */
  53. #define lpzComp 2    /* LZW compression */
  54. #define hufComp 3    /* Huffman compression */
  55.  
  56. /* all other numbers are reserved */
  57.  
  58. /*
  59.  * the format of a *.info file made by xbin
  60.  */
  61. struct infohdr {
  62.     char    res0;
  63.     char    name[64];    /*  2 (a str 63) */
  64.     char    type[4];    /* 65 */
  65.     char    creator[4];    /* 69 */
  66.     char    flag[2];    /* 73 */
  67.     char    res1[8];
  68.     char    dlen[4];    /* 83 */
  69.     char    rlen[4];    /* 87 */
  70.     char    ctime[4];    /* 91 */
  71.     char    mtime[4];    /* 95 */
  72. };
  73.