From: Nick Porter Date: Fri, 15 Jan 2021 14:21:27 +0000 (+0000) Subject: Add fr_pair_list_empty() to test for empty lists of fr_pair_ts (#3846) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=87a504089a7f24988ecb1e8960da522c797b07c1;p=thirdparty%2Ffreeradius-server.git Add fr_pair_list_empty() to test for empty lists of fr_pair_ts (#3846) In anticipation of migration to dlists --- diff --git a/src/lib/util/pair.h b/src/lib/util/pair.h index a5f9f1490f5..aeba215f379 100644 --- a/src/lib/util/pair.h +++ b/src/lib/util/pair.h @@ -184,6 +184,15 @@ void fr_pair_list_verify(char const *file, int line, TALLOC_CTX const *expected */ #define fr_pair_list_single_value(_list, _vp) (_list = &_vp) +/** Function to detect empty pair_list + * + * Returns true for empty lists. + */ +static inline bool fr_pair_list_empty(fr_pair_list_t const *list) +{ + return (!*list); +} + /* Allocation and management */ fr_pair_t *fr_pair_alloc_null(TALLOC_CTX *ctx);