mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 11:00:09 +01:00
shared: add nm_c_list_for_each_entry_prev() helper macro
It's non-trivial to get this right. Add the macro for iterating the list in reverse.
This commit is contained in:
parent
c02710bb0f
commit
308beb85fe
1 changed files with 6 additions and 0 deletions
|
|
@ -17,6 +17,12 @@
|
|||
_what && c_list_contains (list, &_what->member); \
|
||||
})
|
||||
|
||||
/* iterate over the list backwards. */
|
||||
#define nm_c_list_for_each_entry_prev(_iter, _list, _m) \
|
||||
for (_iter = c_list_entry ((_list)->prev, __typeof__ (*_iter), _m); \
|
||||
&(_iter)->_m != (_list); \
|
||||
_iter = c_list_entry ((_iter)->_m.prev, __typeof__ (*_iter), _m))
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue