summaryrefslogtreecommitdiffstats
path: root/src/list.h
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-08-21 00:17:16 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2008-08-21 00:17:16 +0200
commitd17a32c23afd980c4138286abb456df1b51c75f2 (patch)
tree54c6cd2899dc5941ca08265eb18a31c3eaaf020e /src/list.h
parent016d8181baab54b02674fa335886659101e9586a (diff)
PhotoRec: index pattern search to speedup operation
Diffstat (limited to 'src/list.h')
-rw-r--r--src/list.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/list.h b/src/list.h
index 4822b84..e417041 100644
--- a/src/list.h
+++ b/src/list.h
@@ -276,6 +276,16 @@ static inline void td_list_splice_init(struct td_list_head *list,
pos = n, n = pos->next)
/**
+ * td_list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
+ * @pos: the &struct td_list_head to use as a loop counter.
+ * @n: another &struct td_list_head to use as temporary storage
+ * @head: the head for your list.
+ */
+#define td_list_for_each_prev_safe(pos, n, head) \
+ for (pos = (head)->prev, n = pos->prev; pos != (head); \
+ pos = n, n = pos->prev)
+
+/**
* td_list_for_each_entry - iterate over list of given type
* @pos: the type * to use as a loop counter.
* @head: the head for your list.