perform later so that we can get valid values from kernelbase
[AROS.git] / tools / adflib / adf_str.h
blob76d22d8b733d62c9500311b4c3ee7a111dee978d
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"adf_defs.h"
13 #include"adf_blk.h"
14 #include"adf_err.h"
16 /* ----- VOLUME ----- */
18 struct Volume {
19 struct Device* dev;
21 SECTNUM firstBlock; /* first block of data area (from beginning of device) */
22 ULONG totalBlocks; /* number of blocks in data area */
23 SECTNUM rootBlock; /* root block (from firstBlock) */
24 ULONG reservedBlocks; /* reserved blocks */
26 char dosType; /* FFS/OFS, DIRCACHE, INTERNATIONAL */
27 BOOL bootCode;
28 BOOL readOnly;
29 int datablockSize; /* 488 or 512 */
30 int blockSize; /* 512 */
32 char *volName;
34 BOOL mounted;
36 ULONG bitmapSize; /* in blocks */
37 SECTNUM *bitmapBlocks; /* bitmap blocks pointers */
38 struct bBitmapBlock **bitmapTable;
39 BOOL *bitmapBlocksChg;
40 SECTNUM lastAlloc; /* last allocated block */
42 SECTNUM curDirPtr;
46 struct Partition {
47 ULONG startCyl;
48 ULONG lenCyl;
49 char* volName;
50 UBYTE volType[4];
51 int reserved;
52 BOOL nomount;
53 BOOL bootable;
56 /* ----- DEVICES ----- */
58 #define DEVTYPE_FLOPDD 1
59 #define DEVTYPE_FLOPHD 2
60 #define DEVTYPE_HARDDISK 3
61 #define DEVTYPE_HARDFILE 4
63 struct Device {
64 int devType; /* see below */
65 BOOL readOnly;
66 UQUAD size; /* in bytes */
68 int nVol; /* partitions */
69 struct Volume** volList;
71 ULONG cylinders; /* geometry */
72 ULONG heads;
73 ULONG sectors;
75 BOOL isNativeDev;
76 void *nativeDev;
80 /* ----- FILE ----- */
82 struct File {
83 struct Volume *volume;
85 struct bFileHeaderBlock* fileHdr;
86 void *currentData;
87 struct bFileExtBlock* currentExt;
89 ULONG nDataBlock;
90 SECTNUM curDataPtr;
91 ULONG pos;
93 int posInDataBlk;
94 int posInExtBlk;
95 BOOL eof, writeMode;
99 /* ----- ENTRY ---- */
101 struct Entry{
102 int type;
103 char* name;
104 SECTNUM sector;
105 SECTNUM real;
106 SECTNUM parent;
107 char* comment;
108 long size;
109 long access;
110 int year, month, days;
111 int hour, mins, secs;
114 struct CacheEntry{
115 long header, size, protect;
116 short days, mins, ticks;
117 signed char type;
118 char nLen, cLen;
119 char name[MAXNAMELEN+1], comm[MAXCMMTLEN+1];
120 // char *name, *comm;
127 struct DateTime{
128 int year,mon,day,hour,min,sec;
131 /* ----- ENVIRONMENT ----- */
133 #define PR_VFCT 1
134 #define PR_WFCT 2
135 #define PR_EFCT 3
136 #define PR_NOTFCT 4
137 #define PR_USEDIRC 5
138 #define PR_USE_NOTFCT 6
139 #define PR_PROGBAR 7
140 #define PR_USE_PROGBAR 8
141 #define PR_RWACCESS 9
142 #define PR_USE_RWACCESS 10
144 struct Env{
145 void (*vFct)(char*); /* verbose callback function */
146 void (*wFct)(char*); /* warning callback function */
147 void (*eFct)(char*); /* error callback function */
149 void (*notifyFct)(SECTNUM, int);
150 BOOL useNotify;
152 void (*rwhAccess)(SECTNUM,SECTNUM,BOOL);
153 BOOL useRWAccess;
155 void (*progressBar)(int);
156 BOOL useProgressBar;
158 BOOL useDirCache;
160 void *nativeFct;
165 struct List{ /* generic linked tree */
166 void *content;
167 struct List* subdir;
168 struct List* next;
171 struct GenBlock{
172 SECTNUM sect;
173 SECTNUM parent;
174 int type;
175 int secType;
176 char *name; /* if (type == 2 and (secType==2 or secType==-3)) */
179 struct FileBlocks{
180 SECTNUM header;
181 ULONG nbExtens;
182 SECTNUM* extens;
183 ULONG nbData;
184 SECTNUM* data;
187 struct bEntryBlock {
188 /*000*/ ULONG type; /* T_HEADER == 2 */
189 /*004*/ ULONG headerKey; /* current block number */
190 ULONG r1[3];
191 /*014*/ ULONG checkSum;
192 /*018*/ ULONG hashTable[HT_SIZE];
193 ULONG r2[2];
194 /*140*/ ULONG access; /* bit0=del, 1=modif, 2=write, 3=read */
195 /*144*/ ULONG byteSize;
196 /*148*/ UBYTE commLen;
197 /*149*/ TEXT comment[MAXCMMTLEN+1];
198 UBYTE r3[91-(MAXCMMTLEN+1)];
199 /*1a4*/ ULONG days;
200 /*1a8*/ ULONG mins;
201 /*1ac*/ ULONG ticks;
202 /*1b0*/ UBYTE nameLen;
203 /*1b1*/ TEXT name[MAXNAMELEN+1];
204 ULONG r4;
205 /*1d4*/ ULONG realEntry;
206 /*1d8*/ ULONG nextLink;
207 ULONG r5[5];
208 /*1f0*/ ULONG nextSameHash;
209 /*1f4*/ ULONG parent;
210 /*1f8*/ ULONG extension;
211 /*1fc*/ ULONG secType;
215 #define ENV_DECLARATION struct Env adfEnv
218 #endif /* _ADF_STR_H */
219 /*##########################################################################*/