annotate pirollback/analyze.c @ 43:9f4469766c74

pirollback: tree walk implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sat, 06 Jul 2013 20:52:09 +0000
parents 15c2ac2c5c73
children 074237879eca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
42
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 #include <stdio.h>
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 #include <stdlib.h>
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 extern char *imgfile;
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 extern int last_inode;
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 main(argc, argv)
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 char **argv;
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 {
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 if (argc != 2) {
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 fprintf(stderr, "usage: %s ffs-image\n", argv[0]);
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 exit(1);
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 }
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 imgfile = argv[1];
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 read_img_file();
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 read_inodes();
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 printf("Last inode is #%x\n", last_inode);
43
9f4469766c74 pirollback: tree walk implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 42
diff changeset
18 walk_tree();
9f4469766c74 pirollback: tree walk implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 42
diff changeset
19 printf("Tree walk succeeded\n");
42
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 exit(0);
15c2ac2c5c73 pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 }