summaryrefslogtreecommitdiffhomepage
path: root/frameworks
diff options
context:
space:
mode:
Diffstat (limited to 'frameworks')
-rw-r--r--frameworks/libThread.fwrk/headers/Config.h11
-rw-r--r--frameworks/libThread.fwrk/src/ThreadMgr.cpp2
-rw-r--r--frameworks/libX11.fwrk/headers/Config.h18
-rw-r--r--frameworks/libX11.fwrk/src/.gitkeep0
-rw-r--r--frameworks/libX11.fwrk/src/X11ConnMgr.cpp34
5 files changed, 42 insertions, 23 deletions
diff --git a/frameworks/libThread.fwrk/headers/Config.h b/frameworks/libThread.fwrk/headers/Config.h
new file mode 100644
index 0000000..c6734a4
--- /dev/null
+++ b/frameworks/libThread.fwrk/headers/Config.h
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright 2026, 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/ne_system
+
+#ifndef LIBTHREAD_FOUNDATION_H
+#define LIBTHREAD_FOUNDATION_H
+
+#include <libSystem/SystemKit/System.h>
+
+#endif // LIBTHREAD_FOUNDATION_H
diff --git a/frameworks/libThread.fwrk/src/ThreadMgr.cpp b/frameworks/libThread.fwrk/src/ThreadMgr.cpp
index f01bbfe..7361f86 100644
--- a/frameworks/libThread.fwrk/src/ThreadMgr.cpp
+++ b/frameworks/libThread.fwrk/src/ThreadMgr.cpp
@@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/ne_system
-#include <libSystem/SystemKit/System.h>
+#include <libThread.fwrk/headers/Config.h>
#define kThreadMapMax (1024UL)
#define kThreadBaseHash (0x5555ffff6ULL)
diff --git a/frameworks/libX11.fwrk/headers/Config.h b/frameworks/libX11.fwrk/headers/Config.h
index f311fdb..7466eaf 100644
--- a/frameworks/libX11.fwrk/headers/Config.h
+++ b/frameworks/libX11.fwrk/headers/Config.h
@@ -6,6 +6,24 @@
#ifndef X11_FOUNDATION_H
#define X11_FOUNDATION_H
+#include <libSystem/SystemKit/System.h>
+#define _X11_ARRAY_CHECK(PTR) PTR != nullptr
+#define _X11_ARRAY_INDEX(ARR, PTR, LEN) ARR[((SInt64) PTR) % LEN]
+
+namespace X11 {
+
+/// @brief Plain Old Data type for a X11 connection.
+struct X11Connection final {
+ SInt32 fSocket;
+ SInt32 fType;
+ SInt32 fFlags;
+ SInt32 fPad;
+};
+
+typedef X11Connection* X11ConnectionPtr;
+typedef X11ConnectionPtr* X11ConnectionArray;
+
+} // namespace X11
#endif
diff --git a/frameworks/libX11.fwrk/src/.gitkeep b/frameworks/libX11.fwrk/src/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/frameworks/libX11.fwrk/src/.gitkeep
+++ /dev/null
diff --git a/frameworks/libX11.fwrk/src/X11ConnMgr.cpp b/frameworks/libX11.fwrk/src/X11ConnMgr.cpp
index 7477a19..61752f1 100644
--- a/frameworks/libX11.fwrk/src/X11ConnMgr.cpp
+++ b/frameworks/libX11.fwrk/src/X11ConnMgr.cpp
@@ -3,36 +3,26 @@
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/ne_system
-#include <libSystem/SystemKit/System.h>
#include <libX11.fwrk/headers/Config.h>
-#define X11_ARRAY_CHECK(PTR) PTR != nullptr
-#define X11_ARRAY_INDEX(ARR, PTR, LEN) ARR[((SInt64) PTR) % LEN]
-
namespace X11 {
-struct X11Connection final {
- SInt32 fSocket;
- SInt32 fType;
- SInt32 fFlags;
- SInt32 fPad;
-};
+namespace Detail {
-typedef X11Connection* X11ConnectionPtr;
-typedef X11ConnectionPtr* X11ConnectionArray;
+ static X11ConnectionPtr X11MakeConnection() {
+ auto ptr = new X11Connection{};
+ if (!ptr) return nullptr;
-static X11ConnectionPtr X11MakeConnection() {
- auto ptr = new X11Connection{};
- if (!ptr) return nullptr;
+ return ptr;
+ }
- return ptr;
-}
+ static Void X11DeleteConnection(X11ConnectionPtr ptr) {
+ if (!ptr) return;
-static Void X11DeleteConnection(X11ConnectionPtr ptr) {
- if (!ptr) return;
+ delete ptr;
+ ptr = nullptr;
+ }
- delete ptr;
- ptr = nullptr;
-}
+} // namespace Detail
} // namespace X11 \ No newline at end of file