summaryrefslogtreecommitdiffhomepage
path: root/src/libMsg/MsgKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-11-23 21:06:27 -0500
committerGitHub <noreply@github.com>2025-11-23 21:06:27 -0500
commit23040fad647634c08697451fc22ee2ca999629c8 (patch)
tree72888f88c7728c82f3f6df1f4f70591de15eab36 /src/libMsg/MsgKit
parente5cc7351f0577b54c528fb827a7c7e6306c3e843 (diff)
parent83d870e58457a1d335a1d9b9966a6a1887cc297b (diff)
Merge pull request #81 from nekernel-org/dev
feat! breaking changes on kernel sources.
Diffstat (limited to 'src/libMsg/MsgKit')
-rw-r--r--src/libMsg/MsgKit/Network.h9
-rw-r--r--src/libMsg/MsgKit/Server.h41
2 files changed, 50 insertions, 0 deletions
diff --git a/src/libMsg/MsgKit/Network.h b/src/libMsg/MsgKit/Network.h
new file mode 100644
index 00000000..ca7cf2d3
--- /dev/null
+++ b/src/libMsg/MsgKit/Network.h
@@ -0,0 +1,9 @@
+/* ========================================
+
+ Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
+
+======================================== */
+
+#pragma once
+
+#include <libMsg/MsgKit/Server.h> \ No newline at end of file
diff --git a/src/libMsg/MsgKit/Server.h b/src/libMsg/MsgKit/Server.h
new file mode 100644
index 00000000..b75fb96a
--- /dev/null
+++ b/src/libMsg/MsgKit/Server.h
@@ -0,0 +1,41 @@
+/* ========================================
+
+ Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
+
+======================================== */
+
+#pragma once
+
+#ifdef __cplusplus
+#include <public/frameworks/CoreFoundation.fwrk/headers/String.h>
+#else
+#include <libSystem/SystemKit/System.h>
+#endif
+
+/// @author Amlal El Mahrouss
+/// @file Server.h
+/// @brief libMsg LISP system.
+
+struct LIBMSG_EXPR;
+
+/// @brief an expression chain of LibMSG.
+struct LIBMSG_EXPR final {
+#ifdef __cplusplus
+ CF::CFString* l_key{nullptr};
+ CF::CFString* l_value{nullptr};
+#else
+ // if we use C, we won't know about CF, so let's make those private.
+ VoidPtr l_private_data[2]{nullptr};
+#endif
+
+ LIBMSG_EXPR* l_head{nullptr};
+ LIBMSG_EXPR* l_tail{nullptr};
+ LIBMSG_EXPR* l_child{nullptr};
+};
+
+/// @brief Function type for LibMSG lisp.
+typedef Void (*libmsg_func_type)(struct LIBMSG_EXPR* self, VoidPtr arg, SizeT arg_size);
+
+IMPORT_C Void libmsg_init_library(libmsg_func_type* funcs, SizeT cnt);
+IMPORT_C UInt32 libmsg_close_library(Void);
+IMPORT_C UInt32 libmsg_eval_expr(struct LIBMSG_EXPR* head);