mirror of
https://github.com/wiiu-env/libfat.git
synced 2024-11-26 03:44:15 +01:00
_partitions changed to _FAT_partitions to maintain the same style of naming as the functions
This commit is contained in:
parent
43f90657e3
commit
74f3ca8a59
@ -31,6 +31,9 @@
|
|||||||
|
|
||||||
2006-08-10 - Chishm
|
2006-08-10 - Chishm
|
||||||
* Fixed problem when openning files starting with "fat"
|
* Fixed problem when openning files starting with "fat"
|
||||||
|
|
||||||
|
2006-10-28 - Chishm
|
||||||
|
* _partitions changed to _FAT_partitions to maintain the same style of naming as the functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -102,10 +105,10 @@ enum BPB {
|
|||||||
|
|
||||||
#ifdef NDS
|
#ifdef NDS
|
||||||
#define MAXIMUM_PARTITIONS 4
|
#define MAXIMUM_PARTITIONS 4
|
||||||
PARTITION* _partitions[MAXIMUM_PARTITIONS] = {NULL};
|
PARTITION* _FAT_partitions[MAXIMUM_PARTITIONS] = {NULL};
|
||||||
#else // not defined NDS
|
#else // not defined NDS
|
||||||
#define MAXIMUM_PARTITIONS 1
|
#define MAXIMUM_PARTITIONS 1
|
||||||
PARTITION* _partitions[MAXIMUM_PARTITIONS] = {NULL};
|
PARTITION* _FAT_partitions[MAXIMUM_PARTITIONS] = {NULL};
|
||||||
#endif // defined NDS
|
#endif // defined NDS
|
||||||
|
|
||||||
// Use a single static buffer for the partitions
|
// Use a single static buffer for the partitions
|
||||||
@ -236,7 +239,7 @@ bool _FAT_partition_mount (PARTITION_INTERFACE partitionNumber, u32 cacheSize) {
|
|||||||
int i;
|
int i;
|
||||||
const IO_INTERFACE* disc = NULL;
|
const IO_INTERFACE* disc = NULL;
|
||||||
|
|
||||||
if (_partitions[partitionNumber] != NULL) {
|
if (_FAT_partitions[partitionNumber] != NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,28 +266,28 @@ bool _FAT_partition_mount (PARTITION_INTERFACE partitionNumber, u32 cacheSize) {
|
|||||||
|
|
||||||
// See if that disc is already in use, if so, then just copy the partition pointer
|
// See if that disc is already in use, if so, then just copy the partition pointer
|
||||||
for (i = 0; i < MAXIMUM_PARTITIONS; i++) {
|
for (i = 0; i < MAXIMUM_PARTITIONS; i++) {
|
||||||
if ((_partitions[i] != NULL) && (_partitions[i]->disc == disc)) {
|
if ((_FAT_partitions[i] != NULL) && (_FAT_partitions[i]->disc == disc)) {
|
||||||
_partitions[partitionNumber] = _partitions[i];
|
_FAT_partitions[partitionNumber] = _FAT_partitions[i];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_partitions[partitionNumber] = _FAT_partition_constructor (disc, cacheSize);
|
_FAT_partitions[partitionNumber] = _FAT_partition_constructor (disc, cacheSize);
|
||||||
|
|
||||||
if (_partitions[partitionNumber] == NULL) {
|
if (_FAT_partitions[partitionNumber] == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // not defined NDS
|
#else // not defined NDS
|
||||||
const IO_INTERFACE* disc = NULL;
|
const IO_INTERFACE* disc = NULL;
|
||||||
|
|
||||||
if (_partitions[partitionNumber] != NULL) {
|
if (_FAT_partitions[partitionNumber] != NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only ever one partition on GBA
|
// Only ever one partition on GBA
|
||||||
disc = _FAT_disc_gbaSlotFindInterface ();
|
disc = _FAT_disc_gbaSlotFindInterface ();
|
||||||
_partitions[partitionNumber] = _FAT_partition_constructor (disc, cacheSize);
|
_FAT_partitions[partitionNumber] = _FAT_partition_constructor (disc, cacheSize);
|
||||||
|
|
||||||
#endif // defined NDS
|
#endif // defined NDS
|
||||||
|
|
||||||
@ -295,7 +298,7 @@ bool _FAT_partition_mountCustomInterface (const IO_INTERFACE* device, u32 cacheS
|
|||||||
#ifdef NDS
|
#ifdef NDS
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (_partitions[PI_CUSTOM] != NULL) {
|
if (_FAT_partitions[PI_CUSTOM] != NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,20 +308,20 @@ bool _FAT_partition_mountCustomInterface (const IO_INTERFACE* device, u32 cacheS
|
|||||||
|
|
||||||
// See if that disc is already in use, if so, then just copy the partition pointer
|
// See if that disc is already in use, if so, then just copy the partition pointer
|
||||||
for (i = 0; i < MAXIMUM_PARTITIONS; i++) {
|
for (i = 0; i < MAXIMUM_PARTITIONS; i++) {
|
||||||
if ((_partitions[i] != NULL) && (_partitions[i]->disc == device)) {
|
if ((_FAT_partitions[i] != NULL) && (_FAT_partitions[i]->disc == device)) {
|
||||||
_partitions[PI_CUSTOM] = _partitions[i];
|
_FAT_partitions[PI_CUSTOM] = _FAT_partitions[i];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_partitions[PI_CUSTOM] = _FAT_partition_constructor (device, cacheSize);
|
_FAT_partitions[PI_CUSTOM] = _FAT_partition_constructor (device, cacheSize);
|
||||||
|
|
||||||
if (_partitions[PI_CUSTOM] == NULL) {
|
if (_FAT_partitions[PI_CUSTOM] == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // not defined NDS
|
#else // not defined NDS
|
||||||
if (_partitions[PI_CART_SLOT] != NULL) {
|
if (_FAT_partitions[PI_CART_SLOT] != NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,7 +330,7 @@ bool _FAT_partition_mountCustomInterface (const IO_INTERFACE* device, u32 cacheS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only ever one partition on GBA
|
// Only ever one partition on GBA
|
||||||
_partitions[PI_CART_SLOT] = _FAT_partition_constructor (device, cacheSize);
|
_FAT_partitions[PI_CART_SLOT] = _FAT_partition_constructor (device, cacheSize);
|
||||||
|
|
||||||
#endif // defined NDS
|
#endif // defined NDS
|
||||||
|
|
||||||
@ -340,11 +343,11 @@ bool _FAT_partition_setDefaultInterface (PARTITION_INTERFACE partitionNumber) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_partitions[partitionNumber] == NULL) {
|
if (_FAT_partitions[partitionNumber] == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_partitions[PI_DEFAULT] = _partitions[partitionNumber];
|
_FAT_partitions[PI_DEFAULT] = _FAT_partitions[partitionNumber];
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -359,7 +362,7 @@ bool _FAT_partition_setDefaultPartition (PARTITION* partition) {
|
|||||||
|
|
||||||
// Ensure that this device is already in the list
|
// Ensure that this device is already in the list
|
||||||
for (i = 1; i < MAXIMUM_PARTITIONS; i++) {
|
for (i = 1; i < MAXIMUM_PARTITIONS; i++) {
|
||||||
if (_partitions[i] == partition) {
|
if (_FAT_partitions[i] == partition) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -370,7 +373,7 @@ bool _FAT_partition_setDefaultPartition (PARTITION* partition) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Change the default partition / device to this one
|
// Change the default partition / device to this one
|
||||||
_partitions[PI_DEFAULT] = partition;
|
_FAT_partitions[PI_DEFAULT] = partition;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
@ -378,7 +381,7 @@ bool _FAT_partition_setDefaultPartition (PARTITION* partition) {
|
|||||||
|
|
||||||
bool _FAT_partition_unmount (PARTITION_INTERFACE partitionNumber) {
|
bool _FAT_partition_unmount (PARTITION_INTERFACE partitionNumber) {
|
||||||
int i;
|
int i;
|
||||||
PARTITION* partition = _partitions[partitionNumber];
|
PARTITION* partition = _FAT_partitions[partitionNumber];
|
||||||
|
|
||||||
if (partition == NULL) {
|
if (partition == NULL) {
|
||||||
return false;
|
return false;
|
||||||
@ -391,8 +394,8 @@ bool _FAT_partition_unmount (PARTITION_INTERFACE partitionNumber) {
|
|||||||
|
|
||||||
// Remove all references to this partition
|
// Remove all references to this partition
|
||||||
for (i = 0; i < MAXIMUM_PARTITIONS; i++) {
|
for (i = 0; i < MAXIMUM_PARTITIONS; i++) {
|
||||||
if (_partitions[i] == partition) {
|
if (_FAT_partitions[i] == partition) {
|
||||||
_partitions[i] = NULL;
|
_FAT_partitions[i] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,7 +405,7 @@ bool _FAT_partition_unmount (PARTITION_INTERFACE partitionNumber) {
|
|||||||
|
|
||||||
bool _FAT_partition_unsafeUnmount (PARTITION_INTERFACE partitionNumber) {
|
bool _FAT_partition_unsafeUnmount (PARTITION_INTERFACE partitionNumber) {
|
||||||
int i;
|
int i;
|
||||||
PARTITION* partition = _partitions[partitionNumber];
|
PARTITION* partition = _FAT_partitions[partitionNumber];
|
||||||
|
|
||||||
if (partition == NULL) {
|
if (partition == NULL) {
|
||||||
return false;
|
return false;
|
||||||
@ -410,8 +413,8 @@ bool _FAT_partition_unsafeUnmount (PARTITION_INTERFACE partitionNumber) {
|
|||||||
|
|
||||||
// Remove all references to this partition
|
// Remove all references to this partition
|
||||||
for (i = 0; i < MAXIMUM_PARTITIONS; i++) {
|
for (i = 0; i < MAXIMUM_PARTITIONS; i++) {
|
||||||
if (_partitions[i] == partition) {
|
if (_FAT_partitions[i] == partition) {
|
||||||
_partitions[i] = NULL;
|
_FAT_partitions[i] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -450,9 +453,9 @@ PARTITION* _FAT_partition_getPartitionFromPath (const char* path) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _partitions[partitionNumber];
|
return _FAT_partitions[partitionNumber];
|
||||||
#else // not defined NDS
|
#else // not defined NDS
|
||||||
// Only one possible partition on GBA
|
// Only one possible partition on GBA
|
||||||
return _partitions[PI_CART_SLOT];
|
return _FAT_partitions[PI_CART_SLOT];
|
||||||
#endif // defined NDS
|
#endif // defined NDS
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user