Defines | |
#define | GET_FAT16_FAT_SECTOR(DPTR, SECTOR) |
The following macros compute geometry for FAT16 filesystems. | |
#define | GET_FAT16_ROOT_SECTOR(DPTR, SECTOR) |
#define | GET_FAT16_CLUSTER_SECTOR(DPTR, CLUSTER, SECTOR) |
#define | GET_CLUSTER(ENTRY, RESULT) |
The following macros minipulate data for a directory entry. | |
#define | GET_FILESIZE(ENTRY, RESULT) |
#define | SET_FDATE(Y, M, D, DATEARRAY) |
#define | SET_FTIME(H, M, S, TIMEARRAY) |
#define | GET_FDATE(DATEARRAY, Y, M, D) |
#define | GET_FTIME(TIMEARRAY, H, M, S) |
#define GET_FAT16_FAT_SECTOR | ( | DPTR, | |||
SECTOR | ) |
{ \ (SECTOR) = (DPTR)->msDevInfo.mnSectorOffset; \ (SECTOR) += (DPTR)->ReservedSectorCount; \ }
The following macros compute geometry for FAT16 filesystems.
..
#define GET_FAT16_ROOT_SECTOR | ( | DPTR, | |||
SECTOR | ) |
{ \ GET_FAT16_FAT_SECTOR((DPTR), (SECTOR)); \ (SECTOR) += (DPTR)->FATSize * (DPTR)->NumFATs; \ }
#define GET_FAT16_CLUSTER_SECTOR | ( | DPTR, | |||
CLUSTER, | |||||
SECTOR | ) |
{ \ GET_FAT16_ROOT_SECTOR((DPTR), (SECTOR)); \ (SECTOR) += (((DPTR)->MaxRootEntries * sizeof(tsDirEntry)) + \ ((DPTR)->msDevInfo.mnBytesPerSector - 1)) / \ (DPTR)->msDevInfo.mnBytesPerSector; \ if ((CLUSTER) > 2) \ (SECTOR) += ((CLUSTER) - 2) * (DPTR)->SectorsPerCluster; \ }
#define GET_CLUSTER | ( | ENTRY, | |||
RESULT | ) |
(RESULT) = ((int)(ENTRY)->maClusterMSW[1]) << 24; \ (RESULT) |= ((int)(ENTRY)->maClusterMSW[0]) << 16; \ (RESULT) |= ((int)(ENTRY)->maClusterLSW[1]) << 8; \ (RESULT) |= ((int)(ENTRY)->maClusterLSW[0]);
The following macros minipulate data for a directory entry.
..
#define GET_FILESIZE | ( | ENTRY, | |||
RESULT | ) |
RESULT = ((int)(ENTRY)->maFileSize[3]) << 24; \ RESULT |= ((int)(ENTRY)->maFileSize[2]) << 16; \ RESULT |= ((int)(ENTRY)->maFileSize[1]) << 8; \ RESULT |= ((int)(ENTRY)->maFileSize[0]);
#define SET_FDATE | ( | Y, | |||
M, | |||||
D, | |||||
DATEARRAY | ) |
(DATEARRAY)[0] = ((D) & 0x1F); \ (DATEARRAY)[0] |= ((M) & 0x07) << 5; \ (DATEARRAY)[1] = ((M) & 0x08) >> 3; \ (DATEARRAY)[1] |= (((Y)-1980) & 0x7F) << 1;
#define SET_FTIME | ( | H, | |||
M, | |||||
S, | |||||
TIMEARRAY | ) |
(TIMEARRAY)[0] = ((S) & 0x3E) >> 1; \ (TIMEARRAY)[0] |= ((M) & 0x07) << 5; \ (TIMEARRAY)[1] = ((M) & 0x38) >> 3; \ (TIMEARRAY)[1] |= ((H) & 0x1F) << 3;
#define GET_FDATE | ( | DATEARRAY, | |||
Y, | |||||
M, | |||||
D | ) |
(D) = (DATEARRAY)[0] & 0x1F; \ (M) = ((DATEARRAY)[0] >> 5) & 0x07; \ (M) |= ((DATEARRAY)[1] << 3) & 0x08; \ (Y) = (((DATEARRAY)[1] >> 1) & 0x7F) + 1980;
#define GET_FTIME | ( | TIMEARRAY, | |||
H, | |||||
M, | |||||
S | ) |
(S) = ((TIMEARRAY)[0] << 1) & 0x3E; \ (M) = ((TIMEARRAY)[0] >> 5) & 0x07; \ (M) |= ((TIMEARRAY)[1] << 3) & 0x38; \ (H) = ((TIMEARRAY)[1] >> 3) & 0x1F;