summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-11-19 09:26:49 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-11-19 09:26:49 +0100
commit9f3ed9465eacc0811a2397b0b807779729aa1b9e (patch)
treeaabdbbec304807e3038b00f1c8378c26b9d58729 /lib
parent36bd2efdc56877729617ccf5222911484fb86d31 (diff)
feat: new commits on components, new libsteps library.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/.keep0
m---------lib/libocl0
-rw-r--r--lib/libsteps/steps.h47
3 files changed, 47 insertions, 0 deletions
diff --git a/lib/.keep b/lib/.keep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/lib/.keep
diff --git a/lib/libocl b/lib/libocl
-Subproject c9fd682f3662e0eec09de49a36a4ea199656da3
+Subproject 3bc2fca2c9beff13586b8bf3089ce439acb09de
diff --git a/lib/libsteps/steps.h b/lib/libsteps/steps.h
new file mode 100644
index 0000000..357f0df
--- /dev/null
+++ b/lib/libsteps/steps.h
@@ -0,0 +1,47 @@
+/* -------------------------------------------
+
+Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
+
+------------------------------------------- */
+
+#pragma once
+
+#include <lib/core/includes.hpp>
+
+#define kSysStepsExtension ".stp"
+#define kSysStepsStrLen (256U)
+
+#define kSysStepsMagic " pls"
+#define kSysStepsMagicLen (4U)
+#define kSysStepsVersion (0x0100)
+
+#define kStepsMime "ne-application-kind/steps"
+
+namespace steps {
+struct record final {
+ char magic[kSysStepsMagicLen] = {kSysStepsMagic[0], kSysStepsMagic[1],
+ kSysStepsMagic[2], kSysStepsMagic[3]};
+ char name[kSysStepsStrLen] = "";
+ char company[kSysStepsStrLen] = "";
+ char author[kSysStepsStrLen] = "";
+ int32_t version = 0;
+ int32_t pages = 0;
+ int32_t check_page = 0, eula_page = 0;
+};
+
+namespace operators {
+/// =========================================================== ///
+/// @brief Equal operator for steps records.
+/// =========================================================== ///
+inline bool operator==(const record &r, const record &l) {
+ return (std::strncmp(r.magic, l.magic, kSysStepsMagicLen) == 0);
+}
+
+/// =========================================================== ///
+/// @brief Not equal operator for steps records.
+/// =========================================================== ///
+inline bool operator!=(const record &r, const record &l) {
+ return (std::strncmp(r.magic, l.magic, kSysStepsMagicLen) > 0);
+}
+} // namespace operators
+} // namespace steps