X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fstring-utils%2Fstring-utils.h;h=3cafa0f8a91fddb38b7d72dd353f324617ecc34d;hb=c922647daed3dd022be11980063b5fb816d8c091;hp=8f47abbc302109131fbc52704949d6c4447c66e6;hpb=4ff750609549a99f6b318ce600c42c90d4f2e480;p=lttng-tools.git diff --git a/src/common/string-utils/string-utils.h b/src/common/string-utils/string-utils.h index 8f47abbc3..3cafa0f8a 100644 --- a/src/common/string-utils/string-utils.h +++ b/src/common/string-utils/string-utils.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2017 Philippe Proulx * - * SPDX-License-Identifier: GPL-2.0-only + * SPDX-License-Identifier: LGPL-2.1-only * */ @@ -35,6 +35,13 @@ size_t strutils_array_of_strings_len(char * const *array); * * Return 0 on success, -ENOMEM on failure. */ -int strutils_append_str(char **str, const char *append); +C_LINKAGE int strutils_append_str(char **str, const char *append); + +/* + * Like `strutils_append_str`, but the appended string is formatted using + * `fmt` and the following arguments. + */ +C_LINKAGE ATTR_FORMAT_PRINTF(2, 3) +int strutils_appendf(char **s, const char *fmt, ...); #endif /* _STRING_UTILS_H */