summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/openbsd-compat/sys-queue.h
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssh/openbsd-compat/sys-queue.h')
-rw-r--r--crypto/openssh/openbsd-compat/sys-queue.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/crypto/openssh/openbsd-compat/sys-queue.h b/crypto/openssh/openbsd-compat/sys-queue.h
index 8ff19e4..c49a946 100644
--- a/crypto/openssh/openbsd-compat/sys-queue.h
+++ b/crypto/openssh/openbsd-compat/sys-queue.h
@@ -1,6 +1,6 @@
/* OPENBSD ORIGINAL: sys/sys/queue.h */
-/* $OpenBSD: queue.h,v 1.23 2003/06/02 23:28:21 millert Exp $ */
+/* $OpenBSD: queue.h,v 1.25 2004/04/08 16:08:21 henning Exp $ */
/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */
/*
@@ -38,12 +38,13 @@
#define _FAKE_QUEUE_H_
/*
- * Ignore all <sys/queue.h> since older platforms have broken/incomplete
- * <sys/queue.h> that are too hard to work around.
+ * Require for OS/X and other platforms that have old/broken/incomplete
+ * <sys/queue.h>.
*/
#undef SLIST_HEAD
#undef SLIST_HEAD_INITIALIZER
#undef SLIST_ENTRY
+#undef SLIST_FOREACH_PREVPTR
#undef SLIST_FIRST
#undef SLIST_END
#undef SLIST_EMPTY
@@ -54,6 +55,7 @@
#undef SLIST_INSERT_HEAD
#undef SLIST_REMOVE_HEAD
#undef SLIST_REMOVE
+#undef SLIST_REMOVE_NEXT
#undef LIST_HEAD
#undef LIST_HEAD_INITIALIZER
#undef LIST_ENTRY
@@ -194,6 +196,11 @@ struct { \
(var) != SLIST_END(head); \
(var) = SLIST_NEXT(var, field))
+#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \
+ for ((varp) = &SLIST_FIRST((head)); \
+ ((var) = *(varp)) != SLIST_END(head); \
+ (varp) = &SLIST_NEXT((var), field))
+
/*
* Singly-linked List functions.
*/
@@ -211,6 +218,10 @@ struct { \
(head)->slh_first = (elm); \
} while (0)
+#define SLIST_REMOVE_NEXT(head, elm, field) do { \
+ (elm)->field.sle_next = (elm)->field.sle_next->field.sle_next; \
+} while (0)
+
#define SLIST_REMOVE_HEAD(head, field) do { \
(head)->slh_first = (head)->slh_first->field.sle_next; \
} while (0)
@@ -400,7 +411,7 @@ struct { \
(var) != TAILQ_END(head); \
(var) = TAILQ_NEXT(var, field))
-#define TAILQ_FOREACH_REVERSE(var, head, field, headname) \
+#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
for((var) = TAILQ_LAST(head, headname); \
(var) != TAILQ_END(head); \
(var) = TAILQ_PREV(var, headname, field))
OpenPOWER on IntegriCloud