X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftal%2Fstr%2Fstr.h;h=f2a694896c6aa89deed462278a70c7aa41307e32;hp=4a6c474a4428a3e79998d1168b09e8c28d2f57a9;hb=e7ae27d64226dda9865f1e4b5d9a55adcee04694;hpb=4710a92838fc03ffa54ce2bc60cf0e214c97a199 diff --git a/ccan/tal/str/str.h b/ccan/tal/str/str.h index 4a6c474a..f2a69489 100644 --- a/ccan/tal/str/str.h +++ b/ccan/tal/str/str.h @@ -39,6 +39,25 @@ char *tal_fmt(const tal_t *ctx, const char *fmt, ...) PRINTF_FMT(2,3); char *tal_vfmt(const tal_t *ctx, const char *fmt, va_list ap) PRINTF_FMT(2,0); +/** + * tal_append_fmt - append a formatted string to a talloc string. + * @baseptr: a pointer to the tal string to be appended to. + * @fmt: the printf-style format (can be take()). + * + * Returns false on allocation failure. + */ +bool tal_append_fmt(char **baseptr, const char *fmt, ...) PRINTF_FMT(2,3); + +/** + * tal_append_vfmt - append a formatted string to a talloc string (va_list) + * @baseptr: a pointer to the tal string to be appended to. + * @fmt: the printf-style format (can be take()). + * @va: the va_list containing the format args. + * + * Returns false on allocation failure. + */ +bool tal_append_vfmt(char **baseptr, const char *fmt, va_list ap); + /** * tal_strcat - join two strings together * @ctx: NULL, or tal allocated object to be parent.