2 * UCW Library -- A simple growing buffer for byte-sized items.
4 * (c) 2004 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.
13 #define GBUF_TYPE byte
14 #define GBUF_PREFIX(x) bb_##x
18 * printf() into a growing buffer with `va_list` arguments.
19 * Generates a `'\0'`-terminated string at the beginning of the buffer
20 * and returns pointer to it.
24 char *bb_vprintf(bb_t *bb, const char *fmt, va_list args);
26 * printf() into a growing buffer.
27 * Generates a `'\0'`-terminated string at the beginning of the buffer
28 * and returns pointer to it.
32 char *bb_printf(bb_t *bb, const char *fmt, ...);
34 * Like @bb_vprintf(), but it does not start at the beginning of the
35 * buffer, but @ofs bytes further.
37 * Returns pointer to the new string (eg. @ofs bytes after the
38 * beginning of buffer).
40 char *bb_vprintf_at(bb_t *bb, uns ofs, const char *fmt, va_list args);
42 * Like @bb_vprintf_at(), but it takes individual arguments.
44 char *bb_printf_at(bb_t *bb, uns ofs, const char *fmt, ...);