diff options
Diffstat (limited to 'src/ddhardrescue.c')
-rwxr-xr-x | src/ddhardrescue.c | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/src/ddhardrescue.c b/src/ddhardrescue.c index 56cc5bf..a99b9d8 100755 --- a/src/ddhardrescue.c +++ b/src/ddhardrescue.c @@ -6,30 +6,53 @@ #include "recover.h" int end=0; +unsigned long c=0; void sigHookAbrt() { end=1; } int main() { - char *src, *dst, *ddOpts; - address_t beginSector, endSector; - int depth; + char *src, *dst, *ddOpts, *dump; + address_t beginSector, endSector, blockSize; + int /*depth,*/i; slices_t *slices; + slice_t *curr, *toFree; //TODO Parse args src="/dev/sdb"; dst="./test.img"; ddOpts=""; beginSector=0; - endSector=100; - depth=10; - + endSector=19999; +// depth=1; +/* + endSector=1999999999; + depth=100000; +*/ //TODO signal... - slices=recover(src,dst,ddOpts,beginSector,endSector,depth); + slices=recover(src,dst,ddOpts,beginSector,endSector/*,depth*/); - //TODO final reporting + blockSize=0; + dump=slicesDump(slices, &blockSize, 1000, beginSector, endSector); + puts(dump); + free(dump); + printf("blockSize==%ld\n", blockSize); + printf("c==%ld\n", c); + printf("slices->count==%d\n", slices->count); + + curr=slices->first; + i=0; + while (curr!=NULL) { + i++; + toFree=curr; + curr=curr->next; + free(toFree); + } + free(slices); + + printf("i==%d\n", i); return 0; } |