diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-05-15 00:18:27 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-05-15 14:58:17 -0600 |
commit | 3faaad9fe1f11cfe5699c6720c897bfddc7cf49a (patch) | |
tree | f15758869c758eeeb7604afc5c03e8d7601d8315 /libfmt/libmisc.c | |
parent | 9c0338b1b4495457659157e1e9f47d422dcefc2e (diff) |
Begone with the printf variants of the log functions
Diffstat (limited to 'libfmt/libmisc.c')
-rw-r--r-- | libfmt/libmisc.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/libfmt/libmisc.c b/libfmt/libmisc.c index 552b916..4d3724b 100644 --- a/libfmt/libmisc.c +++ b/libfmt/libmisc.c @@ -4,39 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <stdarg.h> /* for va_list, va_start(), va_end() */ -#include <stdio.h> /* for vprintf(), putchar(), fflush() */ -#if LIB_PICO_STDIO -#include <pico/stdio.h> /* for stdio_putchar_raw() */ -#endif - -#include <libmisc/macro.h> /* for LM_UNUSED() */ -#include <libmisc/_intercept.h> /* for __lm_printf() */ - #include <libfmt/fmt.h> /* for fmt_vfctprintf() */ -#if !LIB_PICO_STDIO -static void libfmt_libc_fct(char character, void *LM_UNUSED(arg)) { - putchar(character); -} -#endif - -size_t __lm_printf(const char *format, ...) { - va_list va; - va_start(va, format); -#if LIB_PICO_STDIO - /* pico_stdio has already intercepted vprintf for us, and - * their stdio_buffered_printer() is better than our - * libfmt_libc_fct() because buffering. */ - size_t ret = (size_t) vprintf(format, va); -#else - size_t ret = (size_t) fmt_vfctprintf(libfmt_libc_fct, NULL, format, va); - fflush(stdout); -#endif - va_end(va); - return ret; -} - static void libfmt_conv_formatter(struct fmt_state *state) { lo_interface fmt_formatter obj = va_arg(*state->args, lo_interface fmt_formatter); LO_CALL(obj, format, state); |