2011-11-29 20:18:23 +00:00
|
|
|
#ifndef FILE_H
|
|
|
|
#define FILE_H
|
|
|
|
|
|
|
|
/* Max valid value of uiLen for contains_data */
|
|
|
|
#define MAX_DATA_LEN 4096
|
|
|
|
|
|
|
|
/* Checks if a file contains a data pattern of length uiLen at position
|
|
|
|
ulPositoin. The file pointer will change when calling this function! */
|
2011-12-01 16:22:00 +00:00
|
|
|
int contains_data(FILE *fp, size_t ulPosition,
|
|
|
|
const void *pData, size_t uiLen);
|
2011-11-29 20:18:23 +00:00
|
|
|
|
|
|
|
/* Writes a data pattern of length uiLen at position ulPositoin.
|
|
|
|
The file pointer will change when calling this function! */
|
2011-12-01 16:22:00 +00:00
|
|
|
int write_data(FILE *fp, size_t ulPosition,
|
|
|
|
const void *pData, size_t uiLen);
|
2011-11-29 20:18:23 +00:00
|
|
|
|
2011-12-06 02:23:28 +00:00
|
|
|
/* Writes nSectors of size SectorSize starting at sector StartSector */
|
2011-11-29 20:18:23 +00:00
|
|
|
int write_sectors(void *hDrive, size_t SectorSize,
|
|
|
|
size_t StartSector, size_t nSectors,
|
2011-12-06 02:23:28 +00:00
|
|
|
const void *pBuf);
|
2011-11-29 20:18:23 +00:00
|
|
|
|
2011-12-06 02:23:28 +00:00
|
|
|
/* Reads nSectors of size SectorSize starting at sector StartSector */
|
2011-11-29 20:18:23 +00:00
|
|
|
int read_sectors(void *hDrive, size_t SectorSize,
|
|
|
|
size_t StartSector, size_t nSectors,
|
2011-12-06 02:23:28 +00:00
|
|
|
void *pBuf);
|
2011-11-29 20:18:23 +00:00
|
|
|
|
|
|
|
#endif
|