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 #ifdef CONFIG_UCW_CLEAN_ABI
14 #define bb_printf ucw_bb_printf
15 #define bb_printf_at ucw_bb_printf_at
16 #define bb_vprintf ucw_bb_vprintf
17 #define bb_vprintf_at ucw_bb_vprintf_at
20 #define GBUF_TYPE byte
21 #define GBUF_PREFIX(x) bb_##x
25 * printf() into a growing buffer with `va_list` arguments.
26 * Generates a `'\0'`-terminated string at the beginning of the buffer
27 * and returns pointer to it.
31 char *bb_vprintf(bb_t *bb, const char *fmt, va_list args);
33 * printf() into a growing buffer.
34 * Generates a `'\0'`-terminated string at the beginning of the buffer
35 * and returns pointer to it.
39 char *bb_printf(bb_t *bb, const char *fmt, ...);
41 * Like @bb_vprintf(), but it does not start at the beginning of the
42 * buffer, but @ofs bytes further.
44 * Returns pointer to the new string (eg. @ofs bytes after the
45 * beginning of buffer).
47 char *bb_vprintf_at(bb_t *bb, uns ofs, const char *fmt, va_list args);
49 * Like @bb_vprintf_at(), but it takes individual arguments.
51 char *bb_printf_at(bb_t *bb, uns ofs, const char *fmt, ...);