Commit 811c3da2 811c3da231c46d3a5696961f55b596efa679a9eb by Sergey Poznyakoff

(util_slist_remove): New function.

1 parent 29ff187a
...@@ -741,6 +741,25 @@ util_slist_add (list_t *list, char *value) ...@@ -741,6 +741,25 @@ util_slist_add (list_t *list, char *value)
741 list_append (*list, p); 741 list_append (*list, p);
742 } 742 }
743 743
744 static int
745 comp (const void *item, const void *data)
746 {
747 return strcmp ((char*)item, (char*)data);
748 }
749
750 void
751 util_slist_remove (list_t *list, char *value)
752 {
753 char *p;
754 list_comparator_t cp;
755
756 if (!*list)
757 return;
758 cp = list_set_comparator (*list, comp);
759 list_remove (*list, value);
760 list_set_comparator (*list, cp);
761 }
762
744 void 763 void
745 util_slist_destroy (list_t *list) 764 util_slist_destroy (list_t *list)
746 { 765 {
......