diff options
| author | Amlal <amlalelmahrouss@icloud.com> | 2024-06-19 07:59:04 +0000 |
|---|---|---|
| committer | Amlal <amlalelmahrouss@icloud.com> | 2024-06-19 07:59:04 +0000 |
| commit | b820eb6a5a7948597d81998137b05ddc0eb0dbad (patch) | |
| tree | db4eaea0b6863076c4f1476f361e2317823a663a /Usr/Sys/CoreSystem/Sources/File.c | |
| parent | 36ff25861676cd1f5fb94b901fa59b015c614bc5 (diff) | |
| parent | 6735570c44516661260546dadb81f0f5c238d1db (diff) | |
Merged in MHR-31 (pull request #16)
MHR-31: Round robin scheduler.
Diffstat (limited to 'Usr/Sys/CoreSystem/Sources/File.c')
| -rw-r--r-- | Usr/Sys/CoreSystem/Sources/File.c | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/Usr/Sys/CoreSystem/Sources/File.c b/Usr/Sys/CoreSystem/Sources/File.c deleted file mode 100644 index 9f6b3b35..00000000 --- a/Usr/Sys/CoreSystem/Sources/File.c +++ /dev/null @@ -1,69 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - -------------------------------------------- */ - -#include <Headers/Defines.h> -#include <Headers/File.h> - -enum FileOp -{ - kFlushFile, - kReadFork, - kWriteFork, - kOpenFork, - kCloseFork, -}; - -/// @brief Opens a new file. -/// @param path where to find it. -/// @param rest the restrict (rw, rwe, r+, w+, r, w) -/// @return FSRef the file. -CS_EXTERN_C FSRef CSOpenFile(const CharacterTypeUTF8* path, - const CharacterTypeUTF8* rest) -{ - CS_MUST_PASS(kSharedApplication); - CS_MUST_PASS(path && CSIsValidPath(path) == Yes); - CS_MUST_PASS(rest); - - return kSharedApplication->Invoke(kSharedApplication, kCallOpenFile, path, - rest); -} - -/// @brief Closes the file and flushes it to the said file. -/// @param refCS the filesystem reference. -/// @return -CS_EXTERN_C VoidType CSCloseFile(FSRef refCS) -{ - CS_MUST_PASS(kSharedApplication); - - CSFlushFile(refCS); - - kSharedApplication->Invoke(kSharedApplication, kCallCloseFile, refCS); -} - -/// @brief Flush file -/// @param refCS the file reference. -/// @return -CS_EXTERN_C VoidType CSFlushFile(FSRef refCS) -{ - CS_MUST_PASS(kSharedApplication); - - kSharedApplication->Invoke(kSharedApplication, refCS, kFlushFile); -} - -/// @brief Check if filesystem path is valid. -/// @param path -/// @return -CS_EXTERN_C BooleanType CSIsValidPath(const CharacterTypeUTF8* path) -{ - CS_MUST_PASS(kSharedApplication); - CS_MUST_PASS(path); - - return kSharedApplication->Invoke(kSharedApplication, kCallFileExists, path) || - kSharedApplication->Invoke(kSharedApplication, kCallDirectoryExists, path) || - kSharedApplication->Invoke(kSharedApplication, kCallSymlinkExists, path) || - kSharedApplication->Invoke(kSharedApplication, kCallDriveExists, path) || - kSharedApplication->Invoke(kSharedApplication, kCallDeviceExists, path); -}
\ No newline at end of file |
