git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
VFS - Rework to remove function pointers from tVFS_Node
[tpg/acess2.git]
/
Kernel
/
vfs
/
memfile.c
diff --git
a/Kernel/vfs/memfile.c
b/Kernel/vfs/memfile.c
index
c197626
..
14b3948
100644
(file)
--- a/
Kernel/vfs/memfile.c
+++ b/
Kernel/vfs/memfile.c
@@
-7,24
+7,23
@@
#include <vfs.h>
// === PROTOTYPES ===
#include <vfs.h>
// === 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);
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 ===
// === GLOBALS ===
-tVFS_Node
gVFS_MemRoot
= {
- .
Flags = VFS_FFLAG_DIRECTORY
,
- .
NumACLs = 0
,
- .
FindDir = VFS_MemFile_Crea
te
+tVFS_Node
Type gVFS_MemFileType
= {
+ .
Close = VFS_MemFile_Close
,
+ .
Read = VFS_MemFile_Read
,
+ .
Write = VFS_MemFile_Wri
te
};
// === CODE ===
/**
};
// === 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;
{
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->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;
}
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
*/
* \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;
{
// Check for use of free'd file
if(Node->ImplPtr == NULL) return 0;
UCC
git Repository :: git.ucc.asn.au