diff options
| author | Amlal <amlal@zka.com> | 2024-07-23 17:18:32 +0200 |
|---|---|---|
| committer | Amlal <amlal@zka.com> | 2024-07-23 17:18:32 +0200 |
| commit | a4f908c4d3d0c8d5a3578bf81028986405e96937 (patch) | |
| tree | a3a689dba643fc8393d16aed0064b7de1f13d020 /Kernel/FSKit | |
| parent | 274cba18b8f1c255ddcff2f5c14aab4d0c846820 (diff) | |
[MHR-36] Refactors and such.
Signed-off-by: Amlal <amlal@zka.com>
Diffstat (limited to 'Kernel/FSKit')
| -rw-r--r-- | Kernel/FSKit/NewFS.hxx | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/Kernel/FSKit/NewFS.hxx b/Kernel/FSKit/NewFS.hxx index f8924fee..711bde0b 100644 --- a/Kernel/FSKit/NewFS.hxx +++ b/Kernel/FSKit/NewFS.hxx @@ -68,9 +68,11 @@ default. #define kNewFSCatalogKindRLE (11) #define kNewFSSeparator '\\' +#define kNewFSSeparatorAlt '/' #define kNewFSUpDir ".." #define kNewFSRoot "\\" +#define kNewFSRootAlt "/" #define kNewFSLF '\r' #define kNewFSEOF (-1) @@ -80,7 +82,7 @@ default. /// Start After the PM headers, pad 1024 bytes. #define kNewFSStartLba (1024) -#define kNewFSCatalogStartAddress ((2048) + sizeof(NewPartitionBlock) + sizeof(NewCatalog)) +#define kNewFSCatalogStartAddress ((2048) + sizeof(NFS_ROOT_PARTITION_BLOCK) + sizeof(NFS_CATALOG_STRUCT)) #define kResourceTypeDialog (10) #define kResourceTypeString (11) @@ -111,7 +113,7 @@ enum }; /// @brief Catalog type. -struct PACKED NewCatalog final +struct PACKED NFS_CATALOG_STRUCT final { NewCharType Name[kNewFSNodeNameLen]; NewCharType Mime[kNewFSMimeNameLen]; @@ -140,7 +142,7 @@ struct PACKED NewCatalog final /// @note The way we store is way different than how other filesystems do, specific chunk of code are /// written into either the data fork or resource fork, the resource fork is reserved for file metadata. /// whereas the data fork is reserved for file data. -struct PACKED NewFork final +struct PACKED NFS_FORK_STRUCT final { NewCharType ForkName[kNewFSForkNameLen]; Kernel::Char CatalogName[kNewFSNodeNameLen]; @@ -160,7 +162,7 @@ struct PACKED NewFork final }; /// @brief Partition block type -struct PACKED NewPartitionBlock final +struct PACKED NFS_ROOT_PARTITION_BLOCK final { NewCharType Ident[kNewFSIdentLen]; NewCharType PartitionName[kPartLen]; @@ -186,7 +188,6 @@ struct PACKED NewPartitionBlock final namespace Kernel { - enum { kNewFSSubDriveA, @@ -223,47 +224,47 @@ namespace Kernel /// @param catalog it's catalog /// @param theFork the fork itself. /// @return the fork - _Output NewFork* CreateFork(_Input NewCatalog* catalog, - _Input NewFork& theFork); + _Output NFS_FORK_STRUCT* CreateFork(_Input NFS_CATALOG_STRUCT* catalog, + _Input NFS_FORK_STRUCT& theFork); /// @brief Find fork inside New filesystem. /// @param catalog the catalog. /// @param name the fork name. /// @return the fork. - _Output NewFork* FindFork(_Input NewCatalog* catalog, + _Output NFS_FORK_STRUCT* FindFork(_Input NFS_CATALOG_STRUCT* catalog, _Input const Char* name, Boolean dataOrRsrc); - _Output Void RemoveFork(_Input NewFork* fork); + _Output Void RemoveFork(_Input NFS_FORK_STRUCT* fork); - _Output Void CloseFork(_Input NewFork* fork); + _Output Void CloseFork(_Input NFS_FORK_STRUCT* fork); - _Output NewCatalog* FindCatalog(_Input const char* catalogName, Lba& outLba); + _Output NFS_CATALOG_STRUCT* FindCatalog(_Input const char* catalogName, Lba& outLba); - _Output NewCatalog* GetCatalog(_Input const char* name); + _Output NFS_CATALOG_STRUCT* GetCatalog(_Input const char* name); - _Output NewCatalog* CreateCatalog(_Input const char* name, + _Output NFS_CATALOG_STRUCT* CreateCatalog(_Input const char* name, _Input const Int32& flags, _Input const Int32& kind); - _Output NewCatalog* CreateCatalog(_Input const char* name); + _Output NFS_CATALOG_STRUCT* CreateCatalog(_Input const char* name); - bool WriteCatalog(_Input _Output NewCatalog* catalog, + bool WriteCatalog(_Input _Output NFS_CATALOG_STRUCT* catalog, voidPtr data, SizeT sizeOfData, _Input const char* forkName); - VoidPtr ReadCatalog(_Input _Output NewCatalog* catalog, + VoidPtr ReadCatalog(_Input _Output NFS_CATALOG_STRUCT* catalog, SizeT dataSz, _Input const char* forkName); - bool Seek(_Input _Output NewCatalog* catalog, SizeT off); + bool Seek(_Input _Output NFS_CATALOG_STRUCT* catalog, SizeT off); - SizeT Tell(_Input _Output NewCatalog* catalog); + SizeT Tell(_Input _Output NFS_CATALOG_STRUCT* catalog); bool RemoveCatalog(_Input const Char* catalog); - bool CloseCatalog(_InOut NewCatalog* catalog); + bool CloseCatalog(_InOut NFS_CATALOG_STRUCT* catalog); /// @brief Make a EPM+NewFS drive out of the disk. /// @param drive The drive to write on. |
