From 426a84a1a91eb960e5c085b25daf4c177c4fff13 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Sun, 2 Mar 2025 23:14:40 +0000 Subject: [PATCH] docs(kernel): short doc for __check_op macro Signed-off-by: EnderIce2 --- Kernel/include/filesystem.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Kernel/include/filesystem.hpp b/Kernel/include/filesystem.hpp index a4be14b0..f41c50d2 100644 --- a/Kernel/include/filesystem.hpp +++ b/Kernel/include/filesystem.hpp @@ -31,6 +31,24 @@ static_assert(DTTOIF(DT_FIFO) == S_IFIFO); static_assert(IFTODT(S_IFCHR) == DT_CHR); +/** + * This macro is used to check if a filesystem operation is available. + * + * TL;DR + * + * @code + * if FileSystemInfo.Ops.op == nullptr + * return -err + * else + * return FileSystemInfo.Ops.op(this->Node, ...); + * @endcode + * + * @param op The operation to check. + * @param err The error to return if the operation is not available. + * @param ... The arguments to pass to the operation. + * + * @return The result of the operation. + */ #define __check_op(op, err, ...) \ if (fsi->Ops.op == nullptr) \ return -err; \