diff options
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/sys/queue.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 2ada73c74896..34fc51033399 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: queue.h,v 1.21 1998/05/12 03:55:25 gibbs Exp $ + * $Id: queue.h,v 1.22 1998/06/24 20:51:09 phk Exp $ */ #ifndef _SYS_QUEUE_H_ @@ -133,7 +133,7 @@ struct { \ (head)->slh_first = NULL; \ } -#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ +#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ (elm)->field.sle_next = (slistelm)->field.sle_next; \ (slistelm)->field.sle_next = (elm); \ } while (0) @@ -171,6 +171,9 @@ struct name { \ struct type **stqh_last;/* addr of last next element */ \ } +#define STAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).stqh_first } + #define STAILQ_ENTRY(type) \ struct { \ struct type *stqe_next; /* next element */ \ @@ -215,6 +218,12 @@ struct { \ (head)->stqh_last = &(head)->stqh_first; \ } while (0) +#define STAILQ_REMOVE_HEAD_QUEUE(head, elm, field) do { \ + if (((head)->stqh_first = (elm)->field.stqe_next) == NULL) \ + (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); \ @@ -237,6 +246,9 @@ struct name { \ struct type *lh_first; /* first element */ \ } +#define LIST_HEAD_INITIALIZER(head) \ + { NULL } + #define LIST_ENTRY(type) \ struct { \ struct type *le_next; /* next element */ \ |
