From 422e326cbaa5e04163d1895b287013e2791acb26 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 30 Mar 2018 17:42:32 +0200 Subject: [PATCH] shared: add nm_c_list_contains_entry() helper --- shared/nm-utils/nm-c-list.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shared/nm-utils/nm-c-list.h b/shared/nm-utils/nm-c-list.h index 8352711899..5e0bf102cc 100644 --- a/shared/nm-utils/nm-c-list.h +++ b/shared/nm-utils/nm-c-list.h @@ -26,6 +26,13 @@ /*****************************************************************************/ +#define nm_c_list_contains_entry(list, what, member) \ + ({ \ + typeof (what) _what = (what); \ + \ + _what && c_list_contains (list, &_what->member); \ + }) + typedef struct { CList lst; void *data;