Files
photon/libc/stdio/vfprintf.c

20 lines
362 B
C
Raw Normal View History

2020-04-03 19:21:22 +01:00
#include <stdio.h>
#include "__printf.h"
static void _out_file(struct __printf_backend *bk, char ch)
{
FILE *fp = bk->arg;
if (ch) {
fputc(ch, fp);
}
}
int vfprintf(FILE *fp, const char *restrict format, va_list arg)
{
struct __printf_backend bk = {};
bk.out = _out_file;
bk.arg = fp;
return __xprintf(&bk, format, arg);
}