Do not remap framework assembly if it's version is higher than the runtime version
[mono.git] / eglib / src / glist.c
index 535008e1fe9a078d1a505cfd80b7f0be506f82b5..882fda48ec9b75772bd8f780d2f1fbef9266ab54 100644 (file)
@@ -125,6 +125,25 @@ g_list_remove (GList *list, gconstpointer data)
        return list;
 }
 
+GList*
+g_list_remove_all (GList *list, gconstpointer data)
+{
+       GList *current = g_list_find (list, data);
+
+       if (!current)
+               return list;
+
+       while (current) {
+               if (current == list)
+                       list = list->next;
+               g_list_free_1 (disconnect_node (current));
+
+               current = g_list_find (list, data);
+       }
+
+       return list;
+}
+
 GList*
 g_list_remove_link (GList *list, GList *link)
 {
@@ -160,6 +179,22 @@ g_list_find (GList *list, gconstpointer data)
        return NULL;
 }
 
+GList*
+g_list_find_custom (GList *list, gconstpointer data, GCompareFunc func)
+{
+       if (!func)
+               return NULL;
+       
+       while (list) {
+               if (func (list->data, data) == 0)
+                       return list;
+               
+               list = list->next;
+       }
+       
+       return NULL;
+}
+
 GList*
 g_list_reverse (GList *list)
 {
@@ -205,7 +240,8 @@ g_list_insert_sorted (GList *list, gpointer data, GCompareFunc func)
 {
        GList *prev = NULL;
        GList *current;
-       
+       GList *node;
+
        if (!func)
                return list;
 
@@ -216,7 +252,7 @@ g_list_insert_sorted (GList *list, gpointer data, GCompareFunc func)
                prev = current;
        }
 
-       GList *node = new_node (prev, data, current);
+       node = new_node (prev, data, current);
        return list == current ? node : list;
 }