1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Initial BFD commit, work in progress.

This commit is contained in:
Ondrej Zajicek
2013-09-10 12:09:36 +02:00
parent bff9ce5130
commit bf139664aa
16 changed files with 1913 additions and 10 deletions

View File

@@ -100,6 +100,27 @@ rem_node(node *n)
x->prev = z;
}
/**
* replace_node - replace a node in a list with another one
* @old: node to be removed
* @new: node to be inserted
*
* Replaces node @old in the list it's linked in with node @new. Node
* @old may be a copy of the original node, which is not accessed
* through the list. The function could be called with @old == @new,
* which just fixes neighbors' pointers in the case that the node
* was reallocated.
*/
LIST_INLINE void
replace_node(node *old, node *new)
{
old->next->prev = new;
old->prev->next = new;
new->prev = old->prev;
new->next = old->next;
}
/**
* init_list - create an empty list
* @l: list