X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fstring-utils%2Fstring-utils.h;h=8f47abbc302109131fbc52704949d6c4447c66e6;hb=4ff750609549a99f6b318ce600c42c90d4f2e480;hp=1cf31e9d4b97df486ec1b0a1a0ec1d107f8562ba;hpb=d22ba1ec0497c9dbea3d7263d553be3547dfbe9f;p=lttng-tools.git diff --git a/src/common/string-utils/string-utils.h b/src/common/string-utils/string-utils.h index 1cf31e9d4..8f47abbc3 100644 --- a/src/common/string-utils/string-utils.h +++ b/src/common/string-utils/string-utils.h @@ -27,4 +27,14 @@ void strutils_free_null_terminated_array_of_strings(char **array); size_t strutils_array_of_strings_len(char * const *array); +/* + * Append `append` to the malloc-end string `str`. + * + * On success, `str` is free'd (if not NULL) and assigned a new malloc-ed + * string. On failure, `str` is not modified. + * + * Return 0 on success, -ENOMEM on failure. + */ +int strutils_append_str(char **str, const char *append); + #endif /* _STRING_UTILS_H */