summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-03-31 07:09:23 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-03-31 07:09:23 +0200
commitfbbc3456663f800eff9e047f26fd64874c4aa152 (patch)
tree9b6657e9e38fc22763e04d7f333c2c998455ec87
parentf23d088ce1ef85ed134a20bfacf6eeb7d3c7d2c1 (diff)
mod/embdfs.hpp: add superblock structure.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rwxr-xr-xformat.sh10
-rw-r--r--lib/stdx/cgi.hpp8
-rw-r--r--lib/stdx/embdfs.hpp20
3 files changed, 30 insertions, 8 deletions
diff --git a/format.sh b/format.sh
new file mode 100755
index 0000000..28928f2
--- /dev/null
+++ b/format.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+THIS_PATH="$(realpath "$0")"
+THIS_DIR="$(dirname "$THIS_PATH")"
+
+FILE_LIST="$(find "$THIS_DIR" | grep -E ".*(\.cpp|\.c|\.hpp|\.inl)$")"
+
+echo -e "Files found to format = \n\"\"\"\n$FILE_LIST\n\"\"\""
+
+clang-format --verbose -i --style=file $FILE_LIST
diff --git a/lib/stdx/cgi.hpp b/lib/stdx/cgi.hpp
index 6d50994..5213c15 100644
--- a/lib/stdx/cgi.hpp
+++ b/lib/stdx/cgi.hpp
@@ -30,12 +30,12 @@ namespace stdx
public:
explicit cgi_writer() = default;
- ~cgi_writer() = default;
+ ~cgi_writer() = default;
- cgi_writer& operator=(const cgi_writer&) = default;
- cgi_writer(const cgi_writer&) = default;
+ cgi_writer& operator=(const cgi_writer&) = default;
+ cgi_writer(const cgi_writer&) = default;
- public:
+ public:
cgi_writer& eval_html(const std::stringstream& ss_html)
{
return this->eval_("text/html", ss_html);
diff --git a/lib/stdx/embdfs.hpp b/lib/stdx/embdfs.hpp
index 05e2fc9..5cc8496 100644
--- a/lib/stdx/embdfs.hpp
+++ b/lib/stdx/embdfs.hpp
@@ -12,13 +12,25 @@
#include <cstdint>
#include <cstddef>
-/// @brief A Fail-safe filesystem designed for tiny MCUs.
+/// @brief A Filesystem designed for tiny storage.
/// @author Amlal EL Mahrouss (amlal@nekernel.org)
namespace stdx::freestanding
{
- struct embdfs_superblock;
- struct embdfs_inode;
-}
+ struct embdfs_superblock;
+ struct embdfs_inode;
+
+ /// @brief Superblock data structure
+ struct embdfs_superblock
+ {
+ std::int16_t s_block_mag;
+ std::int32_t s_num_inodes;
+ std::int32_t s_part_size;
+ std::int32_t s_part_used;
+ std::int16_t s_sector_sz;
+ std::uint32_t s_inode_start, s_inode_end;
+ char s_name[16];
+ };
+} // namespace stdx::freestanding
#endif // ifndef _STDX_EMBDFS_HPP \ No newline at end of file