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 / dd.h < prev    next >
Text File  |  1995-09-18  |  3KB  |  126 lines

  1. #define    MAGIC1        "DDAR"
  2. #define    MAGIC2        "\253\315\000\124"
  3.  
  4. /* Initial header */
  5. #define ARCHHDRCRC     76
  6. #define ARCHHDRSIZE     78
  7.  
  8. /* File headers */
  9. #define D_MAGIC          0
  10. #define D_FILL1          4
  11. #define D_FNAME          8
  12. #define D_ISDIR         72
  13. #define D_ENDDIR     73
  14. #define D_DATALENGTH     74
  15. #define D_RSRCLENGTH     78
  16. #define D_CTIME         82
  17. #define D_MTIME         86
  18. #define D_FTYPE         90
  19. #define D_CREATOR     94
  20. #define D_FNDRFLAGS     98
  21. #define D_FILL2        100
  22. #define D_DATACRC    118
  23. #define D_RSRCCRC    120
  24. #define D_HDRCRC    122
  25. #define FILEHDRSIZE    124
  26.  
  27. /* Compressed file header */
  28. #define    C_MAGIC         0
  29. #define    C_DATALENGTH     4
  30. #define    C_DATACLENGTH     8
  31. #define    C_RSRCLENGTH    12
  32. #define    C_RSRCCLENGTH    16
  33. #define    C_DATAMETHOD    20
  34. #define    C_RSRCMETHOD    21
  35. #define    C_INFO1        22
  36. #define    C_MTIME        24
  37. #define    C_CTIME        28
  38. #define    C_FTYPE        32
  39. #define    C_CREATOR    36
  40. #define    C_FNDRFLAGS    40
  41. #define    C_FILL1        42
  42. #define    C_DATACRC    48
  43. #define    C_RSRCCRC    50
  44. #define    C_INFO2        52
  45. #define    C_DATAINFO    54
  46. #define    C_RSRCINFO    56
  47. #define    C_FILL2        58
  48. #define C_DATACRC2    78
  49. #define C_RSRCCRC2    80
  50. #define    C_HDRCRC    82
  51. #define    CFILEHDRSIZE    84
  52.  
  53. typedef long OSType;
  54.  
  55. typedef struct fileHdr {        /* 124 bytes */
  56.     unsigned char    magic[4];    /* "DDAR" */
  57.     unsigned char    fill1[4];    /* ??? */
  58.     unsigned char    fName[64];    /* a STR63 */
  59.     unsigned char    isdir;        /* starts a directory? */
  60.     unsigned char    enddir;        /* terminates a directory? */
  61.     unsigned long    dataLength;    /* lengths */
  62.     unsigned long    rsrcLength;
  63.     unsigned long    creationDate;
  64.     unsigned long    modDate;
  65.     OSType    fType;            /* file type */
  66.     OSType    fCreator;        /* er... */
  67.     unsigned short FndrFlags;    /* copy of Finder flags.  For our
  68.                         purposes, we can clear:
  69.                         busy,onDesk */
  70.     unsigned char    fill2[18];    /* ??? */
  71.     unsigned short    datacrc;    /* checksum */
  72.     unsigned short    rsrccrc;
  73.     unsigned short    hdrcrc;        /* true crc */
  74. };
  75.  
  76. typedef struct fileCHdr {        /* 84 bytes */
  77.     unsigned char    magic[4];    /* "\253\315\000\124" */
  78.     unsigned long    dataLength;    /* lengths */
  79.     unsigned long    dataCLength;
  80.     unsigned long    rsrcLength;
  81.     unsigned long    rsrcCLength;
  82.     unsigned char    datamethod;    /* compression method used */
  83.     unsigned char    rsrcmethod;
  84.     unsigned char    info1;        /* flags ??? */
  85.     unsigned char    fill3;
  86.     unsigned long    modDate;
  87.     unsigned long    creationDate;
  88.     OSType    fType;            /* file type */
  89.     OSType    fCreator;        /* er... */
  90.     unsigned short FndrFlags;    /* copy of Finder flags.  For our
  91.                         purposes, we can clear:
  92.                         busy,onDesk */
  93.     unsigned char    fill1[6];    /* ??? */
  94.     unsigned short    datacrc;    /* checksum */
  95.     unsigned short    rsrccrc;
  96.     unsigned char    info2;        /* flags ??? */
  97.     unsigned char    fill4;
  98.     unsigned short    datainfo;    /* ??? */
  99.     unsigned short    rsrcinfo;    /* ??? */
  100.     unsigned char    fill2[20];    /* ??? */
  101.     unsigned short    datacrc2;    /* other checksum */
  102.     unsigned short    rsrccrc2;
  103.     unsigned short    hdrcrc;        /* true crc */
  104. };
  105.  
  106. #define    DD_FILE    0
  107. #define    DD_COPY    1
  108. #define    DD_SDIR    2
  109. #define    DD_EDIR    3
  110. #define    DD_IVAL    4
  111.  
  112. /* Methods used */
  113. #define    nocomp        0
  114. #define lzc        1
  115. #define method2        2
  116. #define rle        3
  117. #define huffman        4
  118. #define method5        5
  119. #define    method6        6
  120. #define lzss        7
  121. #define    cpt_compat    8
  122. #define    method9        9
  123.  
  124. #define    ESC        0x144    /* Repeat packing escape */
  125.  
  126.