X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fhtable%2Fhtable.h;fp=ccan%2Fhtable%2Fhtable.h;h=e150c2ef0958065d3e289482d78dfe8267017a9b;hb=7b56762984ce66f38728b542ca347bcb6fe3e981;hp=03193567d847a5512b31d173bcb8a21a6d54d09e;hpb=d81e79b8dfdfb0da8766c022e767a5b040e5d07b;p=ccan diff --git a/ccan/htable/htable.h b/ccan/htable/htable.h index 03193567..e150c2ef 100644 --- a/ccan/htable/htable.h +++ b/ccan/htable/htable.h @@ -178,6 +178,21 @@ void *htable_first(const struct htable *htable, struct htable_iter *i); */ void *htable_next(const struct htable *htable, struct htable_iter *i); +/** + * htable_prev - find the previous entry in the hash table + * @ht: the hashtable + * @i: the struct htable_iter to use + * + * Get previous entry in the hashtable; NULL if all done. + * + * "previous" here only means the item that would have been returned by + * htable_next() before the item it returned most recently. + * + * This is usually used in the middle of (or after) a htable_next iteration and + * to "unwind" actions taken. + */ +void *htable_prev(const struct htable *htable, struct htable_iter *i); + /** * htable_delval - remove an iterated pointer from a hash table * @ht: the htable