summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authoreadler <eadler@FreeBSD.org>2014-03-15 01:20:42 +0000
committereadler <eadler@FreeBSD.org>2014-03-15 01:20:42 +0000
commit16aa95985623a773b480d6906b7035a77d75f2ae (patch)
tree9115b9f6bbd752593ed589a5916c6c00260303b7 /usr.bin
parente78b9db50400cf0617476fda7d2caed86087452a (diff)
downloadFreeBSD-src-16aa95985623a773b480d6906b7035a77d75f2ae.zip
FreeBSD-src-16aa95985623a773b480d6906b7035a77d75f2ae.tar.gz
Use the system queue.h instead of bundling its own.
PR: bin/187067 Submitted by: lulf
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/csup/config.h2
-rw-r--r--usr.bin/csup/diff.c3
-rw-r--r--usr.bin/csup/fixups.c3
-rw-r--r--usr.bin/csup/fixups.h2
-rw-r--r--usr.bin/csup/keyword.c3
-rw-r--r--usr.bin/csup/proto.c2
-rw-r--r--usr.bin/csup/queue.h227
-rw-r--r--usr.bin/csup/rcsfile.c3
-rw-r--r--usr.bin/csup/rcsparse.c3
-rw-r--r--usr.bin/csup/status.c3
-rw-r--r--usr.bin/csup/threads.c3
11 files changed, 17 insertions, 237 deletions
diff --git a/usr.bin/csup/config.h b/usr.bin/csup/config.h
index 859013c..6068b63 100644
--- a/usr.bin/csup/config.h
+++ b/usr.bin/csup/config.h
@@ -30,11 +30,11 @@
#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/queue.h>
#include <time.h>
#include "fattr.h"
-#include "queue.h"
#include "misc.h"
/*
diff --git a/usr.bin/csup/diff.c b/usr.bin/csup/diff.c
index bafb458..30a6c35 100644
--- a/usr.bin/csup/diff.c
+++ b/usr.bin/csup/diff.c
@@ -26,6 +26,8 @@
* $FreeBSD$
*/
+#include <sys/queue.h>
+
#include <assert.h>
#include <err.h>
#include <errno.h>
@@ -38,7 +40,6 @@
#include "keyword.h"
#include "misc.h"
#include "stream.h"
-#include "queue.h"
typedef long lineno_t;
diff --git a/usr.bin/csup/fixups.c b/usr.bin/csup/fixups.c
index a1df115..c398397 100644
--- a/usr.bin/csup/fixups.c
+++ b/usr.bin/csup/fixups.c
@@ -26,6 +26,8 @@
* $FreeBSD$
*/
+#include <sys/queue.h>
+
#include <assert.h>
#include <pthread.h>
#include <stdlib.h>
@@ -33,7 +35,6 @@
#include "fixups.h"
#include "misc.h"
-#include "queue.h"
/*
* A synchronized queue to implement fixups. The updater thread adds
diff --git a/usr.bin/csup/fixups.h b/usr.bin/csup/fixups.h
index 0dddc90..b57eb9a 100644
--- a/usr.bin/csup/fixups.h
+++ b/usr.bin/csup/fixups.h
@@ -28,7 +28,7 @@
#ifndef _FIXUPS_H_
#define _FIXUPS_H_
-#include "queue.h"
+#include <sys/queue.h>
struct coll;
struct fixups;
diff --git a/usr.bin/csup/keyword.c b/usr.bin/csup/keyword.c
index 049a011..8e03c8d 100644
--- a/usr.bin/csup/keyword.c
+++ b/usr.bin/csup/keyword.c
@@ -26,6 +26,8 @@
* $FreeBSD$
*/
+#include <sys/queue.h>
+
#include <assert.h>
#include <err.h>
#include <errno.h>
@@ -37,7 +39,6 @@
#include "diff.h"
#include "keyword.h"
#include "misc.h"
-#include "queue.h"
#include "stream.h"
/*
diff --git a/usr.bin/csup/proto.c b/usr.bin/csup/proto.c
index 6df1aa0..3b578e5 100644
--- a/usr.bin/csup/proto.c
+++ b/usr.bin/csup/proto.c
@@ -31,6 +31,7 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/queue.h>
#include <assert.h>
#include <err.h>
@@ -57,7 +58,6 @@
#include "misc.h"
#include "mux.h"
#include "proto.h"
-#include "queue.h"
#include "stream.h"
#include "threads.h"
#include "updater.h"
diff --git a/usr.bin/csup/queue.h b/usr.bin/csup/queue.h
deleted file mode 100644
index aa9cac1..0000000
--- a/usr.bin/csup/queue.h
+++ /dev/null
@@ -1,227 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)queue.h 8.5 (Berkeley) 8/20/94
- * $FreeBSD$
- *
- * $FreeBSD$
- */
-
-#ifndef _QUEUE_H_
-#define _QUEUE_H_
-
-#undef __offsetof
-#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
-
-/*
- * Singly-linked Tail queue declarations.
- */
-#undef STAILQ_HEAD
-#define STAILQ_HEAD(name, type) \
-struct name { \
- struct type *stqh_first;/* first element */ \
- struct type **stqh_last;/* addr of last next element */ \
-}
-
-#undef STAILQ_HEAD_INITIALIZER
-#define STAILQ_HEAD_INITIALIZER(head) \
- { NULL, &(head).stqh_first }
-
-#undef STAILQ_ENTRY
-#define STAILQ_ENTRY(type) \
-struct { \
- struct type *stqe_next; /* next element */ \
-}
-
-#undef STAILQ_EMPTY
-#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
-
-#undef STAILQ_FIRST
-#define STAILQ_FIRST(head) ((head)->stqh_first)
-
-#undef STAILQ_FOREACH
-#define STAILQ_FOREACH(var, head, field) \
- for((var) = STAILQ_FIRST((head)); \
- (var); \
- (var) = STAILQ_NEXT((var), field))
-
-#undef STAILQ_FOREACH_SAFE
-#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
- for ((var) = STAILQ_FIRST((head)); \
- (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
- (var) = (tvar))
-
-#undef STAILQ_INIT
-#define STAILQ_INIT(head) do { \
- STAILQ_FIRST((head)) = NULL; \
- (head)->stqh_last = &STAILQ_FIRST((head)); \
-} while (0)
-
-#undef STAILQ_INSERT_AFTER
-#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \
- if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
- (head)->stqh_last = &STAILQ_NEXT((elm), field); \
- STAILQ_NEXT((tqelm), field) = (elm); \
-} while (0)
-
-#undef STAILQ_INSERT_HEAD
-#define STAILQ_INSERT_HEAD(head, elm, field) do { \
- if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
- (head)->stqh_last = &STAILQ_NEXT((elm), field); \
- STAILQ_FIRST((head)) = (elm); \
-} while (0)
-
-#undef STAILQ_INSERT_TAIL
-#define STAILQ_INSERT_TAIL(head, elm, field) do { \
- STAILQ_NEXT((elm), field) = NULL; \
- *(head)->stqh_last = (elm); \
- (head)->stqh_last = &STAILQ_NEXT((elm), field); \
-} while (0)
-
-#undef STAILQ_LAST
-#define STAILQ_LAST(head, type, field) \
- (STAILQ_EMPTY((head)) ? \
- NULL : \
- ((struct type *)(void *) \
- ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
-
-#undef STAILQ_NEXT
-#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
-
-#undef STAILQ_REMOVE
-#define STAILQ_REMOVE(head, elm, type, field) do { \
- if (STAILQ_FIRST((head)) == (elm)) { \
- STAILQ_REMOVE_HEAD((head), field); \
- } \
- else { \
- struct type *curelm = STAILQ_FIRST((head)); \
- while (STAILQ_NEXT(curelm, field) != (elm)) \
- curelm = STAILQ_NEXT(curelm, field); \
- if ((STAILQ_NEXT(curelm, field) = \
- STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL)\
- (head)->stqh_last = &STAILQ_NEXT((curelm), field);\
- } \
-} while (0)
-
-#undef STAILQ_REMOVE_HEAD
-#define STAILQ_REMOVE_HEAD(head, field) do { \
- if ((STAILQ_FIRST((head)) = \
- STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
- (head)->stqh_last = &STAILQ_FIRST((head)); \
-} while (0)
-
-#undef STAILQ_REMOVE_HEAD_UNTIL
-#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \
- if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \
- (head)->stqh_last = &STAILQ_FIRST((head)); \
-} while (0)
-
-/*
- * List declarations.
- */
-#undef LIST_HEAD
-#define LIST_HEAD(name, type) \
-struct name { \
- struct type *lh_first; /* first element */ \
-}
-
-#undef LIST_HEAD_INITIALIZER
-#define LIST_HEAD_INITIALIZER(head) \
- { NULL }
-
-#undef LIST_ENTRY
-#define LIST_ENTRY(type) \
-struct { \
- struct type *le_next; /* next element */ \
- struct type **le_prev; /* address of previous next element */ \
-}
-
-/*
- * List functions.
- */
-
-#undef LIST_EMPTY
-#define LIST_EMPTY(head) ((head)->lh_first == NULL)
-
-#undef LIST_FIRST
-#define LIST_FIRST(head) ((head)->lh_first)
-
-#undef LIST_FOREACH
-#define LIST_FOREACH(var, head, field) \
- for ((var) = LIST_FIRST((head)); \
- (var); \
- (var) = LIST_NEXT((var), field))
-
-#undef LIST_FOREACH_SAFE
-#define LIST_FOREACH_SAFE(var, head, field, tvar) \
- for ((var) = LIST_FIRST((head)); \
- (var) && ((tvar) = LIST_NEXT((var), field), 1); \
- (var) = (tvar))
-
-#undef LIST_INIT
-#define LIST_INIT(head) do { \
- LIST_FIRST((head)) = NULL; \
-} while (0)
-
-#undef LIST_INSERT_AFTER
-#define LIST_INSERT_AFTER(listelm, elm, field) do { \
- if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
- LIST_NEXT((listelm), field)->field.le_prev = \
- &LIST_NEXT((elm), field); \
- LIST_NEXT((listelm), field) = (elm); \
- (elm)->field.le_prev = &LIST_NEXT((listelm), field); \
-} while (0)
-
-#undef LIST_INSERT_BEFORE
-#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
- (elm)->field.le_prev = (listelm)->field.le_prev; \
- LIST_NEXT((elm), field) = (listelm); \
- *(listelm)->field.le_prev = (elm); \
- (listelm)->field.le_prev = &LIST_NEXT((elm), field); \
-} while (0)
-
-#undef LIST_INSERT_HEAD
-#define LIST_INSERT_HEAD(head, elm, field) do { \
- if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
- LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
- LIST_FIRST((head)) = (elm); \
- (elm)->field.le_prev = &LIST_FIRST((head)); \
-} while (0)
-
-#undef LIST_NEXT
-#define LIST_NEXT(elm, field) ((elm)->field.le_next)
-
-#undef LIST_REMOVE
-#define LIST_REMOVE(elm, field) do { \
- if (LIST_NEXT((elm), field) != NULL) \
- LIST_NEXT((elm), field)->field.le_prev = \
- (elm)->field.le_prev; \
- *(elm)->field.le_prev = LIST_NEXT((elm), field); \
-} while (0)
-
-#endif /* !_QUEUE_H_ */
diff --git a/usr.bin/csup/rcsfile.c b/usr.bin/csup/rcsfile.c
index dcc2002..5397932 100644
--- a/usr.bin/csup/rcsfile.c
+++ b/usr.bin/csup/rcsfile.c
@@ -26,6 +26,8 @@
* $FreeBSD$
*/
+#include <sys/queue.h>
+
#include <assert.h>
#include <err.h>
#include <errno.h>
@@ -37,7 +39,6 @@
#include "keyword.h"
#include "misc.h"
#include "proto.h"
-#include "queue.h"
#include "rcsfile.h"
#include "rcsparse.h"
#include "stream.h"
diff --git a/usr.bin/csup/rcsparse.c b/usr.bin/csup/rcsparse.c
index 248d0ab..bd46381 100644
--- a/usr.bin/csup/rcsparse.c
+++ b/usr.bin/csup/rcsparse.c
@@ -26,12 +26,13 @@
* $FreeBSD$
*/
+#include <sys/queue.h>
+
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "misc.h"
-#include "queue.h"
#include "rcsfile.h"
#include "rcsparse.h"
#include "rcstokenizer.h"
diff --git a/usr.bin/csup/status.c b/usr.bin/csup/status.c
index 3482e8e..9cc02db 100644
--- a/usr.bin/csup/status.c
+++ b/usr.bin/csup/status.c
@@ -26,6 +26,8 @@
* $FreeBSD$
*/
+#include <sys/queue.h>
+
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
@@ -39,7 +41,6 @@
#include "misc.h"
#include "pathcomp.h"
#include "proto.h"
-#include "queue.h"
#include "status.h"
#include "stream.h"
diff --git a/usr.bin/csup/threads.c b/usr.bin/csup/threads.c
index 46a9860..34e6e32 100644
--- a/usr.bin/csup/threads.c
+++ b/usr.bin/csup/threads.c
@@ -26,13 +26,14 @@
* $FreeBSD$
*/
+#include <sys/queue.h>
+
#include <assert.h>
#include <err.h>
#include <pthread.h>
#include <stdlib.h>
#include "misc.h"
-#include "queue.h"
#include "threads.h"
/*
OpenPOWER on IntegriCloud