From aad813390ed6062f65ee89be47c214481e3ae5bd Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Fri, 9 Dec 2022 07:27:31 +0400 Subject: [PATCH] Add func "drivers_console_vprintf" --- include/drivers/console.h | 2 ++ src/console.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/drivers/console.h b/include/drivers/console.h index d8e108e..0ff2353 100644 --- a/include/drivers/console.h +++ b/include/drivers/console.h @@ -5,6 +5,7 @@ extern "C" { #endif +#include #include void drivers_console_putc(char c); @@ -15,6 +16,7 @@ void drivers_console_write(const char *data, size_t size); __attribute__((format(printf, 1, 2))) void drivers_console_printf(const char *format, ...); +void drivers_console_vprintf(const char *format, va_list va); #ifdef __cplusplus } diff --git a/src/console.c b/src/console.c index 42ff732..d4f5801 100644 --- a/src/console.c +++ b/src/console.c @@ -32,7 +32,7 @@ void drivers_console_print(const char *const s) } } -void drivers_console_printf(const char *format, ...) +void drivers_console_printf(const char *const format, ...) { va_list va; va_start(va, format); @@ -40,6 +40,11 @@ void drivers_console_printf(const char *format, ...) va_end(va); } +void drivers_console_vprintf(const char *const format, va_list va) +{ + kernaux_vfprintf(file_putc, NULL, format, va); +} + void drivers_console_puts(const char *const s) { drivers_console_print(s);