From dbe289f011a9ecedf0f4cabb9f25c9564c8aa830 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 25 Aug 2006 13:17:24 +0000 Subject: Fix and cleanup watch functionality --- common/list.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'common/list.c') diff --git a/common/list.c b/common/list.c index 42d377b7..a887bcdd 100644 --- a/common/list.c +++ b/common/list.c @@ -55,6 +55,21 @@ struct slist *slist_append(struct slist *list, void *data) return list; } +struct slist *slist_prepend(struct slist *list, void *data) +{ + struct slist *entry; + + entry = malloc(sizeof(struct slist)); + /* FIXME: this currently just silently fails */ + if (!entry) + return list; + + entry->data = data; + entry->next = list; + + return entry; +} + struct slist *slist_remove(struct slist *list, void *data) { struct slist *l, *next, *prev = NULL, *match = NULL; -- cgit