diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2025-07-14 16:02:43 +0000 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2025-07-14 16:02:43 +0000 |
| commit | 25483b7af8df6b08d460f807fda04c6d409bd44e (patch) | |
| tree | 2001f9774fe179dd4a67c77f590aa7ee1406fb87 /kern/include | |
| parent | 1b603d1145b9ee10b1b12a0f765bd2bc1ebe2b3c (diff) | |
| download | teachos-25483b7af8df6b08d460f807fda04c6d409bd44e.tar.xz teachos-25483b7af8df6b08d460f807fda04c6d409bd44e.zip | |
ide: start large-scale restructuring
Diffstat (limited to 'kern/include')
| -rw-r--r-- | kern/include/kern/error.hpp | 13 | ||||
| -rw-r--r-- | kern/include/kern/print.hpp | 26 |
2 files changed, 39 insertions, 0 deletions
diff --git a/kern/include/kern/error.hpp b/kern/include/kern/error.hpp new file mode 100644 index 0000000..e58b9f1 --- /dev/null +++ b/kern/include/kern/error.hpp @@ -0,0 +1,13 @@ +#ifndef TEACHOS_KERN_ERROR_HPP +#define TEACHOS_KERN_ERROR_HPP + +#include <source_location> +#include <string_view> + +namespace teachos +{ + [[noreturn]] + auto panic(std::string_view message, std::source_location = std::source_location::current()) -> void; +} + +#endif diff --git a/kern/include/kern/print.hpp b/kern/include/kern/print.hpp new file mode 100644 index 0000000..fc9b5d6 --- /dev/null +++ b/kern/include/kern/print.hpp @@ -0,0 +1,26 @@ + +#ifndef TEACHOS_KERN_PRINT_HPP +#define TEACHOS_KERN_PRINT_HPP + +#include <string_view> + +namespace teachos +{ + + using print_handler = auto(std::string_view) -> void; + using println_handler = auto(std::string_view) -> void; + + auto print(std::string_view text) -> void; + auto println(std::string_view text) -> void; + + auto print_error(std::string_view text) -> void; + auto println_error(std::string_view text) -> void; + + auto set_print_handler(print_handler handler) -> print_handler *; + auto set_println_handler(println_handler handler) -> print_handler *; + auto set_print_error_handler(print_handler handler) -> print_handler *; + auto set_println_error_handler(println_handler handler) -> print_handler *; + +} // namespace teachos + +#endif |
