]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add fr_pair_list_empty() to test for empty lists of fr_pair_ts (#3846)
authorNick Porter <nick@portercomputing.co.uk>
Fri, 15 Jan 2021 14:21:27 +0000 (14:21 +0000)
committerGitHub <noreply@github.com>
Fri, 15 Jan 2021 14:21:27 +0000 (14:21 +0000)
In anticipation of migration to dlists

src/lib/util/pair.h

index a5f9f1490f57f853847b3945227b755d7f87c41b..aeba215f3797d296a0674026875be31872295da2 100644 (file)
@@ -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);