summaryrefslogtreecommitdiffhomepage
path: root/lib/libsteps
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-11-24 02:42:00 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-11-24 02:43:45 +0100
commitfc5bab30ba4d77a5c040f2c461aa8b2dd5361482 (patch)
tree9aa34c2bcf93b869238e8499245e5afb0cc5c36f /lib/libsteps
parent88089b7dc28e47bb94de6e6de123e1be58f7dd5f (diff)
feat: system and CI improvements.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'lib/libsteps')
-rw-r--r--lib/libsteps/include/.keep (renamed from lib/libsteps/dev/.keep)0
-rw-r--r--lib/libsteps/include/steps/config.hpp (renamed from lib/libsteps/dev/lib/defines.hpp)6
-rw-r--r--lib/libsteps/include/steps/steps.hpp (renamed from lib/libsteps/dev/lib/steps.hpp)18
3 files changed, 19 insertions, 5 deletions
diff --git a/lib/libsteps/dev/.keep b/lib/libsteps/include/.keep
index e69de29..e69de29 100644
--- a/lib/libsteps/dev/.keep
+++ b/lib/libsteps/include/.keep
diff --git a/lib/libsteps/dev/lib/defines.hpp b/lib/libsteps/include/steps/config.hpp
index 4c7c38b..6eefe3c 100644
--- a/lib/libsteps/dev/lib/defines.hpp
+++ b/lib/libsteps/include/steps/config.hpp
@@ -10,4 +10,8 @@ Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
#undef OCL_USE_UTF8
#endif
-#include <lib/core/includes.hpp>
+#include <core/includes.hpp>
+
+#include <cstring>
+#include <fstream>
+
diff --git a/lib/libsteps/dev/lib/steps.hpp b/lib/libsteps/include/steps/steps.hpp
index ce6be51..c524149 100644
--- a/lib/libsteps/dev/lib/steps.hpp
+++ b/lib/libsteps/include/steps/steps.hpp
@@ -6,9 +6,7 @@ Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
#pragma once
-#include <cstring>
-#include <fstream>
-#include <libsteps/dev/lib/defines.hpp>
+#include <steps/config.hpp>
#define kStepsExtension ".stp"
#define kStepsStrLen (256U)
@@ -17,8 +15,14 @@ Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
#define kStepsMagicLen (4U)
#define kStepsVersion (0x0100)
+#ifdef __GNUC__
+#define STEPS_PACKED __attribute__((packed))
+#else
+#define STEPS_PACKED
+#endif
+
namespace ocl::steps {
-struct __attribute__((packed)) record final {
+struct STEPS_PACKED record final {
ocl::char_type magic[kStepsMagicLen] = {kStepsMagic[0], kStepsMagic[1],
kStepsMagic[2], kStepsMagic[3]};
ocl::char_type name[kStepsStrLen] = "";
@@ -34,11 +38,17 @@ inline bool is_valid(record& r) noexcept {
}
namespace operators {
+/// =========================================================== ///
+/// @brief Read operator for steps records.
+/// =========================================================== ///
inline std::ifstream &operator>>(std::ifstream &f, record &r) {
f.read((char *)&r, sizeof(r));
return f;
}
+/// =========================================================== ///
+/// @brief Write operator for steps records.
+/// =========================================================== ///
inline std::ofstream &operator<<(std::ofstream &f, record &r) {
f.write((char *)&r, sizeof(r));
return f;