diff --git a/libluna/include/luna/CString.h b/libluna/include/luna/CString.h index b7ee966f..e7be629a 100644 --- a/libluna/include/luna/CString.h +++ b/libluna/include/luna/CString.h @@ -1,3 +1,12 @@ +/** + * @file CString.h + * @author apio (cloudapio.eu) + * @brief Implementations of C-string and memory manipulation functions. + * + * @copyright Copyright (c) 2022-2023, the Luna authors. + * + */ + #pragma once #include diff --git a/libluna/include/luna/CType.h b/libluna/include/luna/CType.h index 91994286..0f5c74e5 100644 --- a/libluna/include/luna/CType.h +++ b/libluna/include/luna/CType.h @@ -1,3 +1,13 @@ +/** + * @file CType.h + * @author apio (cloudapio.eu) + * @brief Implementations of C-like character classification functions, prefixed with an underscore to avoid conflicting + * with libc. + * + * @copyright Copyright (c) 2022-2023, the Luna authors. + * + */ + #pragma once inline constexpr int _isascii(int c) diff --git a/libluna/include/luna/DebugLog.h b/libluna/include/luna/DebugLog.h index 0f78aa53..b44ea231 100644 --- a/libluna/include/luna/DebugLog.h +++ b/libluna/include/luna/DebugLog.h @@ -1,7 +1,33 @@ +/** + * @file DebugLog.h + * @author apio (cloudapio.eu) + * @brief Debug logging for platform-agnostic functions. + * + * @copyright Copyright (c) 2022-2023, the Luna authors. + * + */ + #pragma once #include #include +/** + * @brief The actual debug log implementation. This must be provided by the platform or user. + * + * In the kernel, the implementation is located in src/Log.cpp. + * For POSIX systems, libluna provides an implementation in src/ImplPOSIX.cpp. + * + * The printed message must be followed by an implicit newline. + * + * @param format The format string (in the style of printf). + * @param ap The variadic argument list. + */ extern void debug_log_impl(const char* format, va_list ap); +/** + * @brief Log a formatted message. + * + * @param format The format string (in the style of printf). + * @param ... The format arguments. + */ void dbgln(const char* format, ...) _format(1, 2); diff --git a/libluna/src/CString.cpp b/libluna/src/CString.cpp index b4ffd864..84a1f379 100644 --- a/libluna/src/CString.cpp +++ b/libluna/src/CString.cpp @@ -1,6 +1,15 @@ -#include +/** + * @file CString.cpp + * @author apio (cloudapio.eu) + * @brief Implementations of C-string and memory manipulation functions. + * + * @copyright Copyright (c) 2022-2023, the Luna authors. + * + */ + #include #include +#include extern "C" { diff --git a/libluna/src/CppABI.cpp b/libluna/src/CppABI.cpp index 53fdc4bd..022dc153 100644 --- a/libluna/src/CppABI.cpp +++ b/libluna/src/CppABI.cpp @@ -1,3 +1,12 @@ +/** + * @file CppABI.cpp + * @author apio (cloudapio.eu) + * @brief Implementation of some C++ ABI internal functions, mainly __cxa_atexit. + * + * @copyright Copyright (c) 2023, the Luna authors. + * + */ + typedef void* (*cxa_atexit_func_t)(void*); struct cxa_atexit_entry diff --git a/libluna/src/DebugLog.cpp b/libluna/src/DebugLog.cpp index c926390c..82a6cc51 100644 --- a/libluna/src/DebugLog.cpp +++ b/libluna/src/DebugLog.cpp @@ -1,3 +1,12 @@ +/** + * @file DebugLog.cpp + * @author apio (cloudapio.eu) + * @brief Debug logging for platform-agnostic functions. + * + * @copyright Copyright (c) 2022-2023, the Luna authors. + * + */ + #include void dbgln(const char* format, ...)