comparison target-utils/pirexplore/ffs.c @ 101:7029fe8ae0bc

pirexplore: FFS find command implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 02 Sep 2013 00:33:54 +0000
parents
children
comparison
equal deleted inserted replaced
100:02ece4d8c755 101:7029fe8ae0bc
1 #include <sys/types.h>
2 #include "types.h"
3
4 void
5 cmd_find(argbulk)
6 char *argbulk;
7 {
8 char *argv[2];
9 int stat, cont;
10 u8 *start;
11 size_t size;
12
13 if (parse_args(argbulk, 1, 1, argv, 0) < 0)
14 return;
15 stat = mpffs_find_file(argv[0], &start, &size, &cont);
16 if (stat < 0)
17 return;
18 printf("chunk @%08X size %x\n", (u32)start, (u32)size);
19 while (cont) {
20 stat = mpffs_get_segment(cont, &start, &size, &cont);
21 if (stat < 0)
22 return;
23 printf("chunk @%08X size %x\n", (u32)start, (u32)size);
24 }
25 }