Function stdio_usfprintf

Function Documentation

int stdio_usfprintf(void (*out)(int c, void *extra_arg), void *extra_arg, const char *format, ...)

printf/vprintf with user-specified output function

An alternative to stdio_printf(), in which the output function is specified dynamically (usf=User Specified Function), rather than stdio_putchar() being used.

Parameters:
  • out – An output function which takes one character and a type-erased additional parameters.

  • extra_arg – The type-erased argument to pass to the output function out with each call.

  • format – A string specifying the format of the output, with %-marked specifiers of how to interpret additional arguments.

  • ... – Additional arguments to the function, one for each specifier in format.

Returns:

The number of characters for which the output f unction was invoked, not counting the terminating null character.