#ifndef SLICES_H #define SLICES_H #include #include typedef enum { S_UNKNOWN, S_RECOVERED, S_UNREADABLE } sliceStatus_t; typedef uint32_t address_t; typedef struct _slice { uint32_t begin, end; sliceStatus_t status; struct _slice *next; } slice_t; typedef struct { int count; slice_t *first, *last; } 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); 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); #endif /*SLICES_H*/