Lines Matching refs:head
309 #define LL_PREPEND(head,add) \ argument
310 LL_PREPEND2(head,add,next)
312 #define LL_PREPEND2(head,add,next) \ argument
314 (add)->next = head; \
315 head = add; \
333 #define LL_APPEND(head,add) \ argument
334 LL_APPEND2(head,add,next)
336 #define LL_APPEND2(head,add,next) \ argument
338 LDECLTYPE(head) _tmp; \
340 if (head) { \
341 _tmp = head; \
345 (head)=(add); \
349 #define LL_DELETE(head,del) \ argument
350 LL_DELETE2(head,del,next)
352 #define LL_DELETE2(head,del,next) \ argument
354 LDECLTYPE(head) _tmp; \
355 if ((head) == (del)) { \
356 (head)=(head)->next; \
358 _tmp = head; \
369 #define LL_APPEND_VS2008(head,add) \ argument
370 LL_APPEND2_VS2008(head,add,next)
372 #define LL_APPEND2_VS2008(head,add,next) \ argument
374 if (head) { \
375 (add)->next = head; /* use add->next as a temp variable */ \
379 (head)=(add); \
384 #define LL_DELETE_VS2008(head,del) \ argument
385 LL_DELETE2_VS2008(head,del,next)
387 #define LL_DELETE2_VS2008(head,del,next) \ argument
389 if ((head) == (del)) { \
390 (head)=(head)->next; \
392 char *_tmp = (char*)(head); \
393 while ((head)->next && ((head)->next != (del))) { \
394 head = (head)->next; \
396 if ((head)->next) { \
397 (head)->next = ((del)->next); \
400 char **_head_alias = (char**)&(head); \
419 #define LL_COUNT(head,el,counter) \ argument
420 LL_COUNT2(head,el,counter,next) \
422 #define LL_COUNT2(head,el,counter,next) \ argument
425 LL_FOREACH2(head,el,next){ ++counter; } \
428 #define LL_FOREACH(head,el) \ argument
429 LL_FOREACH2(head,el,next)
431 #define LL_FOREACH2(head,el,next) \ argument
432 for(el=head;el;el=(el)->next)
434 #define LL_FOREACH_SAFE(head,el,tmp) \ argument
435 LL_FOREACH_SAFE2(head,el,tmp,next)
437 #define LL_FOREACH_SAFE2(head,el,tmp,next) \ argument
438 for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp)
440 #define LL_SEARCH_SCALAR(head,out,field,val) \ argument
441 LL_SEARCH_SCALAR2(head,out,field,val,next)
443 #define LL_SEARCH_SCALAR2(head,out,field,val,next) \ argument
445 LL_FOREACH2(head,out,next) { \
450 #define LL_SEARCH(head,out,elt,cmp) \ argument
451 LL_SEARCH2(head,out,elt,cmp,next)
453 #define LL_SEARCH2(head,out,elt,cmp,next) \ argument
455 LL_FOREACH2(head,out,next) { \
460 #define LL_REPLACE_ELEM(head, el, add) \ argument
462 LDECLTYPE(head) _tmp; \
463 assert(head != NULL); \
467 if ((head) == (el)) { \
468 (head) = (add); \
470 _tmp = head; \
480 #define LL_PREPEND_ELEM(head, el, add) \ argument
482 LDECLTYPE(head) _tmp; \
483 assert(head != NULL); \
487 if ((head) == (el)) { \
488 (head) = (add); \
490 _tmp = head; \
504 #define DL_PREPEND(head,add) \ argument
505 DL_PREPEND2(head,add,prev,next)
507 #define DL_PREPEND2(head,add,prev,next) \ argument
509 (add)->next = head; \
510 if (head) { \
511 (add)->prev = (head)->prev; \
512 (head)->prev = (add); \
516 (head) = (add); \
519 #define DL_APPEND(head,add) \ argument
520 DL_APPEND2(head,add,prev,next)
522 #define DL_APPEND2(head,add,prev,next) \ argument
524 if (head) { \
525 (add)->prev = (head)->prev; \
526 (head)->prev->next = (add); \
527 (head)->prev = (add); \
530 (head)=(add); \
531 (head)->prev = (head); \
532 (head)->next = NULL; \
554 #define DL_DELETE(head,del) \ argument
555 DL_DELETE2(head,del,prev,next)
557 #define DL_DELETE2(head,del,prev,next) \ argument
561 (head)=NULL; \
562 } else if ((del)==(head)) { \
564 (head) = (del)->next; \
570 (head)->prev = (del)->prev; \
575 #define DL_COUNT(head,el,counter) \ argument
576 DL_COUNT2(head,el,counter,next) \
578 #define DL_COUNT2(head,el,counter,next) \ argument
581 DL_FOREACH2(head,el,next){ ++counter; } \
584 #define DL_FOREACH(head,el) \ argument
585 DL_FOREACH2(head,el,next)
587 #define DL_FOREACH2(head,el,next) \ argument
588 for(el=head;el;el=(el)->next)
591 #define DL_FOREACH_SAFE(head,el,tmp) \ argument
592 DL_FOREACH_SAFE2(head,el,tmp,next)
594 #define DL_FOREACH_SAFE2(head,el,tmp,next) \ argument
595 for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp)
603 #define DL_REPLACE_ELEM(head, el, add) \ argument
605 assert(head != NULL); \
608 if ((head) == (el)) { \
609 (head) = (add); \
622 (head)->prev = (add); \
629 #define DL_PREPEND_ELEM(head, el, add) \ argument
631 assert(head != NULL); \
637 if ((head) == (el)) { \
638 (head) = (add); \
648 #define CDL_PREPEND(head,add) \ argument
649 CDL_PREPEND2(head,add,prev,next)
651 #define CDL_PREPEND2(head,add,prev,next) \ argument
653 if (head) { \
654 (add)->prev = (head)->prev; \
655 (add)->next = (head); \
656 (head)->prev = (add); \
662 (head)=(add); \
665 #define CDL_DELETE(head,del) \ argument
666 CDL_DELETE2(head,del,prev,next)
668 #define CDL_DELETE2(head,del,prev,next) \ argument
670 if ( ((head)==(del)) && ((head)->next == (head))) { \
671 (head) = 0L; \
675 if ((del) == (head)) (head)=(del)->next; \
679 #define CDL_COUNT(head,el,counter) \ argument
680 CDL_COUNT2(head,el,counter,next) \
682 #define CDL_COUNT2(head, el, counter,next) \ argument
685 CDL_FOREACH2(head,el,next){ ++counter; } \
688 #define CDL_FOREACH(head,el) \ argument
689 CDL_FOREACH2(head,el,next)
691 #define CDL_FOREACH2(head,el,next) \ argument
692 for(el=head;el;el=((el)->next==head ? 0L : (el)->next))
694 #define CDL_FOREACH_SAFE(head,el,tmp1,tmp2) \ argument
695 CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next)
697 #define CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next) \ argument
698 for((el)=(head), ((tmp1)=(head)?((head)->prev):NULL); \
702 #define CDL_SEARCH_SCALAR(head,out,field,val) \ argument
703 CDL_SEARCH_SCALAR2(head,out,field,val,next)
705 #define CDL_SEARCH_SCALAR2(head,out,field,val,next) \ argument
707 CDL_FOREACH2(head,out,next) { \
712 #define CDL_SEARCH(head,out,elt,cmp) \ argument
713 CDL_SEARCH2(head,out,elt,cmp,next)
715 #define CDL_SEARCH2(head,out,elt,cmp,next) \ argument
717 CDL_FOREACH2(head,out,next) { \
722 #define CDL_REPLACE_ELEM(head, el, add) \ argument
724 assert(head != NULL); \
730 (head) = (add); \
736 if ((head) == (el)) { \
737 (head) = (add); \
742 #define CDL_PREPEND_ELEM(head, el, add) \ argument
744 assert(head != NULL); \
751 if ((head) == (el)) { \
752 (head) = (add); \