lqueue: Allow a queueu to be initialized from an existing back element
authorDavid Gibson <david@gibson.dropbear.id.au>
Sat, 13 Jun 2015 14:24:57 +0000 (00:24 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Sat, 13 Jun 2015 14:25:24 +0000 (00:25 +1000)
commit5cdc505e7ec54d144c10f12a5453b7793b891e1e
treeea2d44b5b5f1c77522d71fc9fedde6ffc91406a3
parentd448f12d07c5b65d5db29f207de3178490f8360d
lqueue: Allow a queueu to be initialized from an existing back element

There are occasional cases where you might construct a valid queue, and
retain a direct pointer to the back element, but not the struct lqueue
used to build it.

This patch adds a new lqueue_init_from_back() macro to reconstruct a valid
struct lqueue from the element pointer for cases like this.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/lqueue/lqueue.h