]> git.sur5r.net Git - cc65/blob - libsrc/common/vcprintf.c
This commit was generated by cvs2svn to compensate for changes in r2,
[cc65] / libsrc / common / vcprintf.c
1 /*
2  * vcprintf.c
3  *
4  * Ullrich von Bassewitz, 11.08.1998
5  */
6
7
8
9 #include <stdarg.h>
10 #include <conio.h>
11 #include "_printf.h"
12
13
14
15 static void out (struct outdesc* d, char* buf, unsigned count)
16 /* Routine used for writing */
17 {
18     /* Fast screen output */
19     d->ccount += count;
20     while (count) {
21         cputc (*buf);
22         ++buf;
23         --count;
24     }
25 }
26
27
28
29 int vcprintf (char* format, va_list ap)
30 {
31     struct outdesc d;
32
33     /* Setup descriptor */
34     d.fout = out;
35
36     /* Do formatting and output */
37     _printf (&d, format, ap);
38
39     /* Return bytes written */
40     return d.ccount;
41 }
42
43
44