1 /* $NetBSD: coda_kernel.h,v 1.5 2005/02/26 23:04:16 perry Exp $ */
2
3 /*
4 *
5 * Coda: an Experimental Distributed File System
6 * Release 3.1
7 *
8 * Copyright (c) 1987-1998 Carnegie Mellon University
9 * All Rights Reserved
10 *
11 * Permission to use, copy, modify and distribute this software and its
12 * documentation is hereby granted, provided that both the copyright
13 * notice and this permission notice appear in all copies of the
14 * software, derivative works or modified versions, and any portions
15 * thereof, and that both notices appear in supporting documentation, and
16 * that credit is given to Carnegie Mellon University in all documents
17 * and publicity pertaining to direct or indirect use of this code or its
18 * derivatives.
19 *
20 * CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
21 * SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
22 * FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
23 * DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
24 * RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
25 * ANY DERIVATIVE WORK.
26 *
27 * Carnegie Mellon encourages users of this software to return any
28 * improvements or extensions that they make, and to grant Carnegie
29 * Mellon the rights to redistribute these changes without encumbrance.
30 *
31 * @(#) coda/coda_kernel.h,v 1.1.1.1 1998/08/29 21:26:46 rvb Exp $
32 */
33
34 /* Macros to manipulate the queue */
35 #ifndef INIT_QUEUE
36 struct queue {
37 struct queue *forw, *back;
38 };
39
40 #define INIT_QUEUE(head) \
41 do { \
42 (head).forw = (struct queue *)&(head); \
43 (head).back = (struct queue *)&(head); \
44 } while (/*CONSTCOND*/ 0)
45
46 #define GETNEXT(head) (head).forw
47
48 #define EMPTY(head) ((head).forw == &(head))
49
50 #define EOQ(el, head) ((struct queue *)(el) == (struct queue *)&(head))
51
52 #define INSQUE(el, head) \
53 do { \
54 (el).forw = ((head).back)->forw; \
55 (el).back = (head).back; \
56 ((head).back)->forw = (struct queue *)&(el); \
57 (head).back = (struct queue *)&(el); \
58 } while (/*CONSTCOND*/ 0)
59
60 #define REMQUE(el) \
61 do { \
62 ((el).forw)->back = (el).back; \
63 (el).back->forw = (el).forw; \
64 } while (0)
65
66 #endif
Cache object: 0ed722cd5d3125dd5f666f08e0ca123a
|