char name[12]; //!< Volume Name (With NULL Terminator)
Uint32 firstDataSect; //!< First data sector
Uint32 rootOffset; //!< Root Offset (clusters)
+ Uint32 RootSector; //!< Root Offset (sectors)
Uint32 ClusterCount; //!< Total Cluster Count
fat_bootsect bootsect; //!< Boot Sector
tVFS_Node rootNode; //!< Root Node
- int BytesPerCluster;
+ size_t BytesPerCluster;
tMutex lNodeCache;
tFAT_CachedNode *NodeCache;
// --- General Helpers ---
extern int FAT_int_GetAddress(tVFS_Node *Node, Uint64 Offset, Uint64 *Addr, Uint32 *Cluster);
+extern tTime FAT_int_GetAcessTimestamp(Uint16 Date, Uint16 Time, Uint8 MS);
+extern void FAT_int_GetFATTimestamp(tTime AcessTimestamp, Uint16 *Date, Uint16 *Time, Uint8 *MS);
// --- Node Caching ---
// NOTE: FAT uses its own node cache that references by cluster (not the inode value that the Inode_* cache uses)
extern tVFS_Node *FAT_int_CreateNode(tVFS_Node *Parent, fat_filetable *Entry);
extern tVFS_Node *FAT_int_CreateIncompleteDirNode(tFAT_VolInfo *Disk, Uint32 Cluster);
extern tVFS_Node *FAT_int_GetNode(tFAT_VolInfo *Disk, Uint32 Cluster);
-extern void FAT_int_DerefNode(tVFS_Node *Node);
+extern int FAT_int_DerefNode(tVFS_Node *Node);
extern void FAT_int_ClearNodeCache(tFAT_VolInfo *Disk);
// --- FAT Access ---
+#define GETFATVALUE_EOC 0xFFFFFFFF
extern Uint32 FAT_int_GetFatValue(tFAT_VolInfo *Disk, Uint32 Cluster);
#if SUPPORT_WRITE
extern Uint32 FAT_int_AllocateCluster(tFAT_VolInfo *Disk, Uint32 Previous);
extern void FAT_int_WriteCluster(tFAT_VolInfo *Disk, Uint32 Cluster, const void *Buffer);
// --- Directory Access ---
-extern char *FAT_ReadDir(tVFS_Node *Node, int ID);
-extern tVFS_Node *FAT_FindDir(tVFS_Node *Node, const char *Name);
+extern int FAT_ReadDir(tVFS_Node *Node, int ID, char Dest[FILENAME_MAX]);
+extern tVFS_Node *FAT_FindDir(tVFS_Node *Node, const char *Name, Uint Flags);
extern tVFS_Node *FAT_GetNodeFromINode(tVFS_Node *Root, Uint64 Inode);
extern int FAT_int_GetEntryByCluster(tVFS_Node *DirNode, Uint32 Cluster, fat_filetable *Entry);
#if SUPPORT_WRITE
extern int FAT_int_WriteDirEntry(tVFS_Node *Node, int ID, fat_filetable *Entry);
-extern int FAT_Mknod(tVFS_Node *Node, const char *Name, Uint Flags);
+extern tVFS_Node *FAT_Mknod(tVFS_Node *Node, const char *Name, Uint Flags);
extern int FAT_Link(tVFS_Node *DirNode, const char *NewName, tVFS_Node *Node);
extern int FAT_Unlink(tVFS_Node *DirNode, const char *OldName);
#endif