2 * UCW Library -- Printf on Fastbuf Streams
4 * (c) 2002 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"
16 vbprintf(struct fastbuf *b, char *msg, va_list args)
21 len = bdirect_write_prepare(b, &buf);
24 r = vsnprintf(buf, len, msg, args);
29 bdirect_write_commit(b, buf+r);
41 r = vsnprintf(buf, len, msg, args);
55 bprintf(struct fastbuf *b, char *msg, ...)
61 res = vbprintf(b, msg, args);
70 struct fastbuf *b = bfdopen_shared(1, 65536);
71 for (int i=0; i<10000; i++)
72 bprintf(b, "13=%d str=<%s> msg=%m\n", 13, "str");