2 * ADF Library. (C) 1997-1999 Laurent Clevy
6 * general blocks structures
15 #define LOGICAL_BLOCK_SIZE 512
17 /* ----- FILE SYSTEM ----- */
21 #define FSMASK_DIRCACHE 4
23 #define isFFS(c) ((c)&FSMASK_FFS)
24 #define isOFS(c) (!((c)&FSMASK_FFS))
25 #define isINTL(c) ((c)&FSMASK_INTL)
26 #define isDIRCACHE(c) ((c)&FSMASK_DIRCACHE)
29 /* ----- ENTRIES ----- */
31 /* access constants */
33 #define ACCMASK_D (1<<0)
34 #define ACCMASK_E (1<<1)
35 #define ACCMASK_W (1<<2)
36 #define ACCMASK_R (1<<3)
37 #define ACCMASK_A (1<<4)
38 #define ACCMASK_P (1<<5)
39 #define ACCMASK_S (1<<6)
40 #define ACCMASK_H (1<<7)
42 #define hasD(c) ((c)&ACCMASK_D)
43 #define hasE(c) ((c)&ACCMASK_E)
44 #define hasW(c) ((c)&ACCMASK_W)
45 #define hasR(c) ((c)&ACCMASK_R)
46 #define hasA(c) ((c)&ACCMASK_A)
47 #define hasP(c) ((c)&ACCMASK_P)
48 #define hasS(c) ((c)&ACCMASK_S)
49 #define hasH(c) ((c)&ACCMASK_H)
52 /* ----- BLOCKS ----- */
61 #define MAX_DATABLK 72
67 /* block primary and secondary types */
81 /*--- blocks structures --- */
85 /*000*/ TEXT dosType
[4];
86 /*004*/ ULONG checkSum
;
87 /*008*/ ULONG rootBlock
;
88 /*00c*/ UCHAR data
[500+512];
96 /*00c*/ ULONG hashTableSize
;
98 /*014*/ ULONG checkSum
;
99 /*018*/ ULONG hashTable
[HT_SIZE
]; /* hash table */
100 /*138*/ ULONG bmFlag
; /* bitmap flag, -1 means VALID */
101 /*13c*/ ULONG bmPages
[BM_SIZE
];
103 /*1a4*/ ULONG cDays
; /* creation date FFS and OFS */
105 /*1ac*/ ULONG cTicks
;
106 /*1b0*/ UBYTE nameLen
;
107 /*1b1*/ TEXT diskName
[MAXNAMELEN
+1];
109 /*1d8*/ ULONG days
; /* last access : days after 1 jan 1978 */
110 /*1dc*/ ULONG mins
; /* hours and minutes in minutes */
111 /*1e0*/ ULONG ticks
; /* 1/50 seconds */
112 /*1e4*/ ULONG coDays
; /* creation date OFS */
113 /*1e8*/ ULONG coMins
;
114 /*1ec*/ ULONG coTicks
;
115 ULONG nextSameHash
; /* == 0 */
116 ULONG parent
; /* == 0 */
117 /*1f8*/ ULONG extension
; /* FFS: first directory cache block */
118 /*1fc*/ ULONG secType
; /* == 1 */
122 struct bFileHeaderBlock
{
123 /*000*/ ULONG type
; /* == 2 */
124 /*004*/ ULONG headerKey
; /* current block number */
125 /*008*/ ULONG highSeq
; /* number of data block in this hdr block */
126 /*00c*/ ULONG dataSize
; /* == 0 */
127 /*010*/ ULONG firstData
;
128 /*014*/ ULONG checkSum
;
129 /*018*/ ULONG dataBlocks
[MAX_DATABLK
];
132 /*140*/ ULONG access
; /* bit0=del, 1=modif, 2=write, 3=read */
133 /*144*/ ULONG byteSize
;
134 /*148*/ UBYTE commLen
;
135 /*149*/ TEXT comment
[MAXCMMTLEN
+1];
136 UBYTE r3
[91-(MAXCMMTLEN
+1)];
140 /*1b0*/ UBYTE nameLen
;
141 /*1b1*/ TEXT fileName
[MAXNAMELEN
+1];
143 /*1d4*/ ULONG real
; /* unused == 0 */
144 /*1d8*/ ULONG nextLink
; /* link chain */
146 /*1f0*/ ULONG nextSameHash
; /* next entry with sane hash */
147 /*1f4*/ ULONG parent
; /* parent directory */
148 /*1f8*/ ULONG extension
; /* pointer to extension block */
149 /*1fc*/ ULONG secType
; /* == -3 */
153 /*--- file header extension block structure ---*/
155 struct bFileExtBlock
{
156 /*000*/ ULONG type
; /* == 0x10 */
157 /*004*/ ULONG headerKey
;
158 /*008*/ ULONG highSeq
;
159 /*00c*/ ULONG dataSize
; /* == 0 */
160 /*010*/ ULONG firstData
; /* == 0 */
161 /*014*/ ULONG checkSum
;
162 /*018*/ ULONG dataBlocks
[MAX_DATABLK
];
164 ULONG info
; /* == 0 */
165 ULONG nextSameHash
; /* == 0 */
166 /*1f4*/ ULONG parent
; /* header block */
167 /*1f8*/ ULONG extension
; /* next header extension block */
168 /*1fc*/ ULONG secType
; /* -3 */
174 /*000*/ ULONG type
; /* == 2 */
175 /*004*/ ULONG headerKey
;
176 /*008*/ ULONG highSeq
; /* == 0 */
177 /*00c*/ ULONG hashTableSize
; /* == 0 */
179 /*014*/ ULONG checkSum
;
180 /*018*/ ULONG hashTable
[HT_SIZE
]; /* hash table */
182 /*140*/ ULONG access
;
184 /*148*/ UBYTE commLen
;
185 /*149*/ TEXT comment
[MAXCMMTLEN
+1];
186 TEXT r5
[91-(MAXCMMTLEN
+1)];
187 /*1a4*/ ULONG days
; /* last access */
190 /*1b0*/ UBYTE nameLen
;
191 /*1b1*/ TEXT dirName
[MAXNAMELEN
+1];
193 /*1d4*/ ULONG real
; /* ==0 */
194 /*1d8*/ ULONG nextLink
; /* link list */
196 /*1f0*/ ULONG nextSameHash
;
197 /*1f4*/ ULONG parent
;
198 /*1f8*/ ULONG extension
; /* FFS : first directory cache */
199 /*1fc*/ ULONG secType
; /* == 2 */
204 struct bOFSDataBlock
{
205 /*000*/ ULONG type
; /* == 8 */
206 /*004*/ ULONG headerKey
; /* pointer to file_hdr block */
207 /*008*/ ULONG seqNum
; /* file data block number */
208 /*00c*/ ULONG dataSize
; /* <= 0x1e8 */
209 /*010*/ ULONG nextData
; /* next data block */
210 /*014*/ ULONG checkSum
;
211 /*018*/ UCHAR data
[488];
217 struct bBitmapBlock
{
218 /*000*/ ULONG checkSum
;
219 /*004*/ ULONG map
[127];
223 struct bBitmapExtBlock
{
224 /*000*/ ULONG bmPages
[127];
225 /*1fc*/ ULONG nextBlock
;
230 /*000*/ ULONG type
; /* == 2 */
231 /*004*/ ULONG headerKey
; /* self pointer */
233 /*014*/ ULONG checkSum
;
234 /*018*/ TEXT realName
[64];
236 /*1a4*/ ULONG days
; /* last access */
239 /*1b0*/ UBYTE nameLen
;
240 /*1b1*/ TEXT name
[MAXNAMELEN
+1];
242 /*1d4*/ ULONG realEntry
;
243 /*1d8*/ ULONG nextLink
;
245 /*1f0*/ ULONG nextSameHash
;
246 /*1f4*/ ULONG parent
;
248 /*1fc*/ ULONG secType
; /* == -4, 4, 3 */
253 /*--- directory cache block structure ---*/
255 struct bDirCacheBlock
{
256 /*000*/ ULONG type
; /* == 33 */
257 /*004*/ ULONG headerKey
;
258 /*008*/ ULONG parent
;
259 /*00c*/ ULONG recordsNb
;
260 /*010*/ ULONG nextDirC
;
261 /*014*/ ULONG checkSum
;
262 /*018*/ UBYTE records
[488];
266 #endif /* ADF_BLK_H */
267 /*##########################################################################*/