malloc.h is deprecated and made my personal build fail.
[AROS.git] / tools / adflib / adf_str.h
blobdf2cf776e44854c85a80c9c200cde4337e9d6a82
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 SECTNUM lastBlock; /* last block of data area (from beginning of device) */
23 SECTNUM rootBlock; /* root block (from firstBlock) */
25 char dosType; /* FFS/OFS, DIRCACHE, INTERNATIONAL */
26 BOOL bootCode;
27 BOOL readOnly;
28 int datablockSize; /* 488 or 512 */
29 int blockSize; /* 512 */
31 char *volName;
33 BOOL mounted;
35 ULONG bitmapSize; /* in blocks */
36 SECTNUM *bitmapBlocks; /* bitmap blocks pointers */
37 struct bBitmapBlock **bitmapTable;
38 BOOL *bitmapBlocksChg;
40 SECTNUM curDirPtr;
44 struct Partition {
45 ULONG startCyl;
46 ULONG lenCyl;
47 char* volName;
48 UBYTE volType[4];
51 /* ----- DEVICES ----- */
53 #define DEVTYPE_FLOPDD 1
54 #define DEVTYPE_FLOPHD 2
55 #define DEVTYPE_HARDDISK 3
56 #define DEVTYPE_HARDFILE 4
58 struct Device {
59 int devType; /* see below */
60 BOOL readOnly;
61 ULONG size; /* in bytes */
63 int nVol; /* partitions */
64 struct Volume** volList;
66 ULONG cylinders; /* geometry */
67 ULONG heads;
68 ULONG sectors;
70 BOOL isNativeDev;
71 void *nativeDev;
75 /* ----- FILE ----- */
77 struct File {
78 struct Volume *volume;
80 struct bFileHeaderBlock* fileHdr;
81 void *currentData;
82 struct bFileExtBlock* currentExt;
84 ULONG nDataBlock;
85 SECTNUM curDataPtr;
86 ULONG pos;
88 int posInDataBlk;
89 int posInExtBlk;
90 BOOL eof, writeMode;
94 /* ----- ENTRY ---- */
96 struct Entry{
97 int type;
98 char* name;
99 SECTNUM sector;
100 SECTNUM real;
101 SECTNUM parent;
102 char* comment;
103 long size;
104 long access;
105 int year, month, days;
106 int hour, mins, secs;
109 struct CacheEntry{
110 long header, size, protect;
111 short days, mins, ticks;
112 signed char type;
113 char nLen, cLen;
114 char name[MAXNAMELEN+1], comm[MAXCMMTLEN+1];
115 // char *name, *comm;
122 struct DateTime{
123 int year,mon,day,hour,min,sec;
126 /* ----- ENVIRONMENT ----- */
128 #define PR_VFCT 1
129 #define PR_WFCT 2
130 #define PR_EFCT 3
131 #define PR_NOTFCT 4
132 #define PR_USEDIRC 5
133 #define PR_USE_NOTFCT 6
134 #define PR_PROGBAR 7
135 #define PR_USE_PROGBAR 8
136 #define PR_RWACCESS 9
137 #define PR_USE_RWACCESS 10
139 struct Env{
140 void (*vFct)(char*); /* verbose callback function */
141 void (*wFct)(char*); /* warning callback function */
142 void (*eFct)(char*); /* error callback function */
144 void (*notifyFct)(SECTNUM, int);
145 BOOL useNotify;
147 void (*rwhAccess)(SECTNUM,SECTNUM,BOOL);
148 BOOL useRWAccess;
150 void (*progressBar)(int);
151 BOOL useProgressBar;
153 BOOL useDirCache;
155 void *nativeFct;
160 struct List{ /* generic linked tree */
161 void *content;
162 struct List* subdir;
163 struct List* next;
166 struct GenBlock{
167 SECTNUM sect;
168 SECTNUM parent;
169 int type;
170 int secType;
171 char *name; /* if (type == 2 and (secType==2 or secType==-3)) */
174 struct FileBlocks{
175 SECTNUM header;
176 ULONG nbExtens;
177 SECTNUM* extens;
178 ULONG nbData;
179 SECTNUM* data;
182 struct bEntryBlock {
183 /*000*/ ULONG type; /* T_HEADER == 2 */
184 /*004*/ ULONG headerKey; /* current block number */
185 ULONG r1[3];
186 /*014*/ ULONG checkSum;
187 /*018*/ ULONG hashTable[HT_SIZE];
188 ULONG r2[2];
189 /*140*/ ULONG access; /* bit0=del, 1=modif, 2=write, 3=read */
190 /*144*/ ULONG byteSize;
191 /*148*/ UBYTE commLen;
192 /*149*/ TEXT comment[MAXCMMTLEN+1];
193 UBYTE r3[91-(MAXCMMTLEN+1)];
194 /*1a4*/ ULONG days;
195 /*1a8*/ ULONG mins;
196 /*1ac*/ ULONG ticks;
197 /*1b0*/ UBYTE nameLen;
198 /*1b1*/ TEXT name[MAXNAMELEN+1];
199 ULONG r4;
200 /*1d4*/ ULONG realEntry;
201 /*1d8*/ ULONG nextLink;
202 ULONG r5[5];
203 /*1f0*/ ULONG nextSameHash;
204 /*1f4*/ ULONG parent;
205 /*1f8*/ ULONG extension;
206 /*1fc*/ ULONG secType;
210 #define ENV_DECLARATION struct Env adfEnv
213 #endif /* _ADF_STR_H */
214 /*##########################################################################*/