From 3cded2a8deaaa8e6907ed1b47d174eb267aab7aa Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Sun, 9 Jun 2024 19:59:14 +0200 Subject: MHR-23: Refactor and finishing SMP support. --- Usr/Sys/CoreSystem/Sources/App.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Usr/Sys/CoreSystem/Sources/App.c (limited to 'Usr/Sys/CoreSystem/Sources/App.c') diff --git a/Usr/Sys/CoreSystem/Sources/App.c b/Usr/Sys/CoreSystem/Sources/App.c new file mode 100644 index 00000000..42ea19c6 --- /dev/null +++ b/Usr/Sys/CoreSystem/Sources/App.c @@ -0,0 +1,31 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + +------------------------------------------- */ + +#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. +CS_EXTERN_C SizeType RtGetAppArgumentsCount(VoidType) +{ + CS_MUST_PASS(kSharedApplication); + + return kSharedApplication->Invoke(kSharedApplication, kCallGetArgsCount); +} + +/// @brief Gets the app arguments pointer. +/// @param void no arguments. +/// @return +CS_EXTERN_C CharacterTypeUTF8** RtGetAppArgumentsPtr(VoidType) +{ + CS_MUST_PASS(kSharedApplication); + + return (CharacterTypeUTF8**)kSharedApplication->Invoke(kSharedApplication, + kCallGetArgsPtr); +} -- cgit v1.2.3