diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2020-10-08 08:41:22 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2020-10-08 11:24:24 +0200 |
| commit | c862d84d0b6827106a53bc571c81eb523b05c50f (patch) | |
| tree | 1583dabc26fd09226f9032e218e06fa022704154 /include | |
| parent | 8bd1123857aef03c9aefb0658e3a8a562984a52e (diff) | |
Add dynstr_vprepend
Diffstat (limited to 'include')
| -rw-r--r-- | include/dynstr.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/dynstr.h b/include/dynstr.h index 2c36865..38c05c5 100644 --- a/include/dynstr.h +++ b/include/dynstr.h @@ -135,6 +135,19 @@ enum dynstr_err dynstr_vappend(struct dynstr *d, const char *format, va_list ap) enum dynstr_err dynstr_prepend(struct dynstr *d, const char *format, ...); /** + * This function takes a string literal in printf format and a variable + * argument list, calculates its size and prepends it into the beginning of the + * dynamic string. + * @param d Dynamic string where new string will be prepended. + * @param format String literal in printf format. + * @param ap Variable argument list. + * @return Returns one of the following error codes: + * # DYNSTR_OK if successful. + * # DYNSTR_ERR_ALLOC if no more memory is available. + */ +enum dynstr_err dynstr_vprepend(struct dynstr *d, const char *format, va_list ap); + +/** * This function duplicates a dynamic string to another instance. * @attention Destination instance must be initialized before calling * this function. |
