chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ask-password: leave printing of final prompt colon to message
[elogind.git]
/
src
/
list.h
diff --git
a/src/list.h
b/src/list.h
index 012dd1207329e93d8b18773eb69c5bfe740dc3c9..3cf18f15473b74ffdc94499f3da2d5a5990bf800 100644
(file)
--- a/
src/list.h
+++ b/
src/list.h
@@
-1,4
+1,4
@@
-/*-*- Mode: C; c-basic-offset: 8 -*-*/
+/*-*- Mode: C; c-basic-offset: 8
; indent-tabs-mode: nil
-*-*/
#ifndef foolisthfoo
#define foolisthfoo
#ifndef foolisthfoo
#define foolisthfoo
@@
-77,7
+77,7
@@
do { \
t *_item = (item); \
assert(_item); \
do { \
t *_item = (item); \
assert(_item); \
- while (
(_item->name##_prev)
\
+ while (
_item->name##_prev)
\
_item = _item->name##_prev; \
(head) = _item; \
} while (false)
_item = _item->name##_prev; \
(head) = _item; \
} while (false)
@@
-116,4
+116,10
@@
#define LIST_FOREACH_SAFE(name,i,n,head) \
for ((i) = (head); (i) && (((n) = (i)->name##_next), 1); (i) = (n))
#define LIST_FOREACH_SAFE(name,i,n,head) \
for ((i) = (head); (i) && (((n) = (i)->name##_next), 1); (i) = (n))
+#define LIST_FOREACH_BEFORE(name,i,p) \
+ for ((i) = (p)->name##_prev; (i); (i) = (i)->name##_prev)
+
+#define LIST_FOREACH_AFTER(name,i,p) \
+ for ((i) = (p)->name##_next; (i); (i) = (i)->name##_next)
+
#endif
#endif