diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/queue.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/sys/queue.h b/sys/sys/queue.h index e8758cd..0e042d3 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)queue.h 8.5 (Berkeley) 8/20/94 - * $Id$ + * $Id: queue.h,v 1.13 1997/02/22 09:45:44 peter Exp $ */ #ifndef _SYS_QUEUE_H_ @@ -217,6 +217,11 @@ struct { \ /* * List functions. */ +#define LIST_FIRST(head) ((head)->lh_first) + +#define LIST_FOREACH(var, head, field) \ + for((var) = (head)->lh_first; (var); (var) = (var)->field.le_next) + #define LIST_INIT(head) { \ (head)->lh_first = NULL; \ } @@ -243,6 +248,8 @@ struct { \ (elm)->field.le_prev = &(head)->lh_first; \ } +#define LIST_NEXT(elm, field) ((elm)->field.le_next) + #define LIST_REMOVE(elm, field) { \ if ((elm)->field.le_next != NULL) \ (elm)->field.le_next->field.le_prev = \ |