From 2d2e2cca0dc1d62addc9c9fcb3a59f343fc3baf6 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 25 Apr 2016 12:11:20 +0200 Subject: Update doxygen annotations in libosmocore This adds and improves doxygen API descriptions all over libosmocore, reducing the 'white spots' that don't have any documentation. --- include/osmocom/core/utils.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/osmocom/core/utils.h') diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 205fa283..27e1e188 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -53,6 +53,11 @@ do { \ rem -= ret; \ } while (0) +/*! Helper macro to terminate when an assertion failes + * \param[in] exp Predicate to verify + * This function will generate a backtrace and terminate the program if + * the predicate evaluates to false (0). + */ #define OSMO_ASSERT(exp) \ if (!(exp)) { \ fprintf(stderr, "Assert failed %s %s:%d\n", #exp, __FILE__, __LINE__); \ @@ -60,6 +65,10 @@ do { \ abort(); \ } +/*! duplicate a string using talloc and release its prior content (if any) + * \param[in] ctx Talloc context to use for allocation + * \param[out] dst pointer to string, will be updated with ptr to new string + * \param[in] newstr String that will be copieed to newly allocated string */ static inline void osmo_talloc_replace_string(void *ctx, char **dst, char *newstr) { if (*dst) -- cgit v1.2.3