summaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/utils.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-04-25 12:11:20 +0200
committerHarald Welte <laforge@gnumonks.org>2016-05-05 18:49:27 +0200
commit2d2e2cca0dc1d62addc9c9fcb3a59f343fc3baf6 (patch)
tree8ec3ba89d486e4c324d32d1980ce68d5118d2db1 /include/osmocom/core/utils.h
parent0996c879255e4653740814112bf98d0ddc93100c (diff)
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.
Diffstat (limited to 'include/osmocom/core/utils.h')
-rw-r--r--include/osmocom/core/utils.h9
1 files changed, 9 insertions, 0 deletions
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)