mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-09 09:47:11 +00:00
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>
This commit is contained in:
parent
eb51bb9b1f
commit
45e69fa8f7
@ -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;
|
||||
|
@ -207,17 +207,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.
|
||||
*
|
||||
@ -295,19 +284,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.
|
||||
|
Loading…
Reference in New Issue
Block a user