summaryrefslogtreecommitdiffstats
path: root/src/list.h
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-04-14 11:09:48 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2012-04-14 11:09:48 +0200
commit7d29ee5f1ef40171054886beefe39527f144dbc2 (patch)
tree943858ef36f1bc1602041987cd6b39e7413a190f /src/list.h
parent35ad901d7b6947e492911b0d5b672530cb645eb9 (diff)
New function td_list_entry_const()
Diffstat (limited to 'src/list.h')
-rw-r--r--src/list.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/list.h b/src/list.h
index c0ca51f..392adc3 100644
--- a/src/list.h
+++ b/src/list.h
@@ -231,6 +231,9 @@ static inline void td_list_splice_init(struct td_list_head *list,
#define td_list_entry(ptr, type, member) \
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
+#define td_list_entry_const(ptr, type, member) \
+ ((type *)((const char *)(ptr)-(unsigned long)(&((type *)0)->member)))
+
/**
* __td_list_for_each - iterate over a list
* @pos: the &struct td_list_head to use as a loop counter.