Browse Source

Added BTPDQ_FOREACH_MUTABLE list macro.

master
Richard Nyberg 19 years ago
parent
commit
74b665efe1
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      btpd/queue.h

+ 5
- 0
btpd/queue.h View File

@@ -41,6 +41,11 @@ struct { \
(var); \ (var); \
(var) = BTPDQ_NEXT((var), field)) (var) = BTPDQ_NEXT((var), field))


#define BTPDQ_FOREACH_MUTABLE(var, head, field, nvar) \
for ((var) = BTPDQ_FIRST((head)); \
(var) && ((nvar) = BTPDQ_NEXT((var), field), (var)); \
(var) = (nvar))

#define BTPDQ_INIT(head) do { \ #define BTPDQ_INIT(head) do { \
BTPDQ_FIRST((head)) = NULL; \ BTPDQ_FIRST((head)) = NULL; \
(head)->tqh_last = &BTPDQ_FIRST((head)); \ (head)->tqh_last = &BTPDQ_FIRST((head)); \


Loading…
Cancel
Save