diff options
author | dfr <dfr@FreeBSD.org> | 1997-05-07 14:38:11 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1997-05-07 14:38:11 +0000 |
commit | 3ff0dc0cb9c912ce6e939036661e3c3137b1e7a4 (patch) | |
tree | 4507e666b8a7c0ac1817274e4c4a958259e0a598 | |
parent | eae849a5dd622cdfd0eb8d5d1d2abdcaf9ac674b (diff) | |
download | FreeBSD-src-3ff0dc0cb9c912ce6e939036661e3c3137b1e7a4.zip FreeBSD-src-3ff0dc0cb9c912ce6e939036661e3c3137b1e7a4.tar.gz |
Add accessors for STAILQ.
Reviewed by: phk
-rw-r--r-- | sys/sys/queue.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/sys/queue.h b/sys/sys/queue.h index e90ba3b..b972b26 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.14 1997/04/14 18:22:02 phk Exp $ + * $Id: queue.h,v 1.15 1997/04/27 08:31:17 phk Exp $ */ #ifndef _SYS_QUEUE_H_ @@ -183,6 +183,9 @@ struct { \ (head)->stqh_last = &(head)->stqh_first; \ } +#define STAILQ_FIRST(head) ((head)->stqh_first) +#define STAILQ_LAST(head) (*(head)->stqh_last) + #define STAILQ_INSERT_HEAD(head, elm, field) { \ if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ (head)->stqh_last = &(elm)->field.stqe_next; \ @@ -201,6 +204,8 @@ struct { \ (tqelm)->field.stqe_next = (elm); \ } +#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) + #define STAILQ_REMOVE_HEAD(head, field) { \ if (((head)->stqh_first = \ (head)->stqh_first->field.stqe_next) == NULL) \ |