diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-26 05:16:48 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-26 05:16:48 +0100 |
| commit | 1cd930c0c72f215101300dfcc5860800a474362d (patch) | |
| tree | 78b3a29c8d9936baaa78b628e0862eb6546c56d8 /Private | |
| parent | 4bac72356c29f6f92c0d0df40e1aef09a4216d56 (diff) | |
Kernel: Adding IPC support.
Kernel: Adding better framebuffer support.
Kernel: Expose part of CFKit' URL API.
System.Core: Rename most of API types to their <Prefix> with Ref at the end.
System.Core: Add API to Window.hxx
System.Driver: Add Driver SDK.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private')
| -rw-r--r-- | Private/CFKit/IPCEndpoint.hxx | 27 | ||||
| -rw-r--r-- | Private/CFKit/URL.hpp | 9 | ||||
| -rw-r--r-- | Private/KernelKit/Framebuffer.hpp | 6 | ||||
| -rw-r--r-- | Private/Source/URL.cxx | 6 |
4 files changed, 39 insertions, 9 deletions
diff --git a/Private/CFKit/IPCEndpoint.hxx b/Private/CFKit/IPCEndpoint.hxx new file mode 100644 index 00000000..7f6f3f22 --- /dev/null +++ b/Private/CFKit/IPCEndpoint.hxx @@ -0,0 +1,27 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#ifndef _INC_IPC_ENDPOINT_HXX_ +#define _INC_IPC_ENDPOINT_HXX_ + +#include <NewKit/Defines.hpp> +#include <NewKit/String.hpp> + +/// @brief Includes macros and utilities to make an IPC connection. + +/// IA separator. +#define kRemoteSeparator "." + +/// Interchange address, consists of domain+namespace. +#define kRemoteInvalid "00.00.00.00:00000000" +#define kRemoteMaxLen 21 + +namespace HCore { + typedef UIntPtr ipc_method_type; + typedef Char ipc_remote_type[kRemoteMaxLen]; +} // namespace HCore + +#endif // _INC_IPC_ENDPOINT_HXX_
\ No newline at end of file diff --git a/Private/CFKit/URL.hpp b/Private/CFKit/URL.hpp index 20375c53..eb8f674f 100644 --- a/Private/CFKit/URL.hpp +++ b/Private/CFKit/URL.hpp @@ -4,8 +4,8 @@ ------------------------------------------- */ -#ifndef _INC_URL_HPP__ -#define _INC_URL_HPP__ +#ifndef _INC_URL_HPP_ +#define _INC_URL_HPP_ #include <NewKit/Defines.hpp> #include <NewKit/String.hpp> @@ -24,6 +24,9 @@ class Url final { Ref<StringView> m_urlView; }; +ErrorOr<StringView> url_extract_location(const char *url); +ErrorOr<StringView> url_extract_protocol(const char *url); } // namespace HCore -#endif /* ifndef _INC_URL_HPP__ */ + +#endif /* ifndef _INC_URL_HPP_ */ diff --git a/Private/KernelKit/Framebuffer.hpp b/Private/KernelKit/Framebuffer.hpp index 0dfeacef..397f62d0 100644 --- a/Private/KernelKit/Framebuffer.hpp +++ b/Private/KernelKit/Framebuffer.hpp @@ -67,18 +67,18 @@ class Framebuffer final { }; /***********************************************************************************/ -/// Framebuffer utils. +/// Color utils. /***********************************************************************************/ const UInt32 kRgbRed = 0x000000FF; const UInt32 kRgbGreen = 0x0000FF00; const UInt32 kRgbBlue = 0x00FF0000; const UInt32 kRgbBlack = 0x00000000; -const UInt32 kRgbWhite = 0x00FFFFFF; +const UInt32 kRgbWhite = 0xFFFFFFFF; } // namespace HCore /***********************************************************************************/ -/// Framebuffer macros. +/// Color macros. /***********************************************************************************/ #define RGB(R, G, B) (HCore::UInt32)(0x##R##G##B) diff --git a/Private/Source/URL.cxx b/Private/Source/URL.cxx index 121003a2..fc515a03 100644 --- a/Private/Source/URL.cxx +++ b/Private/Source/URL.cxx @@ -20,14 +20,14 @@ constexpr const char *kURLProtocols[] = { "http", // http without the secure "file", // filesystem protocol "ftp", // file transfer protocol - "sysconf", // system settings + "sysconf", // system config }; constexpr const int kUrlOutSz = 3; //! such as: :// constexpr const int kProtosCount = 5; constexpr const int kRangeSz = 4096; -static ErrorOr<StringView> url_extract_location(const char *url) { +ErrorOr<StringView> url_extract_location(const char *url) { if (!url || *url == 0 || rt_string_len(url, kRangeSz) > kRangeSz) return ErrorOr<StringView>{-1}; @@ -54,7 +54,7 @@ static ErrorOr<StringView> url_extract_location(const char *url) { return ErrorOr<StringView>(view); } -static ErrorOr<StringView> url_extract_protocol(const char *url) { +ErrorOr<StringView> url_extract_protocol(const char *url) { if (!url || *url == 0 || rt_string_len(url, kRangeSz) > kRangeSz) return ErrorOr<StringView>{-1}; |
