This source file includes following definitions.
- pcmk__subtract_lists
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11 #include <crm/common/lists_internal.h>
12
13 GList*
14 pcmk__subtract_lists(GList *from, const GList *items, GCompareFunc cmp)
15 {
16 GList *result = g_list_copy(from);
17
18 for (const GList *item = items; item != NULL; item = item->next) {
19 GList *match = g_list_find_custom(result, item->data, cmp);
20
21 if (match != NULL) {
22 result = g_list_remove(result, match->data);
23 }
24 }
25
26 return result;
27 }