X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fvfs%2Fmemfile.c;h=14b39481d0c82d7adc503d605ace864855f27ead;hb=5f2024e5977e0cca0993a20dad5ab794c94d5711;hp=c197626ff4e85aac6b95d3c627245d89fba07d0b;hpb=e56e258bdc6345e33454ddb127b2d87c536a0f39;p=tpg%2Facess2.git diff --git a/Kernel/vfs/memfile.c b/Kernel/vfs/memfile.c index c197626f..14b39481 100644 --- a/Kernel/vfs/memfile.c +++ b/Kernel/vfs/memfile.c @@ -7,24 +7,23 @@ #include // === PROTOTYPES === -tVFS_Node *VFS_MemFile_Create(tVFS_Node *Unused, const char *Path); +tVFS_Node *VFS_MemFile_Create(const char *Path); void VFS_MemFile_Close(tVFS_Node *Node); Uint64 VFS_MemFile_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer); -Uint64 VFS_MemFile_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer); +Uint64 VFS_MemFile_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Buffer); // === GLOBALS === -tVFS_Node gVFS_MemRoot = { - .Flags = VFS_FFLAG_DIRECTORY, - .NumACLs = 0, - .FindDir = VFS_MemFile_Create +tVFS_NodeType gVFS_MemFileType = { + .Close = VFS_MemFile_Close, + .Read = VFS_MemFile_Read, + .Write = VFS_MemFile_Write }; // === CODE === /** - * \fn tVFS_Node *VFS_MemFile_Create(tVFS_Node *Unused, const char *Path) - * \note Treated as finddir by VFS_ParsePath + * \fn tVFS_Node *VFS_MemFile_Create(const char *Path) */ -tVFS_Node *VFS_MemFile_Create(tVFS_Node *Unused, const char *Path) +tVFS_Node *VFS_MemFile_Create(const char *Path) { Uint base, size; const char *str = Path; @@ -73,9 +72,7 @@ tVFS_Node *VFS_MemFile_Create(tVFS_Node *Unused, const char *Path) ret->ACLs = &gVFS_ACL_EveryoneRWX; // Functions - ret->Close = VFS_MemFile_Close; - ret->Read = VFS_MemFile_Read; - ret->Write = VFS_MemFile_Write; + ret->Type = &gVFS_MemFileType; return ret; } @@ -119,7 +116,7 @@ Uint64 VFS_MemFile_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buf * \fn Uint64 VFS_MemFile_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) * \brief Write to a memory file */ -Uint64 VFS_MemFile_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) +Uint64 VFS_MemFile_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Buffer) { // Check for use of free'd file if(Node->ImplPtr == NULL) return 0;