+
+int wrbuf_puts(WRBUF b, const char *buf)
+{
+ wrbuf_write(b, buf, strlen(buf)+1); /* '\0'-terminate as well */
+ (b->pos)--; /* don't include '\0' in count */
+ return 0;
+}
+
+void wrbuf_printf(WRBUF b, const char *fmt, ...)
+{
+ va_list ap;
+ char buf[4096];
+
+ va_start(ap, fmt);
+#ifdef WIN32
+ _vsnprintf(buf, sizeof(buf)-1, fmt, ap);
+#else
+/* !WIN32 */
+#if HAVE_VSNPRINTF
+ vsnprintf(buf, sizeof(buf)-1, fmt, ap);
+#else
+ vsprintf(buf, fmt, ap);
+#endif
+#endif
+ wrbuf_puts (b, buf);
+
+ va_end(ap);
+}
+