]> git.ozlabs.org Git - ccan/commitdiff
lstack: Allow a stack to be initialized from an existing top element
authorDavid Gibson <david@gibson.dropbear.id.au>
Sat, 13 Jun 2015 14:23:39 +0000 (00:23 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Sat, 13 Jun 2015 14:25:24 +0000 (00:25 +1000)
There are occasional cases where you might construct a valid stack, and
retain a direct pointer to the top element, but not the struct lstack
used to build it.

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

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

No differences found