summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-03-30 17:42:32 +0200
committerThomas Haller <thaller@redhat.com>2018-04-05 17:45:30 +0200
commit422e326cbaa5e04163d1895b287013e2791acb26 (patch)
treed8fa7ae49a6765654170a66c875d841441144546 /shared
parent011258a086d3c050d7856addf4fe887e443a53fb (diff)
downloadNetworkManager-422e326cbaa5e04163d1895b287013e2791acb26.tar.gz
shared: add nm_c_list_contains_entry() helper
Diffstat (limited to 'shared')
-rw-r--r--shared/nm-utils/nm-c-list.h7
1 files changed, 7 insertions, 0 deletions
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;