summaryrefslogtreecommitdiffhomepage
path: root/Public/Developer/SystemLib/Sources/File.c
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-17 09:54:17 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-17 10:08:50 +0200
commitc0099ab36bf9606c5503ceb0fa0d5b64f71c7203 (patch)
tree1c310521280e3c995981a903895c7c2e124582ee /Public/Developer/SystemLib/Sources/File.c
parentf93fb4439aaa865d998a790348313a4c7163bb8b (diff)
Unrelated: These changes are important but related to nothing.
- Window now becomes Wm, as in Window manager. - Fix entrypoint for FragLib. - Remove CoreEvents to be replaced with Event Server, reworked Display Server. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Public/Developer/SystemLib/Sources/File.c')
-rw-r--r--Public/Developer/SystemLib/Sources/File.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/Public/Developer/SystemLib/Sources/File.c b/Public/Developer/SystemLib/Sources/File.c
index ca23d9f7..39a4aff0 100644
--- a/Public/Developer/SystemLib/Sources/File.c
+++ b/Public/Developer/SystemLib/Sources/File.c
@@ -8,31 +8,32 @@
#include <Headers/File.h>
enum FileOp {
- kFlushFile,
- kReadFork,
- kWriteFork,
- kOpenFork,
- kCloseFork,
+ kFlushFile,
+ kReadFork,
+ kWriteFork,
+ kOpenFork,
+ kCloseFork,
};
/// @brief Opens a new file.
/// @param path where to find it.
-/// @param r the restrict (rw, rwe, r+, w+, r, w)
-/// @return
-CA_EXTERN_C FSRef FsOpenFile(const CharacterTypeUTF8* path, const CharacterTypeUTF8* r) {
- CA_MUST_PASS(kSharedApplication);
- CA_MUST_PASS(path);
- CA_MUST_PASS(r);
-
- return kSharedApplication->Invoke(kSharedApplication, kCallOpenFile, path, r);
+/// @param rest the restrict (rw, rwe, r+, w+, r, w)
+/// @return FSRef the file.
+CA_EXTERN_C FSRef FsOpenFile(const CharacterTypeUTF8* path,
+ const CharacterTypeUTF8* rest) {
+ CA_MUST_PASS(kSharedApplication);
+ CA_MUST_PASS(path && FsIsValidPath(path) == Yes);
+ CA_MUST_PASS(rest);
+
+ return kSharedApplication->Invoke(kSharedApplication, kCallOpenFile, path, rest);
}
/// @brief Closes the file and flushes it to the said file.
/// @param refFs the filesystem reference.
-/// @return
+/// @return
CA_EXTERN_C VoidType FsCloseFile(FSRef refFs) {
- CA_MUST_PASS(kSharedApplication);
+ CA_MUST_PASS(kSharedApplication);
- kSharedApplication->Invoke(kSharedApplication, refFs, kFlushFile);
- kSharedApplication->Invoke(kSharedApplication, kCallCloseFile, refFs);
+ kSharedApplication->Invoke(kSharedApplication, refFs, kFlushFile);
+ kSharedApplication->Invoke(kSharedApplication, kCallCloseFile, refFs);
}