X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fcommon%2Fstring-utils%2Fstring-utils.h;h=55deba38b50369fe6f28fc4faea60c7ba22fd159;hb=5b770521bbf951df78c52ea4c2b7cf9e0dc1bd5e;hp=9d287f3d9b4f7aa0849d4ecb42c1a7ef211f5ea1;hpb=e9afa78ade64ab725959e934a55165fc81f37380;p=lttng-tools.git diff --git a/src/common/string-utils/string-utils.h b/src/common/string-utils/string-utils.h index 9d287f3d9..55deba38b 100644 --- a/src/common/string-utils/string-utils.h +++ b/src/common/string-utils/string-utils.h @@ -34,4 +34,15 @@ void strutils_free_null_terminated_array_of_strings(char **array); LTTNG_HIDDEN 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. + */ +LTTNG_HIDDEN +int strutils_append_str(char **str, const char *append); + #endif /* _STRING_UTILS_H */