diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1999-12-17 01:34:30 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1999-12-17 01:34:30 +0000 |
| commit | 06a8802172c2dbf8f404858b1404903c02a143e0 (patch) | |
| tree | 261475897c7e6743c78d2db8c31c92b61e3da08b | |
| parent | e32acbc4d4d3c98c0d0ddb872e5a3d3c6cd47bec (diff) | |
Notes
| -rw-r--r-- | sys/sys/queue.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 650925354ef7..be4c8b7e7b54 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -96,7 +96,7 @@ * _NEXT + + + + + * _PREV - - - + + * _LAST - - + + + - * _FOREACH + + - + + + * _FOREACH + + + + + * _INSERT_HEAD + + + + + * _INSERT_BEFORE - + - + + * _INSERT_AFTER + + + + + @@ -113,6 +113,9 @@ struct name { \ struct type *slh_first; /* first element */ \ } + +#define SLIST_HEAD_INITIALIZER(head) \ + { NULL } #define SLIST_ENTRY(type) \ struct { \ @@ -192,6 +195,9 @@ struct { \ #define STAILQ_FIRST(head) ((head)->stqh_first) #define STAILQ_LAST(head) (*(head)->stqh_last) +#define STAILQ_FOREACH(var, head, field) \ + for((var) = (head)->stqh_first; (var); (var) = (var)->field.stqe_next) + #define STAILQ_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ (head)->stqh_last = &(elm)->field.stqe_next; \ @@ -223,7 +229,6 @@ struct { \ (head)->stqh_last = &(head)->stqh_first; \ } while (0) - #define STAILQ_REMOVE(head, elm, type, field) do { \ if ((head)->stqh_first == (elm)) { \ STAILQ_REMOVE_HEAD(head, field); \ |
