From c6a1d235b0788a81100c39a7da22b8a4a5626291 Mon Sep 17 00:00:00 2001 From: Mel Date: Wed, 6 May 2026 16:59:17 +0200 Subject: Add a few mininmal print functions to catboot core runtime Signed-off-by: Mel --- boot/runtime/core.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/boot/runtime/core.c b/boot/runtime/core.c index f6c4ef8..e377e0a 100644 --- a/boot/runtime/core.c +++ b/boot/runtime/core.c @@ -71,6 +71,22 @@ panic(const ascii* message, ...) exit(EXIT_FAILURE); } +// minimal print helpers for plain c-strings. +// TODO: de-c-stringify catboot, no c-strings should be exposed anywhere. +void +print(const ascii* s) +{ + fputs(s, stdout); +} + +void +println(const ascii* s) +{ + puts(s); +} + +// `printf` is already linked in via . + void* allocate(size_t size) { @@ -360,7 +376,7 @@ array_append(struct _Array* a, struct _Array* b) } #define ARRAY_FREE_ELEMENTS(type, array, free_action) \ - FOR_EACH_ARRAY(type, array, { free_action(element); }) + FOR_EACH_ARRAY (type, array, { free_action(element); }) // a macro for iterating over a range of elements in an array. #define FOR_EACH_IN_RANGE(type, array, start, end, action) \ -- cgit 1.4.1