]> git.sur5r.net Git - openldap/blobdiff - include/queue-compat.h
added hasSubordinates to back-monitor
[openldap] / include / queue-compat.h
index f68deb22247324f6efb2f43a7d1dff371f827745..4a771c5a3e758924b7abc0d4abbaee303c0fc897 100644 (file)
@@ -1,3 +1,15 @@
+/*
+ * Copyright 2001 The OpenLDAP Foundation, Redwood City, California, USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.  A copy of this license is available at
+ * http://www.OpenLDAP.org/license.html or in file LICENSE in the
+ * top-level directory of the distribution.
+ */
+/* stolen from FreeBSD for use in OpenLDAP */
+/* $OpenLDAP$ */
 /*
  * Copyright (c) 1991, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -37,8 +49,6 @@
 #ifndef _SYS_QUEUE_H_
 #define        _SYS_QUEUE_H_
 
-#include <machine/ansi.h>      /* for __offsetof */
-
 /*
  * This file defines five types of data structures: singly-linked lists,
  * singly-linked tail queues, lists, tail queues, and circular queues.
  * _REMOVE             +       +       +       +       +
  *
  */
+/*
+ * see queue(3) for instructions on how to use
+ */
+
+/* The latest set of Windows headers defines SLIST_ENTRY in WINNT.H */
+#ifdef SLIST_ENTRY
+#undef SLIST_ENTRY
+#endif
 
 /*
  * Singly-linked List definitions.
@@ -201,7 +219,7 @@ struct {                                                            \
        (STAILQ_EMPTY(head) ?                                           \
                NULL :                                                  \
                ((struct type *)                                        \
-               ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
+               ((char *)((head)->stqh_last) - offsetof(struct type, field))))
 
 #define STAILQ_FOREACH(var, head, field)                               \
        for((var) = (head)->stqh_first; (var); (var) = (var)->field.stqe_next)
@@ -499,49 +517,4 @@ struct {                                                           \
                    (elm)->field.cqe_next;                              \
 } while (0)
 
-#ifdef _KERNEL
-
-/*
- * XXX insque() and remque() are an old way of handling certain queues.
- * They bogusly assumes that all queue heads look alike.
- */
-
-struct quehead {
-       struct quehead *qh_link;
-       struct quehead *qh_rlink;
-};
-
-#ifdef __GNUC__
-
-static __inline void
-insque(void *a, void *b)
-{
-       struct quehead *element = (struct quehead *)a,
-               *head = (struct quehead *)b;
-
-       element->qh_link = head->qh_link;
-       element->qh_rlink = head;
-       head->qh_link = element;
-       element->qh_link->qh_rlink = element;
-}
-
-static __inline void
-remque(void *a)
-{
-       struct quehead *element = (struct quehead *)a;
-
-       element->qh_link->qh_rlink = element->qh_rlink;
-       element->qh_rlink->qh_link = element->qh_link;
-       element->qh_rlink = 0;
-}
-
-#else /* !__GNUC__ */
-
-void   insque __P((void *a, void *b));
-void   remque __P((void *a));
-
-#endif /* __GNUC__ */
-
-#endif /* _KERNEL */
-
 #endif /* !_SYS_QUEUE_H_ */