Plug in missing brelse calls as to fix a bug in the FFS reload code.
[dragonfly.git] / release / sysinstall / list.h
1 /*
2  * The new sysinstall program.
3  *
4  * This is probably the last attempt in the `sysinstall' line, the next
5  * generation being slated for what's essentially a complete rewrite.
6  *
7  * $FreeBSD: src/release/sysinstall/list.h,v 1.2 1999/08/28 01:34:15 peter Exp $
8  * $DragonFly: src/release/sysinstall/Attic/list.h,v 1.2 2003/06/17 04:27:21 dillon Exp $
9  *
10  * Copyright (c) 1997 FreeBSD, Inc.
11  * All rights reserved.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  *    notice, this list of conditions and the following disclaimer,
18  *    verbatim and that no modifications are made prior to this
19  *    point in the file.
20  * 2. Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in the
22  *    documentation and/or other materials provided with the distribution.
23  *
24  * THIS SOFTWARE IS PROVIDED BY PAUL TRAINA ``AS IS'' AND
25  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  * ARE DISCLAIMED.  IN NO EVENT SHALL PAUL TRAINA OR HIS KILLER RATS BE LIABLE
28  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30  * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
31  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34  * SUCH DAMAGE.
35  *
36  */
37
38 /* The structure */
39 typedef struct _qelement {
40     struct _qelement *q_forw;
41     struct _qelement *q_back;
42 } qelement;
43
44 #define INITQUE(Xhead) { \
45     (Xhead).q_forw = &(Xhead); \
46     (Xhead).q_back = &(Xhead); \
47 }
48
49 #define EMPTYQUE(Xhead) \
50     ((Xhead).q_forw == &(Xhead))
51
52 #define INSQUEUE(elem, pred) { \
53     register qelement *Xe = (qelement *) (elem); \
54     register qelement *Xp = (qelement *) (pred); \
55     Xp->q_forw = (Xe->q_forw = (Xe->q_back = Xp)->q_forw)->q_back = Xe; \
56 }
57
58 #define REMQUE(elem) { \
59     register qelement *Xe = (qelement *) (elem); \
60     (Xe->q_back->q_forw = Xe->q_forw)->q_back = Xe->q_back; \
61 }