2000-05-28 13:40:48 +00:00
|
|
|
/*
|
|
|
|
* vcprintf.c
|
|
|
|
*
|
|
|
|
* Ullrich von Bassewitz, 11.08.1998
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <conio.h>
|
|
|
|
#include "_printf.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-08-14 22:16:40 +00:00
|
|
|
static void out (struct outdesc* d, const char* buf, unsigned count)
|
2000-05-28 13:40:48 +00:00
|
|
|
/* Routine used for writing */
|
|
|
|
{
|
|
|
|
/* Fast screen output */
|
|
|
|
d->ccount += count;
|
|
|
|
while (count) {
|
|
|
|
cputc (*buf);
|
|
|
|
++buf;
|
|
|
|
--count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-08-13 16:16:49 +00:00
|
|
|
int vcprintf (const char* format, va_list ap)
|
2000-05-28 13:40:48 +00:00
|
|
|
{
|
|
|
|
struct outdesc d;
|
|
|
|
|
|
|
|
/* Setup descriptor */
|
|
|
|
d.fout = out;
|
|
|
|
|
|
|
|
/* Do formatting and output */
|
|
|
|
_printf (&d, format, ap);
|
|
|
|
|
|
|
|
/* Return bytes written */
|
|
|
|
return d.ccount;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|