36,19 → 36,25 |
#include <printf/printf_core.h> |
#include <putchar.h> |
|
int vprintf_write(const char *str, size_t count, void *unused); |
|
int vprintf_write(const char *str, size_t count, void *unused) |
static int vprintf_write(const char *str, size_t count, void *unused) |
{ |
size_t i = 0; |
for (; i < count; i++) |
size_t i; |
for (i = 0; i < count; i++) |
putchar(str[i]); |
return i; |
} |
|
int puts(const char *s) |
{ |
size_t i; |
for (i = 0; s[i] != 0; i++) |
putchar(s[i]); |
return i; |
} |
|
int vprintf(const char *fmt, va_list ap) |
{ |
struct printf_spec ps = {(int(*)(void *, size_t, void *))vprintf_write, NULL}; |
struct printf_spec ps = {(int(*)(void *, size_t, void *)) vprintf_write, NULL}; |
return printf_core(fmt, &ps, ap); |
|
} |