|
#define | _SYS_QUEUE_H_ |
|
#define | _Q_INVALIDATE(a) |
|
#define | SLIST_HEAD(name, type) |
|
#define | SLIST_HEAD_INITIALIZER(head) { NULL } |
|
#define | SLIST_ENTRY(type) |
|
#define | SLIST_FIRST(head) ((head)->slh_first) |
|
#define | SLIST_END(head) NULL |
|
#define | SLIST_EMPTY(head) (SLIST_FIRST(head) == SLIST_END(head)) |
|
#define | SLIST_NEXT(elm, field) ((elm)->field.sle_next) |
|
#define | SLIST_FOREACH(var, head, field) |
|
#define | SLIST_FOREACH_SAFE(var, head, field, tvar) |
|
#define | SLIST_INIT(head) |
|
#define | SLIST_INSERT_AFTER(slistelm, elm, field) |
|
#define | SLIST_INSERT_HEAD(head, elm, field) |
|
#define | SLIST_REMOVE_AFTER(elm, field) |
|
#define | SLIST_REMOVE_HEAD(head, field) |
|
#define | SLIST_REMOVE(head, elm, type, field) |
|
#define | LIST_HEAD(name, type) |
|
#define | LIST_HEAD_INITIALIZER(head) { NULL } |
|
#define | LIST_ENTRY(type) |
|
#define | LIST_FIRST(head) ((head)->lh_first) |
|
#define | LIST_END(head) NULL |
|
#define | LIST_EMPTY(head) (LIST_FIRST(head) == LIST_END(head)) |
|
#define | LIST_NEXT(elm, field) ((elm)->field.le_next) |
|
#define | LIST_FOREACH(var, head, field) |
|
#define | LIST_FOREACH_SAFE(var, head, field, tvar) |
|
#define | LIST_INIT(head) |
|
#define | LIST_INSERT_AFTER(listelm, elm, field) |
|
#define | LIST_INSERT_BEFORE(listelm, elm, field) |
|
#define | LIST_INSERT_HEAD(head, elm, field) |
|
#define | LIST_REMOVE(elm, field) |
|
#define | LIST_REPLACE(elm, elm2, field) |
|
#define | SIMPLEQ_HEAD(name, type) |
|
#define | SIMPLEQ_HEAD_INITIALIZER(head) { NULL, &(head).sqh_first } |
|
#define | SIMPLEQ_ENTRY(type) |
|
#define | SIMPLEQ_FIRST(head) ((head)->sqh_first) |
|
#define | SIMPLEQ_END(head) NULL |
|
#define | SIMPLEQ_EMPTY(head) (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head)) |
|
#define | SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) |
|
#define | SIMPLEQ_FOREACH(var, head, field) |
|
#define | SIMPLEQ_FOREACH_SAFE(var, head, field, tvar) |
|
#define | SIMPLEQ_INIT(head) |
|
#define | SIMPLEQ_INSERT_HEAD(head, elm, field) |
|
#define | SIMPLEQ_INSERT_TAIL(head, elm, field) |
|
#define | SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) |
|
#define | SIMPLEQ_REMOVE_HEAD(head, field) |
|
#define | SIMPLEQ_REMOVE_AFTER(head, elm, field) |
|
#define | SIMPLEQ_CONCAT(head1, head2) |
|
#define | XSIMPLEQ_HEAD(name, type) |
|
#define | XSIMPLEQ_ENTRY(type) |
|
#define | XSIMPLEQ_XOR(head, ptr) |
|
#define | XSIMPLEQ_FIRST(head) XSIMPLEQ_XOR(head, ((head)->sqx_first)) |
|
#define | XSIMPLEQ_END(head) NULL |
|
#define | XSIMPLEQ_EMPTY(head) (XSIMPLEQ_FIRST(head) == XSIMPLEQ_END(head)) |
|
#define | XSIMPLEQ_NEXT(head, elm, field) XSIMPLEQ_XOR(head, ((elm)->field.sqx_next)) |
|
#define | XSIMPLEQ_FOREACH(var, head, field) |
|
#define | XSIMPLEQ_FOREACH_SAFE(var, head, field, tvar) |
|
#define | XSIMPLEQ_INIT(head) |
|
#define | XSIMPLEQ_INSERT_HEAD(head, elm, field) |
|
#define | XSIMPLEQ_INSERT_TAIL(head, elm, field) |
|
#define | XSIMPLEQ_INSERT_AFTER(head, listelm, elm, field) |
|
#define | XSIMPLEQ_REMOVE_HEAD(head, field) |
|
#define | XSIMPLEQ_REMOVE_AFTER(head, elm, field) |
|
#define | TAILQ_HEAD(name, type) |
|
#define | TAILQ_HEAD_INITIALIZER(head) { NULL, &(head).tqh_first } |
|
#define | TAILQ_ENTRY(type) |
|
#define | TAILQ_FIRST(head) ((head)->tqh_first) |
|
#define | TAILQ_END(head) NULL |
|
#define | TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) |
|
#define | TAILQ_LAST(head, headname) (*(((struct headname *)((head)->tqh_last))->tqh_last)) |
|
#define | TAILQ_PREV(elm, headname, field) (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) |
|
#define | TAILQ_EMPTY(head) (TAILQ_FIRST(head) == TAILQ_END(head)) |
|
#define | TAILQ_FOREACH(var, head, field) |
|
#define | TAILQ_FOREACH_SAFE(var, head, field, tvar) |
|
#define | TAILQ_FOREACH_REVERSE(var, head, headname, field) |
|
#define | TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) |
|
#define | TAILQ_INIT(head) |
|
#define | TAILQ_INSERT_HEAD(head, elm, field) |
|
#define | TAILQ_INSERT_TAIL(head, elm, field) |
|
#define | TAILQ_INSERT_AFTER(head, listelm, elm, field) |
|
#define | TAILQ_INSERT_BEFORE(listelm, elm, field) |
|
#define | TAILQ_REMOVE(head, elm, field) |
|
#define | TAILQ_REPLACE(head, elm, elm2, field) |
|
#define | TAILQ_CONCAT(head1, head2, field) |
|
- Author
- The Regents of the University of California
- Date
- 1991, 1993
- Copyright
- 3-clause BSD License
This file defines five types of data structures: singly-linked lists, lists, simple queues, tail queues and XOR simple queues.
A singly-linked list is headed by a single forward pointer. The elements are singly linked for minimum space and pointer manipulation overhead at the expense of O(n) removal for arbitrary elements. New elements can be added to the list after an existing element or at the head of the list. Elements being removed from the head of the list should use the explicit macro for this purpose for optimum efficiency. A singly-linked list may only be traversed in the forward direction. Singly-linked lists are ideal for applications with large datasets and few or no removals or for implementing a LIFO queue.
A list is headed by a single forward pointer (or an array of forward pointers for a hash table header). The elements are doubly linked so that an arbitrary element can be removed without a need to traverse the list. New elements can be added to the list before or after an existing element or at the head of the list. A list may only be traversed in the forward direction.
A simple queue is headed by a pair of pointers, one to the head of the list and the other to the tail of the list. The elements are singly linked to save space, so elements can only be removed from the head of the list. New elements can be added to the list before or after an existing element, at the head of the list, or at the end of the list. A simple queue may only be traversed in the forward direction.
A tail queue is headed by a pair of pointers, one to the head of the list and the other to the tail of the list. The elements are doubly linked so that an arbitrary element can be removed without a need to traverse the list. New elements can be added to the list before or after an existing element, at the head of the list, or at the end of the list. A tail queue may be traversed in either direction.
An XOR simple queue is used in the same way as a regular simple queue. The difference is that the head structure also includes a "cookie" that is XOR'd with the queue pointer (first, last or next) to generate the real pointer value.
For details on the use of these macros, see the queue(3) manual page.