diff --git a/usr.bin/csup/config.h b/usr.bin/csup/config.h index 859013cfa23c..6068b63bfc75 100644 --- a/usr.bin/csup/config.h +++ b/usr.bin/csup/config.h @@ -30,11 +30,11 @@ #include #include +#include #include #include "fattr.h" -#include "queue.h" #include "misc.h" /* diff --git a/usr.bin/csup/diff.c b/usr.bin/csup/diff.c index bafb458e05be..30a6c354f07a 100644 --- a/usr.bin/csup/diff.c +++ b/usr.bin/csup/diff.c @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include + #include #include #include @@ -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 a1df1159d41a..c39839788406 100644 --- a/usr.bin/csup/fixups.c +++ b/usr.bin/csup/fixups.c @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include + #include #include #include @@ -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 0dddc905d1a0..b57eb9a351cc 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 struct coll; struct fixups; diff --git a/usr.bin/csup/keyword.c b/usr.bin/csup/keyword.c index 049a0115382a..8e03c8d3e373 100644 --- a/usr.bin/csup/keyword.c +++ b/usr.bin/csup/keyword.c @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include + #include #include #include @@ -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 6df1aa03aa5a..3b578e5a0d69 100644 --- a/usr.bin/csup/proto.c +++ b/usr.bin/csup/proto.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -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 aa9cac165fb4..000000000000 --- 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 dcc200283568..53979326ed47 100644 --- a/usr.bin/csup/rcsfile.c +++ b/usr.bin/csup/rcsfile.c @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include + #include #include #include @@ -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 248d0ab4e49a..bd46381033b4 100644 --- a/usr.bin/csup/rcsparse.c +++ b/usr.bin/csup/rcsparse.c @@ -26,12 +26,13 @@ * $FreeBSD$ */ +#include + #include #include #include #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 3482e8ee7be1..9cc02db98ec6 100644 --- a/usr.bin/csup/status.c +++ b/usr.bin/csup/status.c @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include + #include #include #include @@ -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 46a98606f282..34e6e327b76e 100644 --- a/usr.bin/csup/threads.c +++ b/usr.bin/csup/threads.c @@ -26,13 +26,14 @@ * $FreeBSD$ */ +#include + #include #include #include #include #include "misc.h" -#include "queue.h" #include "threads.h" /*