diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-09 05:12:57 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-09 05:48:25 +0100 |
| commit | 64c23b15059649aeee6d08c7940d0ff1b56512b5 (patch) | |
| tree | c6e826d0b7f92d681563b8b381e36bf86628f8f1 /public/frameworks | |
| parent | 4d192e629a07ae457134cb0063e0136e54b01008 (diff) | |
feat: New `InitializerList` class, and `LHGetLaunchInfo` implementation on `LaunchHelpers.fwrk`.v0.0.82
fix: Fix operator!= in the `Atom` class.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'public/frameworks')
4 files changed, 24 insertions, 9 deletions
diff --git a/public/frameworks/LaunchHelpers.fwrk/headers/Foundation.h b/public/frameworks/LaunchHelpers.fwrk/headers/Foundation.h index 846bb344..b20ca17e 100644 --- a/public/frameworks/LaunchHelpers.fwrk/headers/Foundation.h +++ b/public/frameworks/LaunchHelpers.fwrk/headers/Foundation.h @@ -12,15 +12,20 @@ namespace LaunchHelpers { struct LHLaunchInfo; +inline constexpr auto kMaxPath = 4096; +inline constexpr auto kMaxArgs = 256; + /// @brief Launch information structure. /// @note This structure is read-only. Modyfing its members wo't have any effect. struct LHLaunchInfo final { - CF::CFString fExecutablePath; - CF::CFString fWorkingDirectory; - CF::CFString fArguments; - CF::CFString fEnvironment; + CF::CFString fExecutablePath{kMaxPath}; + CF::CFString fWorkingDirectory{kMaxPath}; + CF::CFString fArguments[kMaxArgs]; + CF::CFString fEnvironment{kMaxPath}; CF::CFInteger64 fUID{0}; CF::CFInteger64 fGID{0}; + + explicit operator bool() { return fUID && fGID; } }; using LHLaunchInfoPtr = LHLaunchInfo*; diff --git a/public/frameworks/LaunchHelpers.fwrk/src/.keep b/public/frameworks/LaunchHelpers.fwrk/src/.keep deleted file mode 100644 index e69de29b..00000000 --- a/public/frameworks/LaunchHelpers.fwrk/src/.keep +++ /dev/null diff --git a/public/frameworks/LaunchHelpers.fwrk/src/DylibMain.cc b/public/frameworks/LaunchHelpers.fwrk/src/DylibMain.cc deleted file mode 100644 index 99eebd26..00000000 --- a/public/frameworks/LaunchHelpers.fwrk/src/DylibMain.cc +++ /dev/null @@ -1,5 +0,0 @@ -#include <libSystem/SystemKit/System.h> - -SInt32 _DylibAttach(SInt32 argc, Char* argv[]) { - return EXIT_FAILURE; -}
\ No newline at end of file diff --git a/public/frameworks/LaunchHelpers.fwrk/src/Foundation.cc b/public/frameworks/LaunchHelpers.fwrk/src/Foundation.cc new file mode 100644 index 00000000..6cc3bff3 --- /dev/null +++ b/public/frameworks/LaunchHelpers.fwrk/src/Foundation.cc @@ -0,0 +1,15 @@ +/* ======================================== + + Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. + +======================================== */ + +#include <LaunchHelpers.fwrk/headers/Foundation.h> +#include <libSystem/SystemKit/Syscall.h> + +/// @brief Get launch information. +/// @return the launch information structure. +LaunchHelpers::LHLaunchInfo* LaunchHelpers::LHGetLaunchInfo(Void) { + return static_cast<LaunchHelpers::LHLaunchInfo*>( + libsys_syscall_arg_1(libsys_hash_64("__LHGetLaunchInfo"))); +}
\ No newline at end of file |
