diff options
Diffstat (limited to 'src/slices.h')
-rwxr-xr-x | src/slices.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/slices.h b/src/slices.h index 062c4f4..9f97246 100755 --- a/src/slices.h +++ b/src/slices.h @@ -4,8 +4,13 @@ #include <stdint.h> #include <stdlib.h> +/* IMPORTANT NOTES +Slice are inclusive intervals. Let say sliceNew(1,2,S_UNKNOWN,NULL) return a [1;2] interval, + so interval lenght is end-begin+1. Here, it is 2 sectors lenght slice. +*/ + typedef enum { S_UNKNOWN, S_RECOVERED, S_UNREADABLE } sliceStatus_t; -typedef uint32_t address_t; +typedef unsigned long int address_t; typedef struct _slice { uint32_t begin, end; @@ -19,11 +24,11 @@ typedef struct { } slices_t; slice_t *sliceNew(address_t begin, address_t end, sliceStatus_t status, slice_t *next); -int sliceSplit(slice_t *slice, address_t splitAt, sliceStatus_t statusBefore, sliceStatus_t statusAt, sliceStatus_t statusAfter); +int sliceSplit(slices_t *slices, slice_t *initialSlice, address_t splitAt, sliceStatus_t statusBefore, sliceStatus_t statusAt, sliceStatus_t statusAfter); slices_t *slicesNew(); void slicesAppend(slices_t *slices, slice_t *slice); slice_t *slicesFindLargest(slices_t *slices, sliceStatus_t status); -char *slicesDump(slices_t *slices, int charCount, address_t begin, address_t end); +char *slicesDump(slices_t *slices, address_t *blockSize, unsigned int charCount, address_t begin, address_t end); #endif /*SLICES_H*/ |