File: acestruc.h

package info (click to toggle)
unace 1.2b-12
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 408 kB
  • ctags: 420
  • sloc: ansic: 1,762; sh: 113; makefile: 93
file content (155 lines) | stat: -rw-r--r-- 3,692 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/* ------------------------------------------------------------------------ */
/*  ML - 01/2004: changed licence to GPL                                    */
/* ------------------------------------------------------------------------ */

#ifndef __acestruc_h
#define __acestruc_h

#include "declare.h"
#include "portable.h"

#define acesign_len           7
#define bytes_before_acesign  7
#define acever               10

struct tech
{
   UCHAR TYPE;
   UCHAR QUAL;
   USHORT PARM;
};

typedef struct tacehead
{
   USHORT HEAD_CRC;
   USHORT HEAD_SIZE;
   UCHAR  HEAD_TYPE;
   USHORT HEAD_FLAGS;
   ULONG  ADDSIZE;
   UCHAR  other[2048];

}  thead;

typedef struct tacemhead
{
   USHORT HEAD_CRC;
   USHORT HEAD_SIZE;
   UCHAR  HEAD_TYPE;
   USHORT HEAD_FLAGS;

   UCHAR  ACESIGN[acesign_len];
   UCHAR  VER_MOD;
   UCHAR  VER_CR;
   UCHAR  HOST_CR;
   UCHAR  VOL_NUM;
   ULONG  TIME_CR;
   USHORT RES1;
   USHORT RES2;
   ULONG  RES;
   UCHAR  AV_SIZE;
   UCHAR  AV[256];
   USHORT COMM_SIZE;
   UCHAR  COMM[2048];

}  tmhead;

#ifndef PATH_MAX
  #define PATH_MAX   512
#endif

typedef struct tacefhead
{
   USHORT HEAD_CRC;
   USHORT HEAD_SIZE;
   UCHAR  HEAD_TYPE;
   USHORT HEAD_FLAGS;

   ULONG  PSIZE;
   ULONG  SIZE;
   ULONG  FTIME;
   ULONG  ATTR;
   ULONG  CRC32;
   struct tech TECH;
   USHORT RESERVED;
   USHORT FNAME_SIZE;
   UCHAR  FNAME[PATH_MAX];
   USHORT COMM_SIZE;
   UCHAR  COMM[2048];

}  tfhead;

#define mhead    (*t_mhead)
#define fhead    (*t_fhead)
#define rhead    (*t_rhead)
#define tmpmhead (*t_tmpmhead)
#define tmpfhead (*t_tmpfhead)
#define tmprhead (*t_tmprhead)

#define mhead_size h_mhead_size(mhead)
#define fhead_size h_fhead_size(fhead)
#define rhead_size ((INT)&rhead.REC_CRC-(INT)&head.HEAD_TYPE+sizeof(rhead.REC_CRC))

#define h_mhead_size(phead) ((INT)mhead.AV-(INT)&head.HEAD_TYPE+        \
                    (phead).AV_SIZE+                                    \
                    ((phead).HEAD_FLAGS&ACE_COMM?                       \
                      sizeof((phead).COMM_SIZE)+H_MCOMM_SIZE(phead):0))


#define h_fhead_size(phead) ((INT)fhead.FNAME-(INT)&head.HEAD_TYPE+     \
                    (phead).FNAME_SIZE+                                 \
                    ((phead).HEAD_FLAGS&ACE_COMM?                       \
                      sizeof((phead).COMM_SIZE)+H_FCOMM_SIZE(phead):0))


//main-comment-definitions
#define H_MCOMM_SIZE(head) (BUF2WORD((UCHAR*)&(head).AV+(head).AV_SIZE))
#define MCOMM_SIZE         H_MCOMM_SIZE(mhead)
#define H_MCOMM(head)      ((UCHAR*)&(head).AV+(head).AV_SIZE+sizeof((head).COMM_SIZE))
#define MCOMM              H_MCOMM(mhead)


//file-comment-definitions
#define H_FCOMM_SIZE(head) (BUF2WORD((UCHAR*)&(head).FNAME+(head).FNAME_SIZE))
#define FCOMM_SIZE         H_FCOMM_SIZE(fhead)
#define H_FCOMM(head)      ((UCHAR*)&(head).FNAME+(head).FNAME_SIZE+sizeof((head).COMM_SIZE))
#define FCOMM              H_FCOMM(fhead)

//
#define calc_head_crc getcrc16(CRC_MASK, (CHAR*)&head.HEAD_TYPE, head.HEAD_SIZE)
#define GET_ADDSIZE   ((head.HEAD_FLAGS & ACE_ADDSIZE) ? head.ADDSIZE : 0)

//archive-header-flags
#define ACE_LIM256   1024
#define ACE_MULT_VOL 2048
#define ACE_AV       4096
#define ACE_RECOV    8192
#define ACE_LOCK    16384
#define ACE_SOLID   32768

//file-header-flags
#define ACE_ADDSIZE  1
#define ACE_PASSW    16384
#define ACE_SP_BEF   4096
#define ACE_SP_AFTER 8192
#define ACE_COMM     2

//block types
#define MAIN_BLK 0
#define FILE_BLK 1
#define REC_BLK  2

//known compression types
#define TYPE_STORE 0
#define TYPE_LZ1   1

//structure for archive handling
struct tadat
{
   INT   sol,
         vol,
         vol_num;
   ULONG time_cr;
};


#endif /* __acestruc_h */