Add hidden interface to support FeOS implementation of multiple cwd.

This interface grabs the pointer to the cwd cluster. This interface
is hidden because it can be very easily used incorrectly. Modifying
the cwd cluster value may cause unexpected results, so use at your
own risk, which includes a corrupted storage medium.
This commit is contained in:
mtheall 2012-09-14 16:48:11 -05:00
parent 2aaf2cfd6f
commit 8ae46ee04f
2 changed files with 11 additions and 0 deletions

View File

@ -113,6 +113,7 @@ Methods to modify DOS File Attributes
int FAT_getAttr(const char *file);
int FAT_setAttr(const char *file, int attr );
#define LIBFAT_FEOS_MULTICWD
#ifdef __cplusplus
}

View File

@ -429,3 +429,13 @@ void _FAT_partition_writeFSinfo(PARTITION * partition)
_FAT_disc_writeSectors (partition->disc, partition->fsInfoSector, 1, sectorBuffer);
_FAT_mem_free(sectorBuffer);
}
uint32_t* _FAT_getCwdClusterPtr(const char* name) {
PARTITION *partition = _FAT_partition_getPartitionFromPath(name);
if (!partition) {
return NULL;
}
return &partition->cwdCluster;
}