From 8ae46ee04fa42b91b7c7169e4a253be2a1ab204b Mon Sep 17 00:00:00 2001 From: mtheall Date: Fri, 14 Sep 2012 16:48:11 -0500 Subject: [PATCH] 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. --- include/fat.h | 1 + source/partition.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/include/fat.h b/include/fat.h index 32da817..03e83a2 100644 --- a/include/fat.h +++ b/include/fat.h @@ -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 } diff --git a/source/partition.c b/source/partition.c index 9d22041..108776a 100644 --- a/source/partition.c +++ b/source/partition.c @@ -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; +}