diff options
| author | Mel <mel@rnrd.eu> | 2026-05-06 16:59:17 +0200 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2026-05-06 16:59:17 +0200 |
| commit | c6a1d235b0788a81100c39a7da22b8a4a5626291 (patch) | |
| tree | 06e6ce012d321782e6f41e0769b0e711146e067c | |
| parent | 1c994a9d9129dba6a8a8943d5a8f6ccb47accb2f (diff) | |
| download | catskill-c6a1d235b0788a81100c39a7da22b8a4a5626291.tar.zst catskill-c6a1d235b0788a81100c39a7da22b8a4a5626291.zip | |
Add a few mininmal print functions to catboot core runtime
Signed-off-by: Mel <mel@rnrd.eu>
| -rw-r--r-- | boot/runtime/core.c | 18 |
1 files changed, 17 insertions, 1 deletions
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 <stdio.h>. + 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) \ |
