#ifndef GS_FILEDUMP_SEGMENT_H_
#define GS_FILEDUMP_SEGMENT_H_
using BlockLocationT = struct BlockLocationT {
unsigned int blockId;
unsigned int extentId;
unsigned int fileno;
bool isLevel1;
unsigned int level1Id;
unsigned int level0Id;
unsigned int extentOffset;
unsigned int blockOffset;
};
char *SliceFilename(char *filename, int sliceno);
template <typename T>
int ReadHeadPage(FILE *fp, unsigned int relfilenode, T *page, long int magic);
void ConvertBlockLocation(unsigned int blockId, BlockLocationT *blockLocation);
void DumpSegmentContent(SegmentHead *segmentHead, unsigned int blockStart, unsigned int blockEnd);
bool CopyFileChunkC(const char *srcPath, const char *destPath, long offset, long size);
void InitSegmentInfo(FILE *fp, FILE *fpToast);
#endif