#include "printf.h" #include #include #include struct out_tty_args { struct fx_tty *tty; enum fx_tty_print_flags flags; bool format_ch; }; static void out_tty(char c, void *argp) { if (c == 0) { return; } struct out_tty_args *args = argp; enum fx_tty_print_flags flags = args->flags; if (!args->format_ch && (flags & FX_TTY_DISABLE_INTERPOLATED_FORMATTING)) { flags |= FX_TTY_DISABLE_FORMATTING; } fx_tty_putc(args->tty, flags, c); } extern int z__fx_fctprintf( void (*out)(char c, void *extra_arg), void *extra_arg, const char *format, va_list arg); int fx_tty_vprintf( struct fx_tty *tty, enum fx_tty_print_flags flags, const char *format, va_list args) { struct out_tty_args tty_args = { .flags = flags, .tty = tty, }; const int ret = z__fx_fctprintf(out_tty, &tty_args, format, args); return ret; }