From dacac990f94cd820724cdfae124a4b5274668263 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 26 May 2020 02:44:21 +0200 Subject: api doc: clarify OSMO_NAME_C_IMPL() required FUNC_BUF signature Change-Id: Ibe722d38d28e5590a35e856dd15c2538e6ee0a3e --- include/osmocom/core/utils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 40f44468..e6377867 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -297,7 +297,9 @@ bool osmo_str_startswith(const char *str, const char *startswith_str); * \param[in] INITIAL_BUFSIZE Which size to first talloc from ctx -- a larger size makes a reallocation less likely, a * smaller size allocates less unused bytes, zero allocates once but still runs the string composition twice. * \param[in] ON_ERROR String constant to copy on error rc returned by FUNC_BUF, or NULL to return NULL. - * \param[in] FUNC_BUF Name of a function with signature foo_buf(char *buf, size_t buflen, ...). + * \param[in] FUNC_BUF Name of a function with signature int foo_buf(char *buf, size_t buflen, ...). + * The function must return the strlen() that it would write to a sufficiently large buffer or + * negative on error, like snprintf(). * \param[in] FUNC_BUF_ARGS Additional arguments to pass to FUNC_BUF after the buf and buflen. */ #define OSMO_NAME_C_IMPL(CTX, INITIAL_BUFSIZE, ON_ERROR, FUNC_BUF, FUNC_BUF_ARGS...) \ -- cgit v1.2.3