Updated to vers 7.5
[cake.git] / tools / adflib / adf_str.h
blob1afeb759bfe08e15a830eca092d7f5ba7b577e12
1 #ifndef _ADF_STR_H
2 #define _ADF_STR_H 1
4 /*
5 * ADF Library. (C) 1997-1999 Laurent Clevy
7 * adf_str.h
9 * structures/constants definitions
12 #include<stdio.h>
14 #include"adf_defs.h"
15 #include"adf_blk.h"
16 #include"adf_err.h"
18 /* ----- VOLUME ----- */
20 struct Volume {
21 struct Device* dev;
23 SECTNUM firstBlock; /* first block of data area (from beginning of device) */
24 SECTNUM lastBlock; /* last block of data area (from beginning of device) */
25 SECTNUM rootBlock; /* root block (from firstBlock) */
27 char dosType; /* FFS/OFS, DIRCACHE, INTERNATIONAL */
28 BOOL bootCode;
29 BOOL readOnly;
30 int datablockSize; /* 488 or 512 */
31 int blockSize; /* 512 */
33 char *volName;
35 BOOL mounted;
37 long bitmapSize; /* in blocks */
38 SECTNUM *bitmapBlocks; /* bitmap blocks pointers */
39 struct bBitmapBlock **bitmapTable;
40 BOOL *bitmapBlocksChg;
42 SECTNUM curDirPtr;
46 struct Partition {
47 long startCyl;
48 long lenCyl;
49 char* volName;
50 int volType;
53 /* ----- DEVICES ----- */
55 #define DEVTYPE_FLOPDD 1
56 #define DEVTYPE_FLOPHD 2
57 #define DEVTYPE_HARDDISK 3
58 #define DEVTYPE_HARDFILE 4
60 struct Device {
61 int devType; /* see below */
62 BOOL readOnly;
63 long size; /* in bytes */
65 int nVol; /* partitions */
66 struct Volume** volList;
68 long cylinders; /* geometry */
69 long heads;
70 long sectors;
72 BOOL isNativeDev;
73 void *nativeDev;
77 /* ----- FILE ----- */
79 struct File {
80 struct Volume *volume;
82 struct bFileHeaderBlock* fileHdr;
83 void *currentData;
84 struct bFileExtBlock* currentExt;
86 long nDataBlock;
87 SECTNUM curDataPtr;
88 unsigned long pos;
90 int posInDataBlk;
91 int posInExtBlk;
92 BOOL eof, writeMode;
96 /* ----- ENTRY ---- */
98 struct Entry{
99 int type;
100 char* name;
101 SECTNUM sector;
102 SECTNUM real;
103 SECTNUM parent;
104 char* comment;
105 unsigned long size;
106 long access;
107 int year, month, days;
108 int hour, mins, secs;
111 struct CacheEntry{
112 long header, size, protect;
113 short days, mins, ticks;
114 signed char type;
115 char nLen, cLen;
116 char name[MAXNAMELEN+1], comm[MAXCMMTLEN+1];
117 // char *name, *comm;
124 struct DateTime{
125 int year,mon,day,hour,min,sec;
128 /* ----- ENVIRONMENT ----- */
130 #define PR_VFCT 1
131 #define PR_WFCT 2
132 #define PR_EFCT 3
133 #define PR_NOTFCT 4
134 #define PR_USEDIRC 5
135 #define PR_USE_NOTFCT 6
136 #define PR_PROGBAR 7
137 #define PR_USE_PROGBAR 8
138 #define PR_RWACCESS 9
139 #define PR_USE_RWACCESS 10
141 struct Env{
142 void (*vFct)(char*); /* verbose callback function */
143 void (*wFct)(char*); /* warning callback function */
144 void (*eFct)(char*); /* error callback function */
146 void (*notifyFct)(SECTNUM, int);
147 BOOL useNotify;
149 void (*rwhAccess)(SECTNUM,SECTNUM,BOOL);
150 BOOL useRWAccess;
152 void (*progressBar)(int);
153 BOOL useProgressBar;
155 BOOL useDirCache;
157 void *nativeFct;
162 struct List{ /* generic linked tree */
163 void *content;
164 struct List* subdir;
165 struct List* next;
168 struct GenBlock{
169 SECTNUM sect;
170 SECTNUM parent;
171 int type;
172 int secType;
173 char *name; /* if (type == 2 and (secType==2 or secType==-3)) */
176 struct FileBlocks{
177 SECTNUM header;
178 long nbExtens;
179 SECTNUM* extens;
180 long nbData;
181 SECTNUM* data;
184 struct bEntryBlock {
185 /*000*/ long type; /* T_HEADER == 2 */
186 /*004*/ long headerKey; /* current block number */
187 long r1[3];
188 /*014*/ unsigned long checkSum;
189 /*018*/ long hashTable[HT_SIZE];
190 long r2[2];
191 /*140*/ long access; /* bit0=del, 1=modif, 2=write, 3=read */
192 /*144*/ long byteSize;
193 /*148*/ char commLen;
194 /*149*/ char comment[MAXCMMTLEN+1];
195 char r3[91-(MAXCMMTLEN+1)];
196 /*1a4*/ long days;
197 /*1a8*/ long mins;
198 /*1ac*/ long ticks;
199 /*1b0*/ char nameLen;
200 /*1b1*/ char name[MAXNAMELEN+1];
201 long r4;
202 /*1d4*/ long realEntry;
203 /*1d8*/ long nextLink;
204 long r5[5];
205 /*1f0*/ long nextSameHash;
206 /*1f4*/ long parent;
207 /*1f8*/ long extension;
208 /*1fc*/ long secType;
212 #define ENV_DECLARATION struct Env adfEnv
215 #endif /* _ADF_STR_H */
216 /*##########################################################################*/