summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1996-12-29 21:14:06 +0000
committerphk <phk@FreeBSD.org>1996-12-29 21:14:06 +0000
commitf1d17a487d67ecb4abe31aa12d94c1fd17e0513b (patch)
tree273d3cced2d1a52aae6eb8580f3bd557b4b90eaa /sys
parente1bb1cc95e64d0b01bb7f5e247843ada3c31c28f (diff)
downloadFreeBSD-src-f1d17a487d67ecb4abe31aa12d94c1fd17e0513b.zip
FreeBSD-src-f1d17a487d67ecb4abe31aa12d94c1fd17e0513b.tar.gz
Add
SLIST_EMPTY(head) SLIST_FIRST(head) SLIST_NEXT(elm, field) Which do the obvious things while hiding implementation details.
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/queue.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/sys/queue.h b/sys/sys/queue.h
index abe8e98..1cabb83 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.9 1996/04/08 07:51:57 phk Exp $
+ * $Id: queue.h,v 1.10 1996/05/18 03:37:21 dyson Exp $
*/
#ifndef _SYS_QUEUE_H_
@@ -103,6 +103,10 @@ struct { \
/*
* Singly-linked List functions.
*/
+#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
+
+#define SLIST_FIRST(head) ((head)->slh_first)
+
#define SLIST_INIT(head) { \
(head)->slh_first = NULL; \
}
@@ -117,6 +121,8 @@ struct { \
(head)->slh_first = (elm); \
}
+#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
+
#define SLIST_REMOVE_HEAD(head, field) { \
(head)->slh_first = (head)->slh_first->field.sle_next; \
}
OpenPOWER on IntegriCloud