Lines Matching refs:add
314 #define LL_PREPEND(head,add) \ argument
315 LL_PREPEND2(head,add,next)
317 #define LL_PREPEND2(head,add,next) \ argument
319 (add)->next = (head); \
320 (head) = (add); \
338 #define LL_APPEND(head,add) \ argument
339 LL_APPEND2(head,add,next)
341 #define LL_APPEND2(head,add,next) \ argument
344 (add)->next=NULL; \
348 _tmp->next=(add); \
350 (head)=(add); \
354 #define LL_INSERT_INORDER(head,add,cmp) \ argument
355 LL_INSERT_INORDER2(head,add,cmp,next)
357 #define LL_INSERT_INORDER2(head,add,cmp,next) \ argument
361 LL_LOWER_BOUND2(head, _tmp, add, cmp, next); \
362 LL_APPEND_ELEM2(head, _tmp, add, next); \
364 (head) = (add); \
445 #define LL_REPLACE_ELEM2(head, el, add, next) \ argument
450 assert((add) != NULL); \
451 (add)->next = (el)->next; \
453 (head) = (add); \
460 _tmp->next = (add); \
465 #define LL_REPLACE_ELEM(head, el, add) \ argument
466 LL_REPLACE_ELEM2(head, el, add, next)
468 #define LL_PREPEND_ELEM2(head, el, add, next) \ argument
473 assert((add) != NULL); \
474 (add)->next = (el); \
476 (head) = (add); \
483 _tmp->next = (add); \
487 LL_APPEND2(head, add, next); \
491 #define LL_PREPEND_ELEM(head, el, add) \ argument
492 LL_PREPEND_ELEM2(head, el, add, next)
494 #define LL_APPEND_ELEM2(head, el, add, next) \ argument
498 assert((add) != NULL); \
499 (add)->next = (el)->next; \
500 (el)->next = (add); \
502 LL_PREPEND2(head, add, next); \
506 #define LL_APPEND_ELEM(head, el, add) \ argument
507 LL_APPEND_ELEM2(head, el, add, next)
527 #define LL_APPEND2(head,add,next) \ argument
530 (add)->next = head; /* use add->next as a temp variable */ \
531 while ((add)->next->next) { (add)->next = (add)->next->next; } \
532 (add)->next->next=(add); \
534 (head)=(add); \
536 (add)->next=NULL; \
540 #define LL_INSERT_INORDER2(head,add,cmp,next) \ argument
542 if ((head) == NULL || (cmp(head, add)) >= 0) { \
543 (add)->next = (head); \
544 (head) = (add); \
547 while ((head)->next != NULL && (cmp((head)->next, add)) < 0) { \
550 (add)->next = (head)->next; \
551 (head)->next = (add); \
574 #define LL_REPLACE_ELEM2(head, el, add, next) \ argument
578 assert((add) != NULL); \
580 (head) = (add); \
582 (add)->next = head; \
583 while ((add)->next->next && ((add)->next->next != (el))) { \
584 (add)->next = (add)->next->next; \
586 if ((add)->next->next) { \
587 (add)->next->next = (add); \
590 (add)->next = (el)->next; \
594 #define LL_PREPEND_ELEM2(head, el, add, next) \ argument
598 assert((add) != NULL); \
600 (head) = (add); \
602 (add)->next = (head); \
603 while ((add)->next->next && ((add)->next->next != (el))) { \
604 (add)->next = (add)->next->next; \
606 if ((add)->next->next) { \
607 (add)->next->next = (add); \
610 (add)->next = (el); \
612 LL_APPEND2(head, add, next); \
621 #define DL_PREPEND(head,add) \ argument
622 DL_PREPEND2(head,add,prev,next)
624 #define DL_PREPEND2(head,add,prev,next) \ argument
626 (add)->next = (head); \
628 (add)->prev = (head)->prev; \
629 (head)->prev = (add); \
631 (add)->prev = (add); \
633 (head) = (add); \
636 #define DL_APPEND(head,add) \ argument
637 DL_APPEND2(head,add,prev,next)
639 #define DL_APPEND2(head,add,prev,next) \ argument
642 (add)->prev = (head)->prev; \
643 (head)->prev->next = (add); \
644 (head)->prev = (add); \
645 (add)->next = NULL; \
647 (head)=(add); \
653 #define DL_INSERT_INORDER(head,add,cmp) \ argument
654 DL_INSERT_INORDER2(head,add,cmp,prev,next)
656 #define DL_INSERT_INORDER2(head,add,cmp,prev,next) \ argument
660 DL_LOWER_BOUND2(head, _tmp, add, cmp, next); \
661 DL_APPEND_ELEM2(head, _tmp, add, prev, next); \
663 (head) = (add); \
753 #define DL_REPLACE_ELEM2(head, el, add, prev, next) \ argument
757 assert((add) != NULL); \
759 (head) = (add); \
760 (add)->next = (el)->next; \
762 (add)->prev = (add); \
764 (add)->prev = (el)->prev; \
765 (add)->next->prev = (add); \
768 (add)->next = (el)->next; \
769 (add)->prev = (el)->prev; \
770 (add)->prev->next = (add); \
772 (head)->prev = (add); \
774 (add)->next->prev = (add); \
779 #define DL_REPLACE_ELEM(head, el, add) \ argument
780 DL_REPLACE_ELEM2(head, el, add, prev, next)
782 #define DL_PREPEND_ELEM2(head, el, add, prev, next) \ argument
786 assert((add) != NULL); \
787 (add)->next = (el); \
788 (add)->prev = (el)->prev; \
789 (el)->prev = (add); \
791 (head) = (add); \
793 (add)->prev->next = (add); \
796 DL_APPEND2(head, add, prev, next); \
800 #define DL_PREPEND_ELEM(head, el, add) \ argument
801 DL_PREPEND_ELEM2(head, el, add, prev, next)
803 #define DL_APPEND_ELEM2(head, el, add, prev, next) \ argument
807 assert((add) != NULL); \
808 (add)->next = (el)->next; \
809 (add)->prev = (el); \
810 (el)->next = (add); \
811 if ((add)->next) { \
812 (add)->next->prev = (add); \
814 (head)->prev = (add); \
817 DL_PREPEND2(head, add, prev, next); \
821 #define DL_APPEND_ELEM(head, el, add) \ argument
822 DL_APPEND_ELEM2(head, el, add, prev, next)
828 #define DL_INSERT_INORDER2(head,add,cmp,prev,next) \ argument
831 (add)->prev = (add); \
832 (add)->next = NULL; \
833 (head) = (add); \
834 } else if ((cmp(head, add)) >= 0) { \
835 (add)->prev = (head)->prev; \
836 (add)->next = (head); \
837 (head)->prev = (add); \
838 (head) = (add); \
841 while ((head)->next && (cmp((head)->next, add)) < 0) { \
844 (add)->prev = (head); \
845 (add)->next = (head)->next; \
846 (head)->next = (add); \
848 if ((add)->next) { \
849 (add)->next->prev = (add); \
851 (head)->prev = (add); \
860 #define CDL_APPEND(head,add) \ argument
861 CDL_APPEND2(head,add,prev,next)
863 #define CDL_APPEND2(head,add,prev,next) \ argument
866 (add)->prev = (head)->prev; \
867 (add)->next = (head); \
868 (head)->prev = (add); \
869 (add)->prev->next = (add); \
871 (add)->prev = (add); \
872 (add)->next = (add); \
873 (head) = (add); \
877 #define CDL_PREPEND(head,add) \ argument
878 CDL_PREPEND2(head,add,prev,next)
880 #define CDL_PREPEND2(head,add,prev,next) \ argument
883 (add)->prev = (head)->prev; \
884 (add)->next = (head); \
885 (head)->prev = (add); \
886 (add)->prev->next = (add); \
888 (add)->prev = (add); \
889 (add)->next = (add); \
891 (head) = (add); \
894 #define CDL_INSERT_INORDER(head,add,cmp) \ argument
895 CDL_INSERT_INORDER2(head,add,cmp,prev,next)
897 #define CDL_INSERT_INORDER2(head,add,cmp,prev,next) \ argument
901 CDL_LOWER_BOUND2(head, _tmp, add, cmp, next); \
902 CDL_APPEND_ELEM2(head, _tmp, add, prev, next); \
904 (head) = (add); \
983 #define CDL_REPLACE_ELEM2(head, el, add, prev, next) \ argument
987 assert((add) != NULL); \
989 (add)->next = (add); \
990 (add)->prev = (add); \
991 (head) = (add); \
993 (add)->next = (el)->next; \
994 (add)->prev = (el)->prev; \
995 (add)->next->prev = (add); \
996 (add)->prev->next = (add); \
998 (head) = (add); \
1003 #define CDL_REPLACE_ELEM(head, el, add) \ argument
1004 CDL_REPLACE_ELEM2(head, el, add, prev, next)
1006 #define CDL_PREPEND_ELEM2(head, el, add, prev, next) \ argument
1010 assert((add) != NULL); \
1011 (add)->next = (el); \
1012 (add)->prev = (el)->prev; \
1013 (el)->prev = (add); \
1014 (add)->prev->next = (add); \
1016 (head) = (add); \
1019 CDL_APPEND2(head, add, prev, next); \
1023 #define CDL_PREPEND_ELEM(head, el, add) \ argument
1024 CDL_PREPEND_ELEM2(head, el, add, prev, next)
1026 #define CDL_APPEND_ELEM2(head, el, add, prev, next) \ argument
1030 assert((add) != NULL); \
1031 (add)->next = (el)->next; \
1032 (add)->prev = (el); \
1033 (el)->next = (add); \
1034 (add)->next->prev = (add); \
1036 CDL_PREPEND2(head, add, prev, next); \
1040 #define CDL_APPEND_ELEM(head, el, add) \ argument
1041 CDL_APPEND_ELEM2(head, el, add, prev, next)
1047 #define CDL_INSERT_INORDER2(head,add,cmp,prev,next) \ argument
1050 (add)->prev = (add); \
1051 (add)->next = (add); \
1052 (head) = (add); \
1053 } else if ((cmp(head, add)) >= 0) { \
1054 (add)->prev = (head)->prev; \
1055 (add)->next = (head); \
1056 (add)->prev->next = (add); \
1057 (head)->prev = (add); \
1058 (head) = (add); \
1061 while ((char*)(head)->next != _tmp && (cmp((head)->next, add)) < 0) { \
1064 (add)->prev = (head); \
1065 (add)->next = (head)->next; \
1066 (add)->next->prev = (add); \
1067 (head)->next = (add); \