2 * UCW Library -- Printf on Fastbuf Streams
4 * (c) 2002--2005 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU Lesser General Public License.
11 #include "lib/fastbuf.h"
17 vbprintf(struct fastbuf *b, char *msg, va_list args)
23 len = bdirect_write_prepare(b, &buf);
27 r = vsnprintf(buf, len, msg, args2);
33 bdirect_write_commit(b, buf+r);
46 r = vsnprintf(buf, len, msg, args2);
61 bprintf(struct fastbuf *b, char *msg, ...)
67 res = vbprintf(b, msg, args);
76 struct fastbuf *b = bfdopen_shared(1, 65536);
77 for (int i=0; i<10000; i++)
78 bprintf(b, "13=%d str=<%s> msg=%m\n", 13, "str");