pacemaker  2.1.0-7c3f660
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
lists.c
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2020 the Pacemaker project contributors
3  *
4  * The version control history for this file may have further details.
5  *
6  * This source code is licensed under the GNU Lesser General Public License
7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8  */
9 
10 #include <crm_internal.h>
12 
13 GList*
14 pcmk__subtract_lists(GList *from, GList *items, GCompareFunc cmp)
15 {
16  GList *item = NULL;
17  GList *result = g_list_copy(from);
18 
19  for (item = items; item != NULL; item = item->next) {
20  GList *candidate = NULL;
21 
22  for (candidate = from; candidate != NULL; candidate = candidate->next) {
23  if(cmp(candidate->data, item->data) == 0) {
24  result = g_list_remove(result, candidate->data);
25  break;
26  }
27  }
28  }
29 
30  return result;
31 }
GList * pcmk__subtract_lists(GList *from, GList *items, GCompareFunc cmp)
Definition: lists.c:14