Lines Matching refs:link

55  *          APR_RING_ENTRY(my_element_t) link;
85 * This struct looks just like the element link struct so that we can
157 * @param link The name of the APR_RING_ENTRY in the element struct
159 #define APR_RING_SENTINEL(hp, elem, link) \
160 (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
175 * @param link The name of the APR_RING_ENTRY in the element struct
177 #define APR_RING_NEXT(ep, link) (ep)->link.next
181 * @param link The name of the APR_RING_ENTRY in the element struct
183 #define APR_RING_PREV(ep, link) (ep)->link.prev
190 * @param link The name of the APR_RING_ENTRY in the element struct
192 #define APR_RING_INIT(hp, elem, link) do { \
193 APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link); \
194 APR_RING_LAST((hp)) = APR_RING_SENTINEL((hp), elem, link); \
201 * @param link The name of the APR_RING_ENTRY in the element struct
204 #define APR_RING_EMPTY(hp, elem, link) \
205 (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
210 * @param link The name of the APR_RING_ENTRY in the element struct
212 #define APR_RING_ELEM_INIT(ep, link) do { \
213 APR_RING_NEXT((ep), link) = (ep); \
214 APR_RING_PREV((ep), link) = (ep); \
226 * @param link The name of the APR_RING_ENTRY in the element struct
228 #define APR_RING_SPLICE_BEFORE(lep, ep1, epN, link) do { \
229 APR_RING_NEXT((epN), link) = (lep); \
230 APR_RING_PREV((ep1), link) = APR_RING_PREV((lep), link); \
231 APR_RING_NEXT(APR_RING_PREV((lep), link), link) = (ep1); \
232 APR_RING_PREV((lep), link) = (epN); \
243 * @param link The name of the APR_RING_ENTRY in the element struct
245 #define APR_RING_SPLICE_AFTER(lep, ep1, epN, link) do { \
246 APR_RING_PREV((ep1), link) = (lep); \
247 APR_RING_NEXT((epN), link) = APR_RING_NEXT((lep), link); \
248 APR_RING_PREV(APR_RING_NEXT((lep), link), link) = (epN); \
249 APR_RING_NEXT((lep), link) = (ep1); \
259 * @param link The name of the APR_RING_ENTRY in the element struct
261 #define APR_RING_INSERT_BEFORE(lep, nep, link) \
262 APR_RING_SPLICE_BEFORE((lep), (nep), (nep), link)
271 * @param link The name of the APR_RING_ENTRY in the element struct
273 #define APR_RING_INSERT_AFTER(lep, nep, link) \
274 APR_RING_SPLICE_AFTER((lep), (nep), (nep), link)
284 * @param link The name of the APR_RING_ENTRY in the element struct
286 #define APR_RING_SPLICE_HEAD(hp, ep1, epN, elem, link) \
287 APR_RING_SPLICE_AFTER(APR_RING_SENTINEL((hp), elem, link), \
288 (ep1), (epN), link)
297 * @param link The name of the APR_RING_ENTRY in the element struct
299 #define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) \
300 APR_RING_SPLICE_BEFORE(APR_RING_SENTINEL((hp), elem, link), \
301 (ep1), (epN), link)
309 * @param link The name of the APR_RING_ENTRY in the element struct
311 #define APR_RING_INSERT_HEAD(hp, nep, elem, link) \
312 APR_RING_SPLICE_HEAD((hp), (nep), (nep), elem, link)
320 * @param link The name of the APR_RING_ENTRY in the element struct
322 #define APR_RING_INSERT_TAIL(hp, nep, elem, link) \
323 APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
330 * @param link The name of the APR_RING_ENTRY in the element struct
332 #define APR_RING_CONCAT(h1, h2, elem, link) do { \
333 if (!APR_RING_EMPTY((h2), elem, link)) { \
334 APR_RING_SPLICE_BEFORE(APR_RING_SENTINEL((h1), elem, link), \
336 APR_RING_LAST((h2)), link); \
337 APR_RING_INIT((h2), elem, link); \
346 * @param link The name of the APR_RING_ENTRY in the element struct
348 #define APR_RING_PREPEND(h1, h2, elem, link) do { \
349 if (!APR_RING_EMPTY((h2), elem, link)) { \
350 APR_RING_SPLICE_AFTER(APR_RING_SENTINEL((h1), elem, link), \
352 APR_RING_LAST((h2)), link); \
353 APR_RING_INIT((h2), elem, link); \
362 * @param link The name of the APR_RING_ENTRY in the element struct
364 #define APR_RING_UNSPLICE(ep1, epN, link) do { \
365 APR_RING_NEXT(APR_RING_PREV((ep1), link), link) = \
366 APR_RING_NEXT((epN), link); \
367 APR_RING_PREV(APR_RING_NEXT((epN), link), link) = \
368 APR_RING_PREV((ep1), link); \
375 * @param link The name of the APR_RING_ENTRY in the element struct
377 #define APR_RING_REMOVE(ep, link) \
378 APR_RING_UNSPLICE((ep), (ep), link)
385 * @param link The name of the APR_RING_ENTRY in the element struct
387 #define APR_RING_FOREACH(ep, head, elem, link) \
389 ep != APR_RING_SENTINEL(head, elem, link); \
390 ep = APR_RING_NEXT(ep, link))
398 * @param link The name of the APR_RING_ENTRY in the element struct
400 #define APR_RING_FOREACH_SAFE(ep1, ep2, head, elem, link) \
401 for (ep1 = APR_RING_FIRST(head), ep2 = APR_RING_NEXT(ep1, link); \
402 ep1 != APR_RING_SENTINEL(head, elem, link); \
403 ep1 = ep2, ep2 = APR_RING_NEXT(ep1, link))
414 #define APR_RING_CHECK(hp, elem, link, msg) \
415 APR_RING_CHECK_ELEM(APR_RING_SENTINEL(hp, elem, link), elem, link, msg)
417 #define APR_RING_CHECK_ELEM(ep, elem, link, msg) do { \
424 APR_RING_NEXT(here, link)); \
426 APR_RING_PREV(here, link)); \
428 APR_RING_PREV(APR_RING_NEXT(here, link), link)); \
430 APR_RING_NEXT(APR_RING_PREV(here, link), link)); \
431 if (APR_RING_PREV(APR_RING_NEXT(here, link), link) != here) { \
435 if (APR_RING_NEXT(APR_RING_PREV(here, link), link) != here) { \
439 here = APR_RING_NEXT(here, link); \
444 #define APR_RING_CHECK_CONSISTENCY(hp, elem, link) \
445 APR_RING_CHECK_ELEM_CONSISTENCY(APR_RING_SENTINEL(hp, elem, link),\
446 elem, link)
448 #define APR_RING_CHECK_ELEM_CONSISTENCY(ep, elem, link) do { \
452 assert(APR_RING_PREV(APR_RING_NEXT(here, link), link) == here); \
453 assert(APR_RING_NEXT(APR_RING_PREV(here, link), link) == here); \
454 here = APR_RING_NEXT(here, link); \
473 * @param link The name of the APR_RING_ENTRY in the element struct
476 #define APR_RING_CHECK(hp, elem, link, msg)
484 * @param link The name of the APR_RING_ENTRY in the element struct
486 #define APR_RING_CHECK_CONSISTENCY(hp, elem, link)
494 * @param link The name of the APR_RING_ENTRY in the element struct
497 #define APR_RING_CHECK_ELEM(ep, elem, link, msg)
506 * @param link The name of the APR_RING_ENTRY in the element struct
508 #define APR_RING_CHECK_ELEM_CONSISTENCY(ep, elem, link)