This source file includes following definitions.
- swap_long
1 #ifndef AMIGAFFS_H
2 #define AMIGAFFS_H
3
4
5
6 #define GET_END_PTR(st,p,sz) ((st *)((char *)(p)+((sz)-sizeof(st))))
7
8 #define MIDBLOCK_LONGS(sz) ((sz - sizeof (struct dir_front) \
9 - sizeof (struct dir_end)) / 4)
10
11 static __inline__ unsigned long
12 swap_long (unsigned long x)
13 {
14 #ifdef __i386__
15 unsigned char *px;
16
17 px = (unsigned char *) &x;
18 return ( (px[3] << 0)
19 | (px[2] << 8)
20 | (px[1] << 16)
21 | (px[0] << 24));
22 #else
23 return x;
24 #endif
25 }
26
27 typedef unsigned long ULONG;
28 typedef unsigned short UWORD;
29 typedef unsigned char UBYTE;
30
31 typedef long LONG;
32 typedef short WORD;
33 typedef char BYTE;
34
35 struct DateStamp
36 {
37 ULONG ds_Days;
38 ULONG ds_Minute;
39 ULONG ds_Tick;
40 };
41
42 #define T_SHORT 2
43 #define T_LIST 16
44 #define T_DATA 8
45
46 #define ST_FILE -3
47 #define ST_USERDIR 2
48 #define ST_ROOT 1
49 #define ST_SOFTLINK 3
50 #define ST_LINKFILE -4
51 #define ST_LINKDIR 4
52
53 #define PROT_ARCHIVE (1<<4)
54 #define PROT_READ (1<<3)
55 #define PROT_WRITE (1<<2)
56 #define PROT_EXECUTE (1<<1)
57 #define PROT_DELETE (1<<0)
58
59 #define PROT_OTR_READ (1<<15)
60 #define PROT_OTR_WRITE (1<<14)
61 #define PROT_OTR_EXECUTE (1<<13)
62 #define PROT_OTR_DELETE (1<<12)
63
64 #define PROT_GRP_READ (1<<11)
65 #define PROT_GRP_WRITE (1<<10)
66 #define PROT_GRP_EXECUTE (1<<9)
67 #define PROT_GRP_DELETE (1<<8)
68
69 struct ffs_root_front
70 {
71 LONG primary_type;
72 ULONG spare1[2];
73 ULONG hash_size;
74 ULONG spare2;
75 ULONG checksum;
76 };
77
78 struct ffs_root_end
79 {
80 LONG bm_flag;
81 ULONG bm_keys[25];
82 ULONG bm_extend;
83 struct DateStamp dir_altered;
84 UBYTE disk_name[40];
85 struct DateStamp disk_altered;
86 struct DateStamp disk_made;
87 ULONG spare1[3];
88 LONG secondary_type;
89 };
90
91 struct dir_front
92 {
93 LONG primary_type;
94 ULONG own_key;
95 ULONG spare1[3];
96 ULONG checksum;
97 ULONG hash_table[0];
98 };
99
100 struct dir_end
101 {
102 ULONG spare1;
103 UWORD uid;
104 UWORD gid;
105 ULONG protect;
106 ULONG spare2;
107 UBYTE comment[92];
108 struct DateStamp created;
109 UBYTE dir_name[64];
110 ULONG hash_chain;
111 ULONG parent;
112 ULONG spare3;
113 LONG secondary_type;
114 };
115
116 struct file_front
117 {
118 LONG primary_type;
119 ULONG own_key;
120 ULONG block_count;
121 ULONG unknown1;
122 ULONG first_data;
123 ULONG checksum;
124 ULONG blocks[0];
125 };
126
127 struct file_end
128 {
129 ULONG spare1;
130 UWORD uid;
131 UWORD gid;
132 ULONG protect;
133 ULONG byte_size;
134 UBYTE comment[92];
135 struct DateStamp created;
136 UBYTE file_name[64];
137 ULONG hash_chain;
138 ULONG parent;
139 ULONG extension;
140 LONG secondary_type;
141 };
142
143 struct data_front
144 {
145 LONG primary_type;
146 ULONG header;
147 ULONG seq_num;
148 ULONG data_size;
149 ULONG next_data;
150 ULONG checksum;
151 };
152
153 struct symlink_front
154 {
155 LONG primary_type;
156 ULONG own_key;
157 LONG unused[3];
158 ULONG checksum;
159 UBYTE symname[0];
160 };
161
162 struct symlink_end
163 {
164 ULONG spare1;
165 UWORD uid;
166 UWORD gid;
167 ULONG protect;
168 ULONG spare2;
169 UBYTE comment[92];
170 struct DateStamp created;
171 UBYTE link_name[64];
172 ULONG hash_chain;
173 ULONG parent;
174 ULONG spare3;
175 LONG secondary_type;
176 };
177
178 struct hardlink_front
179 {
180 LONG primary_type;
181 ULONG own_key;
182 LONG unused[3];
183 ULONG checkksum;
184 };
185
186 struct hardlink_end
187 {
188 ULONG spare1;
189 UWORD uid;
190 UWORD gid;
191 ULONG protect;
192 ULONG spare2;
193 UBYTE comment[92];
194 struct DateStamp created;
195 UBYTE link_name[32];
196 ULONG spare3;
197 ULONG original;
198 ULONG link_chain;
199 ULONG spare4[5];
200 ULONG hash_chain;
201 ULONG parent;
202 ULONG spare5;
203 LONG secondary_type;
204 };
205
206 #endif