Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

queue.h

Go to the documentation of this file.
00001 /*      $OpenBSD: queue.h,v 1.22 2001/06/23 04:39:35 angelos Exp $      */
00002 /*      $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $       */
00003 
00004 /*
00005  * Copyright (c) 1991, 1993
00006  *      The Regents of the University of California.  All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. All advertising materials mentioning features or use of this software
00017  *    must display the following acknowledgement:
00018  *      This product includes software developed by the University of
00019  *      California, Berkeley and its contributors.
00020  * 4. Neither the name of the University nor the names of its contributors
00021  *    may be used to endorse or promote products derived from this software
00022  *    without specific prior written permission.
00023  *
00024  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00025  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00026  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00027  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00028  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00029  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00030  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00031  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00032  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00033  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00034  * SUCH DAMAGE.
00035  *
00036  *      @(#)queue.h     8.5 (Berkeley) 8/20/94
00037  */
00038 
00039 #ifndef _SYS_QUEUE_H_
00040 #define _SYS_QUEUE_H_
00041 
00042 /*
00043  * This file defines five types of data structures: singly-linked lists, 
00044  * lists, simple queues, tail queues, and circular queues.
00045  *
00046  *
00047  * A singly-linked list is headed by a single forward pointer. The elements
00048  * are singly linked for minimum space and pointer manipulation overhead at
00049  * the expense of O(n) removal for arbitrary elements. New elements can be
00050  * added to the list after an existing element or at the head of the list.
00051  * Elements being removed from the head of the list should use the explicit
00052  * macro for this purpose for optimum efficiency. A singly-linked list may
00053  * only be traversed in the forward direction.  Singly-linked lists are ideal
00054  * for applications with large datasets and few or no removals or for
00055  * implementing a LIFO queue.
00056  *
00057  * A list is headed by a single forward pointer (or an array of forward
00058  * pointers for a hash table header). The elements are doubly linked
00059  * so that an arbitrary element can be removed without a need to
00060  * traverse the list. New elements can be added to the list before
00061  * or after an existing element or at the head of the list. A list
00062  * may only be traversed in the forward direction.
00063  *
00064  * A simple queue is headed by a pair of pointers, one the head of the
00065  * list and the other to the tail of the list. The elements are singly
00066  * linked to save space, so elements can only be removed from the
00067  * head of the list. New elements can be added to the list before or after
00068  * an existing element, at the head of the list, or at the end of the
00069  * list. A simple queue may only be traversed in the forward direction.
00070  *
00071  * A tail queue is headed by a pair of pointers, one to the head of the
00072  * list and the other to the tail of the list. The elements are doubly
00073  * linked so that an arbitrary element can be removed without a need to
00074  * traverse the list. New elements can be added to the list before or
00075  * after an existing element, at the head of the list, or at the end of
00076  * the list. A tail queue may be traversed in either direction.
00077  *
00078  * A circle queue is headed by a pair of pointers, one to the head of the
00079  * list and the other to the tail of the list. The elements are doubly
00080  * linked so that an arbitrary element can be removed without a need to
00081  * traverse the list. New elements can be added to the list before or after
00082  * an existing element, at the head of the list, or at the end of the list.
00083  * A circle queue may be traversed in either direction, but has a more
00084  * complex end of list detection.
00085  *
00086  * For details on the use of these macros, see the queue(3) manual page.
00087  */
00088 
00089 /*
00090  * Singly-linked List definitions.
00091  */
00092 #define SLIST_HEAD(name, type)                                          \
00093 struct name {                                                           \
00094         struct type *slh_first; /* first element */                     \
00095 }
00096  
00097 #define SLIST_HEAD_INITIALIZER(head)                                    \
00098         { NULL }
00099  
00100 #define SLIST_ENTRY(type)                                               \
00101 struct {                                                                \
00102         struct type *sle_next;  /* next element */                      \
00103 }
00104  
00105 /*
00106  * Singly-linked List access methods.
00107  */
00108 #define SLIST_FIRST(head)       ((head)->slh_first)
00109 #define SLIST_END(head)         NULL
00110 #define SLIST_EMPTY(head)       (SLIST_FIRST(head) == SLIST_END(head))
00111 #define SLIST_NEXT(elm, field)  ((elm)->field.sle_next)
00112 
00113 #define SLIST_FOREACH(var, head, field)                                 \
00114         for((var) = SLIST_FIRST(head);                                  \
00115             (var) != SLIST_END(head);                                   \
00116             (var) = SLIST_NEXT(var, field))
00117 
00118 /*
00119  * Singly-linked List functions.
00120  */
00121 #define SLIST_INIT(head) {                                              \
00122         SLIST_FIRST(head) = SLIST_END(head);                            \
00123 }
00124 
00125 #define SLIST_INSERT_AFTER(slistelm, elm, field) do {                   \
00126         (elm)->field.sle_next = (slistelm)->field.sle_next;             \
00127         (slistelm)->field.sle_next = (elm);                             \
00128 } while (0)
00129 
00130 #define SLIST_INSERT_HEAD(head, elm, field) do {                        \
00131         (elm)->field.sle_next = (head)->slh_first;                      \
00132         (head)->slh_first = (elm);                                      \
00133 } while (0)
00134 
00135 #define SLIST_REMOVE_HEAD(head, field) do {                             \
00136         (head)->slh_first = (head)->slh_first->field.sle_next;          \
00137 } while (0)
00138 
00139 #define SLIST_REMOVE(head, elm, type, field) do {                       \
00140         if ((head)->slh_first == (elm)) {                               \
00141                 SLIST_REMOVE_HEAD((head), field);                       \
00142         }                                                               \
00143         else {                                                          \
00144                 struct type *curelm = (head)->slh_first;                \
00145                 while( curelm->field.sle_next != (elm) )                \
00146                         curelm = curelm->field.sle_next;                \
00147                 curelm->field.sle_next =                                \
00148                     curelm->field.sle_next->field.sle_next;             \
00149         }                                                               \
00150 } while (0)
00151 
00152 /*
00153  * List definitions.
00154  */
00155 #define LIST_HEAD(name, type)                                           \
00156 struct name {                                                           \
00157         struct type *lh_first;  /* first element */                     \
00158 }
00159 
00160 #define LIST_HEAD_INITIALIZER(head)                                     \
00161         { NULL }
00162 
00163 #define LIST_ENTRY(type)                                                \
00164 struct {                                                                \
00165         struct type *le_next;   /* next element */                      \
00166         struct type **le_prev;  /* address of previous next element */  \
00167 }
00168 
00169 /*
00170  * List access methods
00171  */
00172 #define LIST_FIRST(head)                ((head)->lh_first)
00173 #define LIST_END(head)                  NULL
00174 #define LIST_EMPTY(head)                (LIST_FIRST(head) == LIST_END(head))
00175 #define LIST_NEXT(elm, field)           ((elm)->field.le_next)
00176 
00177 #define LIST_FOREACH(var, head, field)                                  \
00178         for((var) = LIST_FIRST(head);                                   \
00179             (var)!= LIST_END(head);                                     \
00180             (var) = LIST_NEXT(var, field))
00181 
00182 /*
00183  * List functions.
00184  */
00185 #define LIST_INIT(head) do {                                            \
00186         LIST_FIRST(head) = LIST_END(head);                              \
00187 } while (0)
00188 
00189 #define LIST_INSERT_AFTER(listelm, elm, field) do {                     \
00190         if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)  \
00191                 (listelm)->field.le_next->field.le_prev =               \
00192                     &(elm)->field.le_next;                              \
00193         (listelm)->field.le_next = (elm);                               \
00194         (elm)->field.le_prev = &(listelm)->field.le_next;               \
00195 } while (0)
00196 
00197 #define LIST_INSERT_BEFORE(listelm, elm, field) do {                    \
00198         (elm)->field.le_prev = (listelm)->field.le_prev;                \
00199         (elm)->field.le_next = (listelm);                               \
00200         *(listelm)->field.le_prev = (elm);                              \
00201         (listelm)->field.le_prev = &(elm)->field.le_next;               \
00202 } while (0)
00203 
00204 #define LIST_INSERT_HEAD(head, elm, field) do {                         \
00205         if (((elm)->field.le_next = (head)->lh_first) != NULL)          \
00206                 (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
00207         (head)->lh_first = (elm);                                       \
00208         (elm)->field.le_prev = &(head)->lh_first;                       \
00209 } while (0)
00210 
00211 #define LIST_REMOVE(elm, field) do {                                    \
00212         if ((elm)->field.le_next != NULL)                               \
00213                 (elm)->field.le_next->field.le_prev =                   \
00214                     (elm)->field.le_prev;                               \
00215         *(elm)->field.le_prev = (elm)->field.le_next;                   \
00216 } while (0)
00217 
00218 #define LIST_REPLACE(elm, elm2, field) do {                             \
00219         if (((elm2)->field.le_next = (elm)->field.le_next) != NULL)     \
00220                 (elm2)->field.le_next->field.le_prev =                  \
00221                     &(elm2)->field.le_next;                             \
00222         (elm2)->field.le_prev = (elm)->field.le_prev;                   \
00223         *(elm2)->field.le_prev = (elm2);                                \
00224 } while (0)
00225 
00226 /*
00227  * Simple queue definitions.
00228  */
00229 #define SIMPLEQ_HEAD(name, type)                                        \
00230 struct name {                                                           \
00231         struct type *sqh_first; /* first element */                     \
00232         struct type **sqh_last; /* addr of last next element */         \
00233 }
00234 
00235 #define SIMPLEQ_HEAD_INITIALIZER(head)                                  \
00236         { NULL, &(head).sqh_first }
00237 
00238 #define SIMPLEQ_ENTRY(type)                                             \
00239 struct {                                                                \
00240         struct type *sqe_next;  /* next element */                      \
00241 }
00242 
00243 /*
00244  * Simple queue access methods.
00245  */
00246 #define SIMPLEQ_FIRST(head)         ((head)->sqh_first)
00247 #define SIMPLEQ_END(head)           NULL
00248 #define SIMPLEQ_EMPTY(head)         (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head))
00249 #define SIMPLEQ_NEXT(elm, field)    ((elm)->field.sqe_next)
00250 
00251 #define SIMPLEQ_FOREACH(var, head, field)                               \
00252         for((var) = SIMPLEQ_FIRST(head);                                \
00253             (var) != SIMPLEQ_END(head);                                 \
00254             (var) = SIMPLEQ_NEXT(var, field))
00255 
00256 /*
00257  * Simple queue functions.
00258  */
00259 #define SIMPLEQ_INIT(head) do {                                         \
00260         (head)->sqh_first = NULL;                                       \
00261         (head)->sqh_last = &(head)->sqh_first;                          \
00262 } while (0)
00263 
00264 #define SIMPLEQ_INSERT_HEAD(head, elm, field) do {                      \
00265         if (((elm)->field.sqe_next = (head)->sqh_first) == NULL)        \
00266                 (head)->sqh_last = &(elm)->field.sqe_next;              \
00267         (head)->sqh_first = (elm);                                      \
00268 } while (0)
00269 
00270 #define SIMPLEQ_INSERT_TAIL(head, elm, field) do {                      \
00271         (elm)->field.sqe_next = NULL;                                   \
00272         *(head)->sqh_last = (elm);                                      \
00273         (head)->sqh_last = &(elm)->field.sqe_next;                      \
00274 } while (0)
00275 
00276 #define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do {            \
00277         if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
00278                 (head)->sqh_last = &(elm)->field.sqe_next;              \
00279         (listelm)->field.sqe_next = (elm);                              \
00280 } while (0)
00281 
00282 #define SIMPLEQ_REMOVE_HEAD(head, elm, field) do {                      \
00283         if (((head)->sqh_first = (elm)->field.sqe_next) == NULL)        \
00284                 (head)->sqh_last = &(head)->sqh_first;                  \
00285 } while (0)
00286 
00287 /*
00288  * Tail queue definitions.
00289  */
00290 #define TAILQ_HEAD(name, type)                                          \
00291 struct name {                                                           \
00292         struct type *tqh_first; /* first element */                     \
00293         struct type **tqh_last; /* addr of last next element */         \
00294 }
00295 
00296 #define TAILQ_HEAD_INITIALIZER(head)                                    \
00297         { NULL, &(head).tqh_first }
00298 
00299 #define TAILQ_ENTRY(type)                                               \
00300 struct {                                                                \
00301         struct type *tqe_next;  /* next element */                      \
00302         struct type **tqe_prev; /* address of previous next element */  \
00303 }
00304 
00305 /* 
00306  * tail queue access methods 
00307  */
00308 #define TAILQ_FIRST(head)               ((head)->tqh_first)
00309 #define TAILQ_END(head)                 NULL
00310 #define TAILQ_NEXT(elm, field)          ((elm)->field.tqe_next)
00311 #define TAILQ_LAST(head, headname)                                      \
00312         (*(((struct headname *)((head)->tqh_last))->tqh_last))
00313 /* XXX */
00314 #define TAILQ_PREV(elm, headname, field)                                \
00315         (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
00316 #define TAILQ_EMPTY(head)                                               \
00317         (TAILQ_FIRST(head) == TAILQ_END(head))
00318 
00319 #define TAILQ_FOREACH(var, head, field)                                 \
00320         for((var) = TAILQ_FIRST(head);                                  \
00321             (var) != TAILQ_END(head);                                   \
00322             (var) = TAILQ_NEXT(var, field))
00323 
00324 #define TAILQ_FOREACH_REVERSE(var, head, field, headname)               \
00325         for((var) = TAILQ_LAST(head, headname);                         \
00326             (var) != TAILQ_END(head);                                   \
00327             (var) = TAILQ_PREV(var, headname, field))
00328 
00329 /*
00330  * Tail queue functions.
00331  */
00332 #define TAILQ_INIT(head) do {                                           \
00333         (head)->tqh_first = NULL;                                       \
00334         (head)->tqh_last = &(head)->tqh_first;                          \
00335 } while (0)
00336 
00337 #define TAILQ_INSERT_HEAD(head, elm, field) do {                        \
00338         if (((elm)->field.tqe_next = (head)->tqh_first) != NULL)        \
00339                 (head)->tqh_first->field.tqe_prev =                     \
00340                     &(elm)->field.tqe_next;                             \
00341         else                                                            \
00342                 (head)->tqh_last = &(elm)->field.tqe_next;              \
00343         (head)->tqh_first = (elm);                                      \
00344         (elm)->field.tqe_prev = &(head)->tqh_first;                     \
00345 } while (0)
00346 
00347 #define TAILQ_INSERT_TAIL(head, elm, field) do {                        \
00348         (elm)->field.tqe_next = NULL;                                   \
00349         (elm)->field.tqe_prev = (head)->tqh_last;                       \
00350         *(head)->tqh_last = (elm);                                      \
00351         (head)->tqh_last = &(elm)->field.tqe_next;                      \
00352 } while (0)
00353 
00354 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do {              \
00355         if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
00356                 (elm)->field.tqe_next->field.tqe_prev =                 \
00357                     &(elm)->field.tqe_next;                             \
00358         else                                                            \
00359                 (head)->tqh_last = &(elm)->field.tqe_next;              \
00360         (listelm)->field.tqe_next = (elm);                              \
00361         (elm)->field.tqe_prev = &(listelm)->field.tqe_next;             \
00362 } while (0)
00363 
00364 #define TAILQ_INSERT_BEFORE(listelm, elm, field) do {                   \
00365         (elm)->field.tqe_prev = (listelm)->field.tqe_prev;              \
00366         (elm)->field.tqe_next = (listelm);                              \
00367         *(listelm)->field.tqe_prev = (elm);                             \
00368         (listelm)->field.tqe_prev = &(elm)->field.tqe_next;             \
00369 } while (0)
00370 
00371 #define TAILQ_REMOVE(head, elm, field) do {                             \
00372         if (((elm)->field.tqe_next) != NULL)                            \
00373                 (elm)->field.tqe_next->field.tqe_prev =                 \
00374                     (elm)->field.tqe_prev;                              \
00375         else                                                            \
00376                 (head)->tqh_last = (elm)->field.tqe_prev;               \
00377         *(elm)->field.tqe_prev = (elm)->field.tqe_next;                 \
00378 } while (0)
00379 
00380 #define TAILQ_REPLACE(head, elm, elm2, field) do {                      \
00381         if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL)   \
00382                 (elm2)->field.tqe_next->field.tqe_prev =                \
00383                     &(elm2)->field.tqe_next;                            \
00384         else                                                            \
00385                 (head)->tqh_last = &(elm2)->field.tqe_next;             \
00386         (elm2)->field.tqe_prev = (elm)->field.tqe_prev;                 \
00387         *(elm2)->field.tqe_prev = (elm2);                               \
00388 } while (0)
00389 
00390 /*
00391  * Circular queue definitions.
00392  */
00393 #define CIRCLEQ_HEAD(name, type)                                        \
00394 struct name {                                                           \
00395         struct type *cqh_first;         /* first element */             \
00396         struct type *cqh_last;          /* last element */              \
00397 }
00398 
00399 #define CIRCLEQ_HEAD_INITIALIZER(head)                                  \
00400         { CIRCLEQ_END(&head), CIRCLEQ_END(&head) }
00401 
00402 #define CIRCLEQ_ENTRY(type)                                             \
00403 struct {                                                                \
00404         struct type *cqe_next;          /* next element */              \
00405         struct type *cqe_prev;          /* previous element */          \
00406 }
00407 
00408 /*
00409  * Circular queue access methods 
00410  */
00411 #define CIRCLEQ_FIRST(head)             ((head)->cqh_first)
00412 #define CIRCLEQ_LAST(head)              ((head)->cqh_last)
00413 #define CIRCLEQ_END(head)               ((void *)(head))
00414 #define CIRCLEQ_NEXT(elm, field)        ((elm)->field.cqe_next)
00415 #define CIRCLEQ_PREV(elm, field)        ((elm)->field.cqe_prev)
00416 #define CIRCLEQ_EMPTY(head)                                             \
00417         (CIRCLEQ_FIRST(head) == CIRCLEQ_END(head))
00418 
00419 #define CIRCLEQ_FOREACH(var, head, field)                               \
00420         for((var) = CIRCLEQ_FIRST(head);                                \
00421             (var) != CIRCLEQ_END(head);                                 \
00422             (var) = CIRCLEQ_NEXT(var, field))
00423 
00424 #define CIRCLEQ_FOREACH_REVERSE(var, head, field)                       \
00425         for((var) = CIRCLEQ_LAST(head);                                 \
00426             (var) != CIRCLEQ_END(head);                                 \
00427             (var) = CIRCLEQ_PREV(var, field))
00428 
00429 /*
00430  * Circular queue functions.
00431  */
00432 #define CIRCLEQ_INIT(head) do {                                         \
00433         (head)->cqh_first = CIRCLEQ_END(head);                          \
00434         (head)->cqh_last = CIRCLEQ_END(head);                           \
00435 } while (0)
00436 
00437 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do {            \
00438         (elm)->field.cqe_next = (listelm)->field.cqe_next;              \
00439         (elm)->field.cqe_prev = (listelm);                              \
00440         if ((listelm)->field.cqe_next == CIRCLEQ_END(head))             \
00441                 (head)->cqh_last = (elm);                               \
00442         else                                                            \
00443                 (listelm)->field.cqe_next->field.cqe_prev = (elm);      \
00444         (listelm)->field.cqe_next = (elm);                              \
00445 } while (0)
00446 
00447 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do {           \
00448         (elm)->field.cqe_next = (listelm);                              \
00449         (elm)->field.cqe_prev = (listelm)->field.cqe_prev;              \
00450         if ((listelm)->field.cqe_prev == CIRCLEQ_END(head))             \
00451                 (head)->cqh_first = (elm);                              \
00452         else                                                            \
00453                 (listelm)->field.cqe_prev->field.cqe_next = (elm);      \
00454         (listelm)->field.cqe_prev = (elm);                              \
00455 } while (0)
00456 
00457 #define CIRCLEQ_INSERT_HEAD(head, elm, field) do {                      \
00458         (elm)->field.cqe_next = (head)->cqh_first;                      \
00459         (elm)->field.cqe_prev = CIRCLEQ_END(head);                      \
00460         if ((head)->cqh_last == CIRCLEQ_END(head))                      \
00461                 (head)->cqh_last = (elm);                               \
00462         else                                                            \
00463                 (head)->cqh_first->field.cqe_prev = (elm);              \
00464         (head)->cqh_first = (elm);                                      \
00465 } while (0)
00466 
00467 #define CIRCLEQ_INSERT_TAIL(head, elm, field) do {                      \
00468         (elm)->field.cqe_next = CIRCLEQ_END(head);                      \
00469         (elm)->field.cqe_prev = (head)->cqh_last;                       \
00470         if ((head)->cqh_first == CIRCLEQ_END(head))                     \
00471                 (head)->cqh_first = (elm);                              \
00472         else                                                            \
00473                 (head)->cqh_last->field.cqe_next = (elm);               \
00474         (head)->cqh_last = (elm);                                       \
00475 } while (0)
00476 
00477 #define CIRCLEQ_REMOVE(head, elm, field) do {                           \
00478         if ((elm)->field.cqe_next == CIRCLEQ_END(head))                 \
00479                 (head)->cqh_last = (elm)->field.cqe_prev;               \
00480         else                                                            \
00481                 (elm)->field.cqe_next->field.cqe_prev =                 \
00482                     (elm)->field.cqe_prev;                              \
00483         if ((elm)->field.cqe_prev == CIRCLEQ_END(head))                 \
00484                 (head)->cqh_first = (elm)->field.cqe_next;              \
00485         else                                                            \
00486                 (elm)->field.cqe_prev->field.cqe_next =                 \
00487                     (elm)->field.cqe_next;                              \
00488 } while (0)
00489 
00490 #define CIRCLEQ_REPLACE(head, elm, elm2, field) do {                    \
00491         if (((elm2)->field.cqe_next = (elm)->field.cqe_next) ==         \
00492             CIRCLEQ_END(head))                                          \
00493                 (head).cqh_last = (elm2);                               \
00494         else                                                            \
00495                 (elm2)->field.cqe_next->field.cqe_prev = (elm2);        \
00496         if (((elm2)->field.cqe_prev = (elm)->field.cqe_prev) ==         \
00497             CIRCLEQ_END(head))                                          \
00498                 (head).cqh_first = (elm2);                              \
00499         else                                                            \
00500                 (elm2)->field.cqe_prev->field.cqe_next = (elm2);        \
00501 } while (0)
00502 
00503 #endif  /* !_SYS_QUEUE_H_ */

Generated on Sun May 14 14:51:10 2006 by  doxygen 1.4.2