Moved makelib
[repair.git] / Repair / RepairInterpreter / teststruct
1 structure Block {
2      reserved byte[d.s.blocksize];
3 }
4
5 structure Disk {
6      Block  b[d.s.NumberofBlocks];
7      label b[literal(0)]: Superblock s;
8      label b[literal(1)]: Groupblock g;
9 }
10
11 structure Superblock subtype of Block {
12      int FreeBlockCount;
13      int FreeInodeCount;
14      int NumberofBlocks;
15      int NumberofInodes;
16      int RootDirectoryInode;
17      int blocksize;
18 }
19
20 structure Groupblock subtype of Block {
21      int BlockBitmapBlock;
22      int InodeBitmapBlock;
23      int InodeTableBlock; 
24      int GroupFreeBlockCount;
25      int GroupFreeInodeCount;
26 }
27
28 structure InodeTable subtype of Block {
29      Inode itable[d.s.NumberofInodes];
30 }
31
32 structure InodeBitmap subtype of Block {
33      bit inodebitmap[d.s.NumberofInodes];
34 }
35
36 structure BlockBitmap subtype of Block {
37      bit blockbitmap[d.s.NumberofBlocks];
38 }
39
40 structure Inode {
41      int filesize;
42      int Blockptr[literal(12)];
43      int referencecount;
44 }
45
46 structure DirectoryBlock subtype of Block {
47      DirectoryEntry de[d.s.blocksize/literal(128)];
48 }
49
50 structure DirectoryEntry {
51      byte name[literal(124)];
52      int inodenumber;
53 }