summaryrefslogtreecommitdiff
path: root/lib/linklist.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-07-28 17:23:41 +0200
committerDonald Sharp <sharpd@cumulusnetwroks.com>2016-07-28 07:27:47 -0400
commitb21e9619c50276540bc447007a8b43ded267c7fe (patch)
tree870512252205de595c90c86626a8f5fff37a6e63 /lib/linklist.h
parent16f5949d44f7d9bec5b0402845754e9aca9b6f32 (diff)
lib: linklist: add listnode_add_before()
This utility function, to join the zoo that the Quagga linked-list implementation has accumulated, does an insert-before while returning the newly allocated node. It is similar to: - listnode_add_after(), but - complementary direction - returns allocated node - list_add_node_prev(), but - supports before == NULL - returns allocated node In general, the entire linked-list implementation is in bad shape, and while it needs a cleanup / rewrite / replacement, this would both cause significant conflicts and block other cleanups... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/linklist.h')
-rw-r--r--lib/linklist.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/linklist.h b/lib/linklist.h
index 6209c8b9d6..96aaf43196 100644
--- a/lib/linklist.h
+++ b/lib/linklist.h
@@ -68,6 +68,7 @@ extern void list_free (struct list *);
extern void listnode_add (struct list *, void *);
extern void listnode_add_sort (struct list *, void *);
extern void listnode_add_after (struct list *, struct listnode *, void *);
+extern struct listnode *listnode_add_before (struct list *, struct listnode *, void *);
extern void listnode_move_to_tail (struct list *, struct listnode *);
extern void listnode_delete (struct list *, void *);
extern struct listnode *listnode_lookup (struct list *, void *);