list.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  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
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 4. Neither the name of the University nor the names of its contributors
  14. * may be used to endorse or promote products derived from this software
  15. * without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  18. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  21. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27. * SUCH DAMAGE.
  28. *
  29. * @(#)queue.h 8.5 (Berkeley) 8/20/94
  30. * $FreeBSD: /repoman/r/ncvs/src/sys/sys/queue.h,v 1.68 2006/10/24 11:20:29 ru Exp $
  31. */
  32. #ifndef _SER_LIST_H
  33. #define _SER_LIST_H
  34. /* #include <sys/cdefs.h> - not needed and not present on all the systems */
  35. /*
  36. * This file defines four types of data structures: singly-linked lists,
  37. * singly-linked tail queues, lists and tail queues.
  38. *
  39. * A singly-linked list is headed by a single forward pointer. The elements
  40. * are singly linked for minimum space and pointer manipulation overhead at
  41. * the expense of O(n) removal for arbitrary elements. New elements can be
  42. * added to the list after an existing element or at the head of the list.
  43. * Elements being removed from the head of the list should use the explicit
  44. * macro for this purpose for optimum efficiency. A singly-linked list may
  45. * only be traversed in the forward direction. Singly-linked lists are ideal
  46. * for applications with large datasets and few or no removals or for
  47. * implementing a LIFO queue.
  48. *
  49. * A singly-linked tail queue is headed by a pair of pointers, one to the
  50. * head of the list and the other to the tail of the list. The elements are
  51. * singly linked for minimum space and pointer manipulation overhead at the
  52. * expense of O(n) removal for arbitrary elements. New elements can be added
  53. * to the list after an existing element, at the head of the list, or at the
  54. * end of the list. Elements being removed from the head of the tail queue
  55. * should use the explicit macro for this purpose for optimum efficiency.
  56. * A singly-linked tail queue may only be traversed in the forward direction.
  57. * Singly-linked tail queues are ideal for applications with large datasets
  58. * and few or no removals or for implementing a FIFO queue.
  59. *
  60. * A list is headed by a single forward pointer (or an array of forward
  61. * pointers for a hash table header). The elements are doubly linked
  62. * so that an arbitrary element can be removed without a need to
  63. * traverse the list. New elements can be added to the list before
  64. * or after an existing element or at the head of the list. A list
  65. * may only be traversed in the forward direction.
  66. *
  67. * A tail queue is headed by a pair of pointers, one to the head of the
  68. * list and the other to the tail of the list. The elements are doubly
  69. * linked so that an arbitrary element can be removed without a need to
  70. * traverse the list. New elements can be added to the list before or
  71. * after an existing element, at the head of the list, or at the end of
  72. * the list. A tail queue may be traversed in either direction.
  73. *
  74. * For details on the use of these macros, see the queue(3) manual page.
  75. *
  76. *
  77. * SLIST LIST STAILQ TAILQ
  78. * _HEAD + + + +
  79. * _HEAD_INITIALIZER + + + +
  80. * _ENTRY + + + +
  81. * _INIT + + + +
  82. * _EMPTY + + + +
  83. * _FIRST + + + +
  84. * _NEXT + + + +
  85. * _PREV - - - +
  86. * _LAST - - + +
  87. * _FOREACH + + + +
  88. * _FOREACH_SAFE + + + +
  89. * _FOREACH_REVERSE - - - +
  90. * _FOREACH_REVERSE_SAFE - - - +
  91. * _INSERT_HEAD + + + +
  92. * _INSERT_BEFORE - + - +
  93. * _INSERT_AFTER + + + +
  94. * _INSERT_TAIL - - + +
  95. * _CONCAT - - + +
  96. * _REMOVE_HEAD + - + -
  97. * _REMOVE + + + +
  98. *
  99. */
  100. #ifdef QUEUE_MACRO_DEBUG
  101. /* Store the last 2 places the queue element or head was altered */
  102. struct qm_trace {
  103. char * lastfile;
  104. int lastline;
  105. char * prevfile;
  106. int prevline;
  107. };
  108. #define TRACEBUF struct qm_trace trace;
  109. #define TRASHIT(x) do {(x) = (void *)-1;} while (0)
  110. #define QMD_TRACE_HEAD(head) do { \
  111. (head)->trace.prevline = (head)->trace.lastline; \
  112. (head)->trace.prevfile = (head)->trace.lastfile; \
  113. (head)->trace.lastline = __LINE__; \
  114. (head)->trace.lastfile = __FILE__; \
  115. } while (0)
  116. #define QMD_TRACE_ELEM(elem) do { \
  117. (elem)->trace.prevline = (elem)->trace.lastline; \
  118. (elem)->trace.prevfile = (elem)->trace.lastfile; \
  119. (elem)->trace.lastline = __LINE__; \
  120. (elem)->trace.lastfile = __FILE__; \
  121. } while (0)
  122. #else
  123. #define QMD_TRACE_ELEM(elem)
  124. #define QMD_TRACE_HEAD(head)
  125. #define TRACEBUF
  126. #define TRASHIT(x)
  127. #endif /* QUEUE_MACRO_DEBUG */
  128. /*
  129. * Singly-linked List declarations.
  130. */
  131. #define SLIST_HEAD(name, type) \
  132. struct name { \
  133. struct type *slh_first; /* first element */ \
  134. }
  135. #define SLIST_HEAD_INITIALIZER(head) \
  136. { NULL }
  137. #define SLIST_ENTRY(type) \
  138. struct { \
  139. struct type *sle_next; /* next element */ \
  140. }
  141. /*
  142. * Singly-linked List functions.
  143. */
  144. #define SLIST_EMPTY(head) ((head)->slh_first == NULL)
  145. #define SLIST_FIRST(head) ((head)->slh_first)
  146. #define SLIST_FOREACH(var, head, field) \
  147. for ((var) = SLIST_FIRST((head)); \
  148. (var); \
  149. (var) = SLIST_NEXT((var), field))
  150. #define SLIST_FOREACH_SAFE(var, head, field, tvar) \
  151. for ((var) = SLIST_FIRST((head)); \
  152. (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
  153. (var) = (tvar))
  154. #define SLIST_FOREACH_PREVPTR(var, varp, head, field) \
  155. for ((varp) = &SLIST_FIRST((head)); \
  156. ((var) = *(varp)) != NULL; \
  157. (varp) = &SLIST_NEXT((var), field))
  158. #define SLIST_INIT(head) do { \
  159. SLIST_FIRST((head)) = NULL; \
  160. } while (0)
  161. #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
  162. SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \
  163. SLIST_NEXT((slistelm), field) = (elm); \
  164. } while (0)
  165. #define SLIST_INSERT_HEAD(head, elm, field) do { \
  166. SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
  167. SLIST_FIRST((head)) = (elm); \
  168. } while (0)
  169. #define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
  170. #define SLIST_REMOVE(head, elm, type, field) do { \
  171. if (SLIST_FIRST((head)) == (elm)) { \
  172. SLIST_REMOVE_HEAD((head), field); \
  173. } \
  174. else { \
  175. struct type *curelm = SLIST_FIRST((head)); \
  176. while (SLIST_NEXT(curelm, field) != (elm)) \
  177. curelm = SLIST_NEXT(curelm, field); \
  178. SLIST_NEXT(curelm, field) = \
  179. SLIST_NEXT(SLIST_NEXT(curelm, field), field); \
  180. } \
  181. TRASHIT((elm)->field.sle_next); \
  182. } while (0)
  183. #define SLIST_REMOVE_HEAD(head, field) do { \
  184. SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
  185. } while (0)
  186. /*
  187. * Singly-linked Tail queue declarations.
  188. */
  189. #define STAILQ_HEAD(name, type) \
  190. struct name { \
  191. struct type *stqh_first;/* first element */ \
  192. struct type **stqh_last;/* addr of last next element */ \
  193. }
  194. #define STAILQ_HEAD_INITIALIZER(head) \
  195. { NULL, &(head).stqh_first }
  196. #define STAILQ_ENTRY(type) \
  197. struct { \
  198. struct type *stqe_next; /* next element */ \
  199. }
  200. /*
  201. * Singly-linked Tail queue functions.
  202. */
  203. #define STAILQ_CONCAT(head1, head2) do { \
  204. if (!STAILQ_EMPTY((head2))) { \
  205. *(head1)->stqh_last = (head2)->stqh_first; \
  206. (head1)->stqh_last = (head2)->stqh_last; \
  207. STAILQ_INIT((head2)); \
  208. } \
  209. } while (0)
  210. #define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
  211. #define STAILQ_FIRST(head) ((head)->stqh_first)
  212. #define STAILQ_FOREACH(var, head, field) \
  213. for((var) = STAILQ_FIRST((head)); \
  214. (var); \
  215. (var) = STAILQ_NEXT((var), field))
  216. #define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
  217. for ((var) = STAILQ_FIRST((head)); \
  218. (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
  219. (var) = (tvar))
  220. #define STAILQ_INIT(head) do { \
  221. STAILQ_FIRST((head)) = NULL; \
  222. (head)->stqh_last = &STAILQ_FIRST((head)); \
  223. } while (0)
  224. #define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \
  225. if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
  226. (head)->stqh_last = &STAILQ_NEXT((elm), field); \
  227. STAILQ_NEXT((tqelm), field) = (elm); \
  228. } while (0)
  229. #define STAILQ_INSERT_HEAD(head, elm, field) do { \
  230. if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
  231. (head)->stqh_last = &STAILQ_NEXT((elm), field); \
  232. STAILQ_FIRST((head)) = (elm); \
  233. } while (0)
  234. #define STAILQ_INSERT_TAIL(head, elm, field) do { \
  235. STAILQ_NEXT((elm), field) = NULL; \
  236. *(head)->stqh_last = (elm); \
  237. (head)->stqh_last = &STAILQ_NEXT((elm), field); \
  238. } while (0)
  239. #define STAILQ_LAST(head, type, field) \
  240. (STAILQ_EMPTY((head)) ? \
  241. NULL : \
  242. ((struct type *)(void *) \
  243. ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
  244. #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
  245. #define STAILQ_REMOVE(head, elm, type, field) do { \
  246. if (STAILQ_FIRST((head)) == (elm)) { \
  247. STAILQ_REMOVE_HEAD((head), field); \
  248. } \
  249. else { \
  250. struct type *curelm = STAILQ_FIRST((head)); \
  251. while (STAILQ_NEXT(curelm, field) != (elm)) \
  252. curelm = STAILQ_NEXT(curelm, field); \
  253. if ((STAILQ_NEXT(curelm, field) = \
  254. STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL)\
  255. (head)->stqh_last = &STAILQ_NEXT((curelm), field);\
  256. } \
  257. TRASHIT((elm)->field.stqe_next); \
  258. } while (0)
  259. #define STAILQ_REMOVE_HEAD(head, field) do { \
  260. if ((STAILQ_FIRST((head)) = \
  261. STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
  262. (head)->stqh_last = &STAILQ_FIRST((head)); \
  263. } while (0)
  264. /*
  265. * List declarations.
  266. */
  267. #define LIST_HEAD(name, type) \
  268. struct name { \
  269. struct type *lh_first; /* first element */ \
  270. }
  271. #define LIST_HEAD_INITIALIZER(head) \
  272. { NULL }
  273. #define LIST_ENTRY(type) \
  274. struct { \
  275. struct type *le_next; /* next element */ \
  276. struct type **le_prev; /* address of previous next element */ \
  277. }
  278. /*
  279. * List functions.
  280. */
  281. #define LIST_EMPTY(head) ((head)->lh_first == NULL)
  282. #define LIST_FIRST(head) ((head)->lh_first)
  283. #define LIST_FOREACH(var, head, field) \
  284. for ((var) = LIST_FIRST((head)); \
  285. (var); \
  286. (var) = LIST_NEXT((var), field))
  287. #define LIST_FOREACH_SAFE(var, head, field, tvar) \
  288. for ((var) = LIST_FIRST((head)); \
  289. (var) && ((tvar) = LIST_NEXT((var), field), 1); \
  290. (var) = (tvar))
  291. #define LIST_INIT(head) do { \
  292. LIST_FIRST((head)) = NULL; \
  293. } while (0)
  294. #define LIST_INSERT_AFTER(listelm, elm, field) do { \
  295. QMD_LIST_CHECK_NEXT(listelm, field); \
  296. if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
  297. LIST_NEXT((listelm), field)->field.le_prev = \
  298. &LIST_NEXT((elm), field); \
  299. LIST_NEXT((listelm), field) = (elm); \
  300. (elm)->field.le_prev = &LIST_NEXT((listelm), field); \
  301. } while (0)
  302. #define LIST_INSERT_BEFORE(listelm, elm, field) do { \
  303. QMD_LIST_CHECK_PREV(listelm, field); \
  304. (elm)->field.le_prev = (listelm)->field.le_prev; \
  305. LIST_NEXT((elm), field) = (listelm); \
  306. *(listelm)->field.le_prev = (elm); \
  307. (listelm)->field.le_prev = &LIST_NEXT((elm), field); \
  308. } while (0)
  309. #define LIST_INSERT_HEAD(head, elm, field) do { \
  310. QMD_LIST_CHECK_HEAD((head), field); \
  311. if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
  312. LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
  313. LIST_FIRST((head)) = (elm); \
  314. (elm)->field.le_prev = &LIST_FIRST((head)); \
  315. } while (0)
  316. #define LIST_NEXT(elm, field) ((elm)->field.le_next)
  317. #define LIST_REMOVE(elm, field) do { \
  318. QMD_LIST_CHECK_NEXT(elm, field); \
  319. QMD_LIST_CHECK_PREV(elm, field); \
  320. if (LIST_NEXT((elm), field) != NULL) \
  321. LIST_NEXT((elm), field)->field.le_prev = \
  322. (elm)->field.le_prev; \
  323. *(elm)->field.le_prev = LIST_NEXT((elm), field); \
  324. TRASHIT((elm)->field.le_next); \
  325. TRASHIT((elm)->field.le_prev); \
  326. } while (0)
  327. /*
  328. * Tail queue declarations.
  329. */
  330. #define TAILQ_HEAD(name, type) \
  331. struct name { \
  332. struct type *tqh_first; /* first element */ \
  333. struct type **tqh_last; /* addr of last next element */ \
  334. TRACEBUF \
  335. }
  336. #define TAILQ_HEAD_INITIALIZER(head) \
  337. { NULL, &(head).tqh_first }
  338. #define TAILQ_ENTRY(type) \
  339. struct { \
  340. struct type *tqe_next; /* next element */ \
  341. struct type **tqe_prev; /* address of previous next element */ \
  342. TRACEBUF \
  343. }
  344. /*
  345. * Tail queue functions.
  346. */
  347. #define TAILQ_CONCAT(head1, head2, field) do { \
  348. if (!TAILQ_EMPTY(head2)) { \
  349. *(head1)->tqh_last = (head2)->tqh_first; \
  350. (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
  351. (head1)->tqh_last = (head2)->tqh_last; \
  352. TAILQ_INIT((head2)); \
  353. QMD_TRACE_HEAD(head1); \
  354. QMD_TRACE_HEAD(head2); \
  355. } \
  356. } while (0)
  357. #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
  358. #define TAILQ_FIRST(head) ((head)->tqh_first)
  359. #define TAILQ_FOREACH(var, head, field) \
  360. for ((var) = TAILQ_FIRST((head)); \
  361. (var); \
  362. (var) = TAILQ_NEXT((var), field))
  363. #define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
  364. for ((var) = TAILQ_FIRST((head)); \
  365. (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
  366. (var) = (tvar))
  367. #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
  368. for ((var) = TAILQ_LAST((head), headname); \
  369. (var); \
  370. (var) = TAILQ_PREV((var), headname, field))
  371. #define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \
  372. for ((var) = TAILQ_LAST((head), headname); \
  373. (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
  374. (var) = (tvar))
  375. #define TAILQ_INIT(head) do { \
  376. TAILQ_FIRST((head)) = NULL; \
  377. (head)->tqh_last = &TAILQ_FIRST((head)); \
  378. QMD_TRACE_HEAD(head); \
  379. } while (0)
  380. #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
  381. QMD_TAILQ_CHECK_NEXT(listelm, field); \
  382. if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
  383. TAILQ_NEXT((elm), field)->field.tqe_prev = \
  384. &TAILQ_NEXT((elm), field); \
  385. else { \
  386. (head)->tqh_last = &TAILQ_NEXT((elm), field); \
  387. QMD_TRACE_HEAD(head); \
  388. } \
  389. TAILQ_NEXT((listelm), field) = (elm); \
  390. (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \
  391. QMD_TRACE_ELEM(&(elm)->field); \
  392. QMD_TRACE_ELEM(&listelm->field); \
  393. } while (0)
  394. #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
  395. QMD_TAILQ_CHECK_PREV(listelm, field); \
  396. (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
  397. TAILQ_NEXT((elm), field) = (listelm); \
  398. *(listelm)->field.tqe_prev = (elm); \
  399. (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
  400. QMD_TRACE_ELEM(&(elm)->field); \
  401. QMD_TRACE_ELEM(&listelm->field); \
  402. } while (0)
  403. #define TAILQ_INSERT_HEAD(head, elm, field) do { \
  404. QMD_TAILQ_CHECK_HEAD(head, field); \
  405. if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
  406. TAILQ_FIRST((head))->field.tqe_prev = \
  407. &TAILQ_NEXT((elm), field); \
  408. else \
  409. (head)->tqh_last = &TAILQ_NEXT((elm), field); \
  410. TAILQ_FIRST((head)) = (elm); \
  411. (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
  412. QMD_TRACE_HEAD(head); \
  413. QMD_TRACE_ELEM(&(elm)->field); \
  414. } while (0)
  415. #define TAILQ_INSERT_TAIL(head, elm, field) do { \
  416. QMD_TAILQ_CHECK_TAIL(head, field); \
  417. TAILQ_NEXT((elm), field) = NULL; \
  418. (elm)->field.tqe_prev = (head)->tqh_last; \
  419. *(head)->tqh_last = (elm); \
  420. (head)->tqh_last = &TAILQ_NEXT((elm), field); \
  421. QMD_TRACE_HEAD(head); \
  422. QMD_TRACE_ELEM(&(elm)->field); \
  423. } while (0)
  424. #define TAILQ_LAST(head, headname) \
  425. (*(((struct headname *)((head)->tqh_last))->tqh_last))
  426. #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
  427. #define TAILQ_PREV(elm, headname, field) \
  428. (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
  429. #define TAILQ_REMOVE(head, elm, field) do { \
  430. QMD_TAILQ_CHECK_NEXT(elm, field); \
  431. QMD_TAILQ_CHECK_PREV(elm, field); \
  432. if ((TAILQ_NEXT((elm), field)) != NULL) \
  433. TAILQ_NEXT((elm), field)->field.tqe_prev = \
  434. (elm)->field.tqe_prev; \
  435. else { \
  436. (head)->tqh_last = (elm)->field.tqe_prev; \
  437. QMD_TRACE_HEAD(head); \
  438. } \
  439. *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \
  440. TRASHIT((elm)->field.tqe_next); \
  441. TRASHIT((elm)->field.tqe_prev); \
  442. QMD_TRACE_ELEM(&(elm)->field); \
  443. } while (0)
  444. #endif /* !_LIST_H */