12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #include <stdio.h>
- #include <stdarg.h>
- static
- void
- __printf_send(void *mydata, const char *data, size_t len)
- {
- unsigned i;
- (void)mydata;
- for (i=0; i<len; i++) {
- putchar(data[i]);
- }
- }
- int
- printf(const char *fmt, ...)
- {
- int chars;
- va_list ap;
- va_start(ap, fmt);
- chars = vprintf(fmt, ap);
- va_end(ap);
- return chars;
- }
- int
- vprintf(const char *fmt, va_list ap)
- {
- return __vprintf(__printf_send, NULL, fmt, ap);
- }
|