diff options
| author | David Lamparter <equinox@diac24.net> | 2019-11-27 22:52:50 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2019-12-14 12:41:19 +0100 |
| commit | 45e69fa8f7bfdada1eb545c6ae4641c55333d144 (patch) | |
| tree | 637d812a04f8e632d708a7debfe1a5d037b6df24 | |
| parent | eb51bb9b1fa2fbb339c583cb5b479246b0821dcc (diff) | |
lib/linklist: flip the bitrot compost
The whole lib/linklist.c code shouldn't really be used for new code (the
lib/typesafe.h bits are better.) So, a new need for these unused
functions shouldn't be coming up.
Signed-off-by: David Lamparter <equinox@diac24.net>
| -rw-r--r-- | lib/linklist.c | 23 | ||||
| -rw-r--r-- | lib/linklist.h | 24 |
2 files changed, 0 insertions, 47 deletions
diff --git a/lib/linklist.c b/lib/linklist.c index 0d1efdf3aa..272e153276 100644 --- a/lib/linklist.c +++ b/lib/linklist.c @@ -339,29 +339,6 @@ void list_delete_node(struct list *list, struct listnode *node) listnode_free(node); } -void list_add_list(struct list *list, struct list *add) -{ - struct listnode *n; - - for (n = listhead(add); n; n = listnextnode(n)) - listnode_add(list, n->data); -} - -struct list *list_dup(struct list *list) -{ - struct list *new = list_new(); - struct listnode *ln; - void *data; - - new->cmp = list->cmp; - new->del = list->del; - - for (ALL_LIST_ELEMENTS_RO(list, ln, data)) - listnode_add(new, data); - - return new; -} - void list_sort(struct list *list, int (*cmp)(const void **, const void **)) { struct listnode *ln, *nn; diff --git a/lib/linklist.h b/lib/linklist.h index ef914b965f..00cb9f8714 100644 --- a/lib/linklist.h +++ b/lib/linklist.h @@ -208,17 +208,6 @@ extern struct listnode *listnode_lookup(struct list *list, const void *data); extern void *listnode_head(struct list *list); /* - * Duplicate a list. - * - * list - * list to duplicate - * - * Returns: - * copy of the list - */ -extern struct list *list_dup(struct list *l); - -/* * Sort a list in place. * * The sorting algorithm used is quicksort. Runtimes are equivalent to those of @@ -296,19 +285,6 @@ extern void list_delete_all_node(struct list *list); extern void list_delete_node(struct list *list, struct listnode *node); /* - * Append a list to an existing list. - * - * Runtime is O(N) where N = listcount(add). - * - * list - * list to append to - * - * add - * list to append - */ -extern void list_add_list(struct list *list, struct list *add); - -/* * Delete all nodes which satisfy a condition from a list. * Deletes the node if cond function returns true for the node. * If function ptr passed is NULL, it deletes all nodes |
