diff options
author | Anton Kling <anton@kling.gg> | 2024-06-17 22:07:38 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-06-17 22:07:38 +0200 |
commit | f209faffab90186cd88cd0a2fe2cc6236bb53e15 (patch) | |
tree | 68194363c25900f5d349c8ae34d42be9ae638df8 /kernel/libc/stdio | |
parent | 08d0b7eee74b9f345241faad460d145bb0454736 (diff) |
Reorganize logging code
Diffstat (limited to 'kernel/libc/stdio')
-rw-r--r-- | kernel/libc/stdio/print.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/libc/stdio/print.c b/kernel/libc/stdio/print.c index 93393ee..e8b245f 100644 --- a/kernel/libc/stdio/print.c +++ b/kernel/libc/stdio/print.c @@ -1,7 +1,6 @@ -#include "../../drivers/serial.h" -#include "../include/assert.h" -#include "../include/stdio.h" -#include <stdarg.h> +#include <assert.h> +#include <drivers/serial.h> +#include <stdio.h> #define TAB_SIZE 8 @@ -55,11 +54,8 @@ int kprint_int(int num) { return c; } -int kprintf(const char *format, ...) { +int vkprintf(const char *format, va_list list) { int c = 0; - va_list list; - va_start(list, format); - const char *s = format; for (; *s; s++) { if ('%' != *s) { @@ -101,6 +97,10 @@ int kprintf(const char *format, ...) { return c; } -int puts(char *str) { - return kprintf("%s\n", str); +int kprintf(const char *format, ...) { + va_list list; + va_start(list, format); + int rc = vkprintf(format, list); + va_end(list); + return rc; } |