libluna: Document CString, CType and DebugLog

This commit is contained in:
apio 2023-08-26 12:43:44 +02:00
parent 516d6bc65e
commit 9fd8b10b3f
Signed by: apio
GPG Key ID: B8A7D06E42258954
6 changed files with 73 additions and 1 deletions

View File

@ -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 #pragma once
#include <luna/Types.h> #include <luna/Types.h>

View File

@ -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 #pragma once
inline constexpr int _isascii(int c) inline constexpr int _isascii(int c)

View File

@ -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 #pragma once
#include <luna/Attributes.h> #include <luna/Attributes.h>
#include <stdarg.h> #include <stdarg.h>
/**
* @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); 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); void dbgln(const char* format, ...) _format(1, 2);

View File

@ -1,6 +1,15 @@
#include <luna/Alloc.h> /**
* @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 <luna/CString.h> #include <luna/CString.h>
#include <luna/CType.h> #include <luna/CType.h>
#include <luna/Heap.h>
extern "C" extern "C"
{ {

View File

@ -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*); typedef void* (*cxa_atexit_func_t)(void*);
struct cxa_atexit_entry struct cxa_atexit_entry

View File

@ -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 <luna/DebugLog.h> #include <luna/DebugLog.h>
void dbgln(const char* format, ...) void dbgln(const char* format, ...)