aboutsummaryrefslogtreecommitdiff
path: root/kern/src/print.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2025-07-24 15:31:31 +0000
committerFelix Morgner <felix.morgner@ost.ch>2025-07-24 15:31:31 +0000
commit4edbe94ce1266c9acc6a695fedf1d2edd4ce11cd (patch)
tree6738e5ab071075c15beccc59b3f79f53477f477d /kern/src/print.cpp
parent2b8fafa2bddc48ddec047de517115c8e65ee61e8 (diff)
downloadteachos-4edbe94ce1266c9acc6a695fedf1d2edd4ce11cd.tar.xz
teachos-4edbe94ce1266c9acc6a695fedf1d2edd4ce11cd.zip
build: factor out kernel API
Diffstat (limited to 'kern/src/print.cpp')
-rw-r--r--kern/src/print.cpp51
1 files changed, 0 insertions, 51 deletions
diff --git a/kern/src/print.cpp b/kern/src/print.cpp
deleted file mode 100644
index 2c8539b..0000000
--- a/kern/src/print.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-
-#include "kern/print.hpp"
-
-#include <string_view>
-
-namespace teachos
-{
- namespace
- {
- constinit auto noop = [](std::string_view) {};
-
- constinit auto current_print_handler = static_cast<print_handler *>(noop);
- constinit auto current_println_handler = static_cast<println_handler *>(noop);
- constinit auto current_print_error_handler = static_cast<print_handler *>(noop);
- constinit auto current_println_error_handler = static_cast<println_handler *>(noop);
- } // namespace
-
- auto print(std::string_view text) -> void { current_print_handler(text); }
- auto println(std::string_view text) -> void { current_println_handler(text); }
- auto print_error(std::string_view text) -> void { current_print_error_handler(text); }
- auto println_error(std::string_view text) -> void { current_println_error_handler(text); }
-
- auto set_print_handler(print_handler handler) -> print_handler *
- {
- auto old = current_print_handler;
- current_print_handler = handler;
- return old;
- }
-
- auto set_println_handler(println_handler handler) -> print_handler *
- {
- auto old = current_println_handler;
- current_println_handler = handler;
- return old;
- }
-
- auto set_print_error_handler(print_handler handler) -> print_handler *
- {
- auto old = current_print_error_handler;
- current_print_error_handler = handler;
- return old;
- }
-
- auto set_println_error_handler(println_handler handler) -> print_handler *
- {
- auto old = current_println_error_handler;
- current_println_error_handler = handler;
- return old;
- }
-
-} // namespace teachos