From 16e00bada0feb77fa95e3c8d596ab8131cac633c Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 17 Dec 2022 12:43:29 +0100 Subject: [PATCH] Add comments to Format.h --- luna/include/luna/Format.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/luna/include/luna/Format.h b/luna/include/luna/Format.h index c44218d7..28ffd1cd 100644 --- a/luna/include/luna/Format.h +++ b/luna/include/luna/Format.h @@ -6,7 +6,14 @@ typedef Result (*callback_t)(char, void*); typedef void (*pure_callback_t)(char, void*); +// Used to format anything that can fail (writing to C FILEs, etc...) Result cstyle_format(const char* format, callback_t callback, void* arg, va_list ap); + +// Used to format anything that cannot fail (formatting to a string, writing to the serial port (kernel-only)) usize pure_cstyle_format(const char* format, pure_callback_t callback, void* arg, va_list ap); + +// Convenience function which outputs into a fixed-size buffer (not unlike vsnprintf) usize vstring_format(char* buf, usize max, const char* format, va_list ap); + +// Convenience function which outputs into a fixed-size buffer (not unlike snprintf) usize string_format(char* buf, usize max, const char* format, ...); \ No newline at end of file