queue.h (15138) | queue.h (15809) |
---|---|
1/* 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)queue.h 8.5 (Berkeley) 8/20/94 | 1/* 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)queue.h 8.5 (Berkeley) 8/20/94 |
34 * $Id: queue.h,v 1.8 1996/03/31 03:21:45 gibbs Exp $ | 34 * $Id: queue.h,v 1.9 1996/04/08 07:51:57 phk Exp $ |
35 */ 36 37#ifndef _SYS_QUEUE_H_ 38#define _SYS_QUEUE_H_ 39 40/* 41 * This file defines five types of data structures: singly-linked lists, 42 * slingly-linked tail queues, lists, tail queues, and circular queues. --- 220 unchanged lines hidden (view full) --- 263 * Tail queue functions. 264 */ 265#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) 266 267#define TAILQ_FIRST(head) ((head)->tqh_first) 268 269#define TAILQ_LAST(head) ((head)->tqh_last) 270 | 35 */ 36 37#ifndef _SYS_QUEUE_H_ 38#define _SYS_QUEUE_H_ 39 40/* 41 * This file defines five types of data structures: singly-linked lists, 42 * slingly-linked tail queues, lists, tail queues, and circular queues. --- 220 unchanged lines hidden (view full) --- 263 * Tail queue functions. 264 */ 265#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) 266 267#define TAILQ_FIRST(head) ((head)->tqh_first) 268 269#define TAILQ_LAST(head) ((head)->tqh_last) 270 |
271#define TAILQ_NEXT(elm, field) ((elm)->field.teq_next) | 271#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) |
272 | 272 |
273#define TAILQ_PREV(elm, field) ((elm)->field.tqe_prev) 274 |
|
273#define TAILQ_INIT(head) { \ 274 (head)->tqh_first = NULL; \ 275 (head)->tqh_last = &(head)->tqh_first; \ 276} 277 278#define TAILQ_INSERT_HEAD(head, elm, field) { \ 279 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ 280 (head)->tqh_first->field.tqe_prev = \ --- 161 unchanged lines hidden --- | 275#define TAILQ_INIT(head) { \ 276 (head)->tqh_first = NULL; \ 277 (head)->tqh_last = &(head)->tqh_first; \ 278} 279 280#define TAILQ_INSERT_HEAD(head, elm, field) { \ 281 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ 282 (head)->tqh_first->field.tqe_prev = \ --- 161 unchanged lines hidden --- |