pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/libnbcompat Add circleq support. Bump to 2008...
details: https://anonhg.NetBSD.org/pkgsrc/rev/1d9ac5c1053c
branches: trunk
changeset: 549149:1d9ac5c1053c
user: joerg <joerg%pkgsrc.org@localhost>
date: Tue Oct 28 15:15:18 2008 +0000
description:
Add circleq support. Bump to 20081028. Should fix IRIX build from
PR 39797.
diffstat:
pkgtools/libnbcompat/Makefile | 4 +-
pkgtools/libnbcompat/files/nbcompat/queue.h | 133 +++++++++++++++++++++++++++-
2 files changed, 134 insertions(+), 3 deletions(-)
diffs (162 lines):
diff -r 1595a58d48fb -r 1d9ac5c1053c pkgtools/libnbcompat/Makefile
--- a/pkgtools/libnbcompat/Makefile Tue Oct 28 15:08:01 2008 +0000
+++ b/pkgtools/libnbcompat/Makefile Tue Oct 28 15:15:18 2008 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.65 2008/10/10 00:21:43 joerg Exp $
+# $NetBSD: Makefile,v 1.66 2008/10/28 15:15:18 joerg Exp $
#
# NOTE: If you update this package, it is *mandatory* that you update
# pkgsrc/pkgtools/libnbcompat/files/README to reflect the actual
# list of tested and supported platforms.
#
-DISTNAME= libnbcompat-20081010
+DISTNAME= libnbcompat-20081028
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
DISTFILES= # empty
diff -r 1595a58d48fb -r 1d9ac5c1053c pkgtools/libnbcompat/files/nbcompat/queue.h
--- a/pkgtools/libnbcompat/files/nbcompat/queue.h Tue Oct 28 15:08:01 2008 +0000
+++ b/pkgtools/libnbcompat/files/nbcompat/queue.h Tue Oct 28 15:15:18 2008 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: queue.h,v 1.4 2007/06/26 22:10:46 dmcmahill Exp $ */
+/* $NetBSD: queue.h,v 1.5 2008/10/28 15:15:18 joerg Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -316,4 +316,135 @@
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
#endif
+#define CIRCLEQ_HEAD(name, type) \
+struct name { \
+ struct type *cqh_first; /* first element */ \
+ struct type *cqh_last; /* last element */ \
+}
+
+#define CIRCLEQ_HEAD_INITIALIZER(head) \
+ { (void *)&head, (void *)&head }
+
+#define CIRCLEQ_ENTRY(type) \
+struct { \
+ struct type *cqe_next; /* next element */ \
+ struct type *cqe_prev; /* previous element */ \
+}
+
+/*
+ * Circular queue functions.
+ */
+#ifndef CIRCLEQ_INIT
+#define CIRCLEQ_INIT(head) do { \
+ (head)->cqh_first = (void *)(head); \
+ (head)->cqh_last = (void *)(head); \
+} while (/*CONSTCOND*/0)
+#endif
+
+#ifndef CIRCLEQ_INSERT_AFTER
+#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ (elm)->field.cqe_next = (listelm)->field.cqe_next; \
+ (elm)->field.cqe_prev = (listelm); \
+ if ((listelm)->field.cqe_next == (void *)(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (listelm)->field.cqe_next->field.cqe_prev = (elm); \
+ (listelm)->field.cqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+#endif
+
+#ifndef CIRCLEQ_INSERT_BEFORE
+#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
+ (elm)->field.cqe_next = (listelm); \
+ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
+ if ((listelm)->field.cqe_prev == (void *)(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (listelm)->field.cqe_prev->field.cqe_next = (elm); \
+ (listelm)->field.cqe_prev = (elm); \
+} while (/*CONSTCOND*/0)
+#endif
+
+#ifndef CIRCLEQ_INSERT_HEAD
+#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
+ (elm)->field.cqe_next = (head)->cqh_first; \
+ (elm)->field.cqe_prev = (void *)(head); \
+ if ((head)->cqh_last == (void *)(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (head)->cqh_first->field.cqe_prev = (elm); \
+ (head)->cqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+#endif
+
+#ifndef CIRCLEQ_INSERT_TAIL
+#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.cqe_next = (void *)(head); \
+ (elm)->field.cqe_prev = (head)->cqh_last; \
+ if ((head)->cqh_first == (void *)(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (head)->cqh_last->field.cqe_next = (elm); \
+ (head)->cqh_last = (elm); \
+} while (/*CONSTCOND*/0)
+#endif
+
+#ifndef CIRCLEQ_REMOVE
+#define CIRCLEQ_REMOVE(head, elm, field) do { \
+ if ((elm)->field.cqe_next == (void *)(head)) \
+ (head)->cqh_last = (elm)->field.cqe_prev; \
+ else \
+ (elm)->field.cqe_next->field.cqe_prev = \
+ (elm)->field.cqe_prev; \
+ if ((elm)->field.cqe_prev == (void *)(head)) \
+ (head)->cqh_first = (elm)->field.cqe_next; \
+ else \
+ (elm)->field.cqe_prev->field.cqe_next = \
+ (elm)->field.cqe_next; \
+} while (/*CONSTCOND*/0)
+#endif
+
+#ifndef CIRCLEQ_FOREACH
+#define CIRCLEQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->cqh_first); \
+ (var) != (const void *)(head); \
+ (var) = ((var)->field.cqe_next))
+#endif
+
+#ifndef CIRCLEQ_FOREACH_REVERSE
+#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
+ for ((var) = ((head)->cqh_last); \
+ (var) != (const void *)(head); \
+ (var) = ((var)->field.cqe_prev))
+#endif
+
+#ifndef CIRCLEQ_EMPTY
+#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head))
+#endif
+#ifndef CIRCLEQ_FIRST
+#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
+#endif
+#ifndef CIRCLEQ_LAST
+#define CIRCLEQ_LAST(head) ((head)->cqh_last)
+#endif
+#ifndef CIRCLEQ_NEXT
+#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
+#endif
+#ifndef CIRCLEQ_PREV
+#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
+#endif
+
+#ifndef CIRCLEQ_LOOP_NEXT
+#define CIRCLEQ_LOOP_NEXT(head, elm, field) \
+ (((elm)->field.cqe_next == (void *)(head)) \
+ ? ((head)->cqh_first) \
+ : (elm->field.cqe_next))
+#endif
+#ifndef CIRCLEQ_LOOP_PREV
+#define CIRCLEQ_LOOP_PREV(head, elm, field) \
+ (((elm)->field.cqe_prev == (void *)(head)) \
+ ? ((head)->cqh_last) \
+ : (elm->field.cqe_prev))
+#endif
+
#endif /* !_NBCOMPAT_QUEUE_H */
Home |
Main Index |
Thread Index |
Old Index