diff options
| author | Xavier Del Campo Romero <xavier.delcampo@orain.io> | 2020-10-06 09:20:57 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavier.delcampo@orain.io> | 2020-10-06 09:20:57 +0200 |
| commit | 8bd1123857aef03c9aefb0658e3a8a562984a52e (patch) | |
| tree | bb7055daa7f1123d45c30890c10bb4bfc130ab81 /include | |
| parent | e0eaf50fdc4a334a59cfa6447d68e7ba9aed6f45 (diff) | |
Add dynstr_vappend
Diffstat (limited to 'include')
| -rw-r--r-- | include/dynstr.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/dynstr.h b/include/dynstr.h index 925423a..2c36865 100644 --- a/include/dynstr.h +++ b/include/dynstr.h @@ -21,6 +21,7 @@ #error C99 support is mandatory for dynstr #endif /* __STDC_VERSION < 199901L */ +#include <stdarg.h> #include <stddef.h> #include <stdbool.h> @@ -110,6 +111,19 @@ enum dynstr_err dynstr_append(struct dynstr *d, const char *format, ...); /** * This function takes a string literal in printf format and a variable + * argument list, calculates its size and concatenates it into the + * dynamic string. + * @param d Dynamic string where new string will be appended. + * @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_vappend(struct dynstr *d, const char *format, va_list ap); + +/** + * This function takes a string literal in printf format and a variable * number of arguments, calculates its size and prepends it into the * beginning of the dynamic string. * @param d Dynamic string where new string will be prepended. |
