1450N/A * The Regents of the University of California. All rights reserved. 1450N/A * Redistribution and use in source and binary forms, with or without 1450N/A * modification, are permitted provided that the following conditions 1450N/A * 1. Redistributions of source code must retain the above copyright 1450N/A * notice, this list of conditions and the following disclaimer. 1450N/A * 2. Redistributions in binary form must reproduce the above copyright 1450N/A * notice, this list of conditions and the following disclaimer in the 1450N/A * documentation and/or other materials provided with the distribution. 1450N/A * 3. Neither the name of the University nor the names of its contributors 1450N/A * may be used to endorse or promote products derived from this software 1450N/A * without specific prior written permission. 1450N/A * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1450N/A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1450N/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1450N/A * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 1450N/A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1450N/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1450N/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1450N/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1450N/A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1450N/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1450N/A * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. 1450N/A * This file defines five types of data structures: singly-linked lists, 1450N/A * lists, simple queues, tail queues, and circular queues. 1450N/A * A singly-linked list is headed by a single forward pointer. The 1450N/A * elements are singly linked for minimum space and pointer manipulation 1450N/A * overhead at the expense of O(n) removal for arbitrary elements. New 1450N/A * elements can be added to the list after an existing element or at the 1450N/A * head of the list. Elements being removed from the head of the list 1450N/A * should use the explicit macro for this purpose for optimum 1450N/A * efficiency. A singly-linked list may only be traversed in the forward 1450N/A * direction. Singly-linked lists are ideal for applications with large 1450N/A * datasets and few or no removals or for implementing a LIFO queue. 1450N/A * A list is headed by a single forward pointer (or an array of forward 1450N/A * pointers for a hash table header). The elements are doubly linked 1450N/A * so that an arbitrary element can be removed without a need to 1450N/A * traverse the list. New elements can be added to the list before 1450N/A * or after an existing element or at the head of the list. A list 1450N/A * may only be traversed in the forward direction. 1450N/A * A simple queue is headed by a pair of pointers, one the head of the 1450N/A * list and the other to the tail of the list. The elements are singly 1450N/A * linked to save space, so elements can only be removed from the 1450N/A * head of the list. New elements can be added to the list after 1450N/A * an existing element, at the head of the list, or at the end of the 1450N/A * list. A simple queue may only be traversed in the forward direction. 1450N/A * A tail queue is headed by a pair of pointers, one to the head of the 1450N/A * list and the other to the tail of the list. The elements are doubly 1450N/A * linked so that an arbitrary element can be removed without a need to 1450N/A * traverse the list. New elements can be added to the list before or 1450N/A * after an existing element, at the head of the list, or at the end of 1450N/A * the list. A tail queue may be traversed in either direction. 1450N/A * A circle queue is headed by a pair of pointers, one to the head of the 1450N/A * list and the other to the tail of the list. The elements are doubly 1450N/A * linked so that an arbitrary element can be removed without a need to 1450N/A * traverse the list. New elements can be added to the list before or after 1450N/A * an existing element, at the head of the list, or at the end of the list. 1450N/A * A circle queue may be traversed in either direction, but has a more 1450N/A * complex end of list detection. 1450N/A * For details on the use of these macros, see the queue(3) manual page. 1450N/A * Singly-linked List definitions. 1450N/A * Singly-linked List functions. 1450N/A * Singly-linked List access methods. 1450N/A * Singly-linked Tail queue declarations. 1450N/A * Singly-linked Tail queue functions. 1450N/A * Singly-linked Tail queue access methods. 1450N/A * Simple queue definitions. 1450N/A * Simple queue access methods. 1450N/A * Tail queue access methods. 1450N/A * Circular queue definitions. 1450N/A * Circular queue functions. 1450N/A * Circular queue access methods.