From b86c496307b2b284fabb1a33490163a78aeeb831 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 12 Oct 2006 07:54:47 +0000 Subject: Remove slist_insert_before as it is not needed anymore --- common/list.c | 30 ------------------------------ common/list.h | 2 -- 2 files changed, 32 deletions(-) diff --git a/common/list.c b/common/list.c index 65d83295..827f1789 100644 --- a/common/list.c +++ b/common/list.c @@ -70,36 +70,6 @@ struct slist *slist_prepend(struct slist *list, void *data) return entry; } -struct slist *slist_insert_before(struct slist *list, struct slist *sibling, void *data) -{ - struct slist *entry, *prev, *cur; - - entry = malloc(sizeof(struct slist)); - if (!entry) - return list; - - entry->data = data; - entry->next = NULL; - - if (!list) - return entry; - - for (cur = list, prev = NULL; cur != NULL; prev = cur, cur = prev->next) { - if (cur == sibling) - break; - } - - if (!prev) { - entry->next = list; - return entry; - } - - entry->next = prev->next; - prev->next = entry; - - return list; -} - struct slist *slist_insert_sorted(struct slist *list, void *data, cmp_func_t cmp_func) { struct slist *tmp, *prev, *entry; diff --git a/common/list.h b/common/list.h index 9868a79a..c11424ca 100644 --- a/common/list.h +++ b/common/list.h @@ -37,8 +37,6 @@ struct slist *slist_append(struct slist *list, void *data); struct slist *slist_prepend(struct slist *list, void *data); -struct slist *slist_insert_before(struct slist *list, struct slist *sibling, void *data); - struct slist *slist_insert_sorted(struct slist *list, void *data, cmp_func_t cmp_func); struct slist *slist_remove(struct slist *list, void *data); -- cgit