home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / slfinsta.zip / include / acestruc.h next >
C/C++ Source or Header  |  2000-03-26  |  4KB  |  154 lines

  1. /* $Id: acestruc.h,v 1.1 2000/03/27 04:53:04 ktk Exp $ */
  2.  
  3. #ifndef __acestruc_h
  4. #define __acestruc_h
  5.  
  6. #include "declare.h"
  7. #include "portable.h"
  8.  
  9. #define acesign_len           7
  10. #define bytes_before_acesign  7
  11. #define acever               10
  12.  
  13. struct tech
  14. {
  15.    UCHAR TYPE;
  16.    UCHAR QUAL;
  17.    USHORT PARM;
  18. };
  19.  
  20. typedef struct tacehead
  21. {
  22.    USHORT HEAD_CRC;
  23.    USHORT HEAD_SIZE;
  24.    UCHAR  HEAD_TYPE;
  25.    USHORT HEAD_FLAGS;
  26.    ULONG  ADDSIZE;
  27.    UCHAR  other[2048];
  28.  
  29. }  thead;
  30.  
  31. typedef struct tacemhead
  32. {
  33.    USHORT HEAD_CRC;
  34.    USHORT HEAD_SIZE;
  35.    UCHAR  HEAD_TYPE;
  36.    USHORT HEAD_FLAGS;
  37.  
  38.    UCHAR  ACESIGN[acesign_len];
  39.    UCHAR  VER_MOD;
  40.    UCHAR  VER_CR;
  41.    UCHAR  HOST_CR;
  42.    UCHAR  VOL_NUM;
  43.    ULONG  TIME_CR;
  44.    USHORT RES1;
  45.    USHORT RES2;
  46.    ULONG  RES;
  47.    UCHAR  AV_SIZE;
  48.    UCHAR  AV[256];
  49.    USHORT COMM_SIZE;
  50.    UCHAR  COMM[2048];
  51.  
  52. }  tmhead;
  53.  
  54. #ifndef PATH_MAX
  55.   #define PATH_MAX   512
  56. #endif
  57.  
  58. typedef struct tacefhead
  59. {
  60.    USHORT HEAD_CRC;
  61.    USHORT HEAD_SIZE;
  62.    UCHAR  HEAD_TYPE;
  63.    USHORT HEAD_FLAGS;
  64.  
  65.    ULONG  PSIZE;
  66.    ULONG  SIZE;
  67.    ULONG  FTIME;
  68.    ULONG  ATTR;
  69.    ULONG  CRC32;
  70.    struct tech TECH;
  71.    USHORT RESERVED;
  72.    USHORT FNAME_SIZE;
  73.    UCHAR  FNAME[PATH_MAX];
  74.    USHORT COMM_SIZE;
  75.    UCHAR  COMM[2048];
  76.  
  77. }  tfhead;
  78.  
  79. #define mhead    (*t_mhead)
  80. #define fhead    (*t_fhead)
  81. #define rhead    (*t_rhead)
  82. #define tmpmhead (*t_tmpmhead)
  83. #define tmpfhead (*t_tmpfhead)
  84. #define tmprhead (*t_tmprhead)
  85.  
  86. #define mhead_size h_mhead_size(mhead)
  87. #define fhead_size h_fhead_size(fhead)
  88. #define rhead_size ((INT)&rhead.REC_CRC-(INT)&head.HEAD_TYPE+sizeof(rhead.REC_CRC))
  89.  
  90. #define h_mhead_size(phead) ((INT)mhead.AV-(INT)&head.HEAD_TYPE+        \
  91.                     (phead).AV_SIZE+                                    \
  92.                     ((phead).HEAD_FLAGS&ACE_COMM?                       \
  93.                       sizeof((phead).COMM_SIZE)+H_MCOMM_SIZE(phead):0))
  94.  
  95.  
  96. #define h_fhead_size(phead) ((INT)fhead.FNAME-(INT)&head.HEAD_TYPE+     \
  97.                     (phead).FNAME_SIZE+                                 \
  98.                     ((phead).HEAD_FLAGS&ACE_COMM?                       \
  99.                       sizeof((phead).COMM_SIZE)+H_FCOMM_SIZE(phead):0))
  100.  
  101.  
  102. //main-comment-definitions
  103. #define H_MCOMM_SIZE(head) (BUF2WORD((UCHAR*)&(head).AV+(head).AV_SIZE))
  104. #define MCOMM_SIZE         H_MCOMM_SIZE(mhead)
  105. #define H_MCOMM(head)      ((UCHAR*)&(head).AV+(head).AV_SIZE+sizeof((head).COMM_SIZE))
  106. #define MCOMM              H_MCOMM(mhead)
  107.  
  108.  
  109. //file-comment-definitions
  110. #define H_FCOMM_SIZE(head) (BUF2WORD((UCHAR*)&(head).FNAME+(head).FNAME_SIZE))
  111. #define FCOMM_SIZE         H_FCOMM_SIZE(fhead)
  112. #define H_FCOMM(head)      ((UCHAR*)&(head).FNAME+(head).FNAME_SIZE+sizeof((head).COMM_SIZE))
  113. #define FCOMM              H_FCOMM(fhead)
  114.  
  115. //
  116. #define calc_head_crc getcrc16(CRC_MASK, (CHAR*)&head.HEAD_TYPE, head.HEAD_SIZE)
  117. #define GET_ADDSIZE   ((head.HEAD_FLAGS & ACE_ADDSIZE) ? head.ADDSIZE : 0)
  118.  
  119. //archive-header-flags
  120. #define ACE_LIM256   1024
  121. #define ACE_MULT_VOL 2048
  122. #define ACE_AV       4096
  123. #define ACE_RECOV    8192
  124. #define ACE_LOCK    16384
  125. #define ACE_SOLID   32768
  126.  
  127. //file-header-flags
  128. #define ACE_ADDSIZE  1
  129. #define ACE_PASSW    16384
  130. #define ACE_SP_BEF   4096
  131. #define ACE_SP_AFTER 8192
  132. #define ACE_COMM     2
  133.  
  134. //block types
  135. #define MAIN_BLK 0
  136. #define FILE_BLK 1
  137. #define REC_BLK  2
  138.  
  139. //known compression types
  140. #define TYPE_STORE 0
  141. #define TYPE_LZW1  1
  142.  
  143. //structure for archive handling
  144. struct tadat
  145. {
  146.    INT   sol,
  147.          vol,
  148.          vol_num;
  149.    ULONG time_cr;
  150. };
  151.  
  152.  
  153. #endif /* __acestruc_h */
  154.