From 09dd11ddf800898c00ecb04a65fb5cd10fb481fa Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 8 May 2024 12:32:41 +0200 Subject: MHR-23: :boom: changes, reworked project tree. Signed-off-by: Amlal El Mahrouss --- Public/Developer/SystemLib/Sources/App.c | 31 ----------------- Public/Developer/SystemLib/Sources/File.c | 43 ------------------------ Public/Developer/SystemLib/Sources/Heap.c | 55 ------------------------------- Public/Developer/SystemLib/Sources/Math.c | 14 -------- 4 files changed, 143 deletions(-) delete mode 100644 Public/Developer/SystemLib/Sources/App.c delete mode 100644 Public/Developer/SystemLib/Sources/File.c delete mode 100644 Public/Developer/SystemLib/Sources/Heap.c delete mode 100644 Public/Developer/SystemLib/Sources/Math.c (limited to 'Public/Developer/SystemLib/Sources') diff --git a/Public/Developer/SystemLib/Sources/App.c b/Public/Developer/SystemLib/Sources/App.c deleted file mode 100644 index 7778c064..00000000 --- a/Public/Developer/SystemLib/Sources/App.c +++ /dev/null @@ -1,31 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#include - -/// @brief Main Application object, retrieved from the RtGetAppPointer symbol. -ApplicationInterfaceRef kSharedApplication = NullPtr; - -/// @brief Gets the app arguments count. -/// @param void no arguments. -/// @return The number of arguments given to the application. -CA_EXTERN_C SizeType RtGetAppArgumentsCount(VoidType) -{ - CA_MUST_PASS(kSharedApplication); - - return kSharedApplication->Invoke(kSharedApplication, kCallGetArgsCount); -} - -/// @brief Gets the app arguments pointer. -/// @param void no arguments. -/// @return -CA_EXTERN_C CharacterTypeUTF8** RtGetAppArgumentsPtr(VoidType) -{ - CA_MUST_PASS(kSharedApplication); - - return (CharacterTypeUTF8**)kSharedApplication->Invoke(kSharedApplication, - kCallGetArgsPtr); -} diff --git a/Public/Developer/SystemLib/Sources/File.c b/Public/Developer/SystemLib/Sources/File.c deleted file mode 100644 index 40cbd515..00000000 --- a/Public/Developer/SystemLib/Sources/File.c +++ /dev/null @@ -1,43 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#include -#include - -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. -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 -CA_EXTERN_C VoidType FsCloseFile(FSRef refFs) -{ - CA_MUST_PASS(kSharedApplication); - - kSharedApplication->Invoke(kSharedApplication, refFs, kFlushFile); - kSharedApplication->Invoke(kSharedApplication, kCallCloseFile, refFs); -} diff --git a/Public/Developer/SystemLib/Sources/Heap.c b/Public/Developer/SystemLib/Sources/Heap.c deleted file mode 100644 index 6c5e381e..00000000 --- a/Public/Developer/SystemLib/Sources/Heap.c +++ /dev/null @@ -1,55 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#include -#include - -/// @brief Allocate from the user's heap. -/// @param sz size of object. -/// @param flags flags. -/// @return -CA_EXTERN_C PtrVoidType RtTlsAllocate(QWordType sz, DWordType flags) -{ - CA_MUST_PASS(kSharedApplication); - CA_MUST_PASS(sz); - CA_MUST_PASS(flags); - - return (PtrVoidType)kSharedApplication->Invoke(kSharedApplication, - kCallAllocPtr, sz, flags); -} - -/// @brief Free pointer from the user's heap. -/// @param ptr the pointer to free. -CA_EXTERN_C VoidType RtTlsFree(PtrVoidType ptr) -{ - CA_MUST_PASS(kSharedApplication); - CA_MUST_PASS(ptr); - - CA_UNREFERENCED_PARAMETER( - kSharedApplication->Invoke(kSharedApplication, kCallFreePtr, ptr)); -} - -/// @brief Get pointer size. -/// @param ptr the pointer to find. -/// @return the size. -CA_EXTERN_C QWordType RtTlsGetSize(PtrVoidType ptr) -{ - CA_MUST_PASS(kSharedApplication); - - CA_MUST_PASS(ptr); - return kSharedApplication->Invoke(kSharedApplication, kCallSizePtr, ptr); -} - -/// @brief Check if the pointer exists. -/// @param ptr the pointer to check. -/// @return if it exists -CA_EXTERN_C BooleanType RtTlsPtrExists(PtrVoidType ptr) -{ - CA_MUST_PASS(kSharedApplication); - - CA_MUST_PASS(ptr); - return kSharedApplication->Invoke(kSharedApplication, kCallCheckPtr, ptr); -} diff --git a/Public/Developer/SystemLib/Sources/Math.c b/Public/Developer/SystemLib/Sources/Math.c deleted file mode 100644 index 6797166a..00000000 --- a/Public/Developer/SystemLib/Sources/Math.c +++ /dev/null @@ -1,14 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#include - -/// @brief Number generator helper. -/// @return Random generated number. -CA_EXTERN_C SizeType MathRand(VoidType) -{ - return kSharedApplication->Invoke(kSharedApplication, kCallRandomNumberGenerator); -} \ No newline at end of file -- cgit v1.2.3