diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2020-05-26 02:44:21 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2020-05-26 22:30:49 +0200 |
commit | dacac990f94cd820724cdfae124a4b5274668263 (patch) | |
tree | fe0ad2bd557c4208d8719aad336cadc79d051a9a | |
parent | 512bf02e41bd7e4cbd3ce7a066fd77cedd0fa7c5 (diff) |
api doc: clarify OSMO_NAME_C_IMPL() required FUNC_BUF signature
Change-Id: Ibe722d38d28e5590a35e856dd15c2538e6ee0a3e
-rw-r--r-- | include/osmocom/core/utils.h | 4 |
1 files changed, 3 insertions, 1 deletions
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...) \ |