// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) // Licensed under the Apache License, Version 2.0 (see LICENSE file) // Official repository: https://github.com/ne-foss-org/nekernel #ifndef HEADERS_FOUNDATION_H #define HEADERS_FOUNDATION_H #include #include 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{kMaxPath}; CF::CFString fWorkingDirectory{kMaxPath}; CF::CFRef fArguments[kMaxArgs]; CF::CFString fEnvironment{kMaxPath}; CF::CFInteger64 fUID{0}; CF::CFInteger64 fGID{0}; LHLaunchInfo() = default; ~LHLaunchInfo() = default; LIBSYS_COPY_DELETE(LHLaunchInfo) explicit operator bool() { return fUID && fGID; } CF::CFRef* begin() { return fArguments; } CF::CFRef* end() { return fArguments + kMaxArgs; } SizeT size() { return kMaxArgs; } }; using LHLaunchInfoPtr = LHLaunchInfo*; /// @brief Get launch information. /// @return the launch information structure. CF::CFRef LHGetLaunchInfo(Void); } // namespace LaunchHelpers #endif