Lines Matching full:add
316 #define LL_PREPEND(head,add) \ argument
317 LL_PREPEND2(head,add,next)
319 #define LL_PREPEND2(head,add,next) \ argument
321 (add)->next = (head); \
322 (head) = (add); \
340 #define LL_APPEND(head,add) \ argument
341 LL_APPEND2(head,add,next)
343 #define LL_APPEND2(head,add,next) \ argument
346 (add)->next=NULL; \
350 _tmp->next=(add); \
352 (head)=(add); \
356 #define LL_INSERT_INORDER(head,add,cmp) \ argument
357 LL_INSERT_INORDER2(head,add,cmp,next)
359 #define LL_INSERT_INORDER2(head,add,cmp,next) \ argument
363 LL_LOWER_BOUND2(head, _tmp, add, cmp, next); \
364 LL_APPEND_ELEM2(head, _tmp, add, next); \
366 (head) = (add); \
447 #define LL_REPLACE_ELEM2(head, el, add, next) \ argument
452 assert((add) != NULL); \
453 (add)->next = (el)->next; \
455 (head) = (add); \
462 _tmp->next = (add); \
467 #define LL_REPLACE_ELEM(head, el, add) \ argument
468 LL_REPLACE_ELEM2(head, el, add, next)
470 #define LL_PREPEND_ELEM2(head, el, add, next) \ argument
475 assert((add) != NULL); \
476 (add)->next = (el); \
478 (head) = (add); \
485 _tmp->next = (add); \
489 LL_APPEND2(head, add, next); \
493 #define LL_PREPEND_ELEM(head, el, add) \ argument
494 LL_PREPEND_ELEM2(head, el, add, next)
496 #define LL_APPEND_ELEM2(head, el, add, next) \ argument
500 assert((add) != NULL); \
501 (add)->next = (el)->next; \
502 (el)->next = (add); \
504 LL_PREPEND2(head, add, next); \
508 #define LL_APPEND_ELEM(head, el, add) \ argument
509 LL_APPEND_ELEM2(head, el, add, next)
529 #define LL_APPEND2(head,add,next) \ argument
532 (add)->next = head; /* use add->next as a temp variable */ \
533 while ((add)->next->next) { (add)->next = (add)->next->next; } \
534 (add)->next->next=(add); \
536 (head)=(add); \
538 (add)->next=NULL; \
542 #define LL_INSERT_INORDER2(head,add,cmp,next) \ argument
544 if ((head) == NULL || (cmp(head, add)) >= 0) { \
545 (add)->next = (head); \
546 (head) = (add); \
549 while ((head)->next != NULL && (cmp((head)->next, add)) < 0) { \
552 (add)->next = (head)->next; \
553 (head)->next = (add); \
576 #define LL_REPLACE_ELEM2(head, el, add, next) \ argument
580 assert((add) != NULL); \
582 (head) = (add); \
584 (add)->next = head; \
585 while ((add)->next->next && ((add)->next->next != (el))) { \
586 (add)->next = (add)->next->next; \
588 if ((add)->next->next) { \
589 (add)->next->next = (add); \
592 (add)->next = (el)->next; \
596 #define LL_PREPEND_ELEM2(head, el, add, next) \ argument
600 assert((add) != NULL); \
602 (head) = (add); \
604 (add)->next = (head); \
605 while ((add)->next->next && ((add)->next->next != (el))) { \
606 (add)->next = (add)->next->next; \
608 if ((add)->next->next) { \
609 (add)->next->next = (add); \
612 (add)->next = (el); \
614 LL_APPEND2(head, add, next); \
623 #define DL_PREPEND(head,add) \ argument
624 DL_PREPEND2(head,add,prev,next)
626 #define DL_PREPEND2(head,add,prev,next) \ argument
628 (add)->next = (head); \
630 (add)->prev = (head)->prev; \
631 (head)->prev = (add); \
633 (add)->prev = (add); \
635 (head) = (add); \
638 #define DL_APPEND(head,add) \ argument
639 DL_APPEND2(head,add,prev,next)
641 #define DL_APPEND2(head,add,prev,next) \ argument
644 (add)->prev = (head)->prev; \
645 (head)->prev->next = (add); \
646 (head)->prev = (add); \
647 (add)->next = NULL; \
649 (head)=(add); \
655 #define DL_INSERT_INORDER(head,add,cmp) \ argument
656 DL_INSERT_INORDER2(head,add,cmp,prev,next)
658 #define DL_INSERT_INORDER2(head,add,cmp,prev,next) \ argument
662 DL_LOWER_BOUND2(head, _tmp, add, cmp, next); \
663 DL_APPEND_ELEM2(head, _tmp, add, prev, next); \
665 (head) = (add); \
756 #define DL_REPLACE_ELEM2(head, el, add, prev, next) \ argument
760 assert((add) != NULL); \
762 (head) = (add); \
763 (add)->next = (el)->next; \
765 (add)->prev = (add); \
767 (add)->prev = (el)->prev; \
768 (add)->next->prev = (add); \
771 (add)->next = (el)->next; \
772 (add)->prev = (el)->prev; \
773 (add)->prev->next = (add); \
775 (head)->prev = (add); \
777 (add)->next->prev = (add); \
782 #define DL_REPLACE_ELEM(head, el, add) \ argument
783 DL_REPLACE_ELEM2(head, el, add, prev, next)
785 #define DL_PREPEND_ELEM2(head, el, add, prev, next) \ argument
789 assert((add) != NULL); \
790 (add)->next = (el); \
791 (add)->prev = (el)->prev; \
792 (el)->prev = (add); \
794 (head) = (add); \
796 (add)->prev->next = (add); \
799 DL_APPEND2(head, add, prev, next); \
803 #define DL_PREPEND_ELEM(head, el, add) \ argument
804 DL_PREPEND_ELEM2(head, el, add, prev, next)
806 #define DL_APPEND_ELEM2(head, el, add, prev, next) \ argument
810 assert((add) != NULL); \
811 (add)->next = (el)->next; \
812 (add)->prev = (el); \
813 (el)->next = (add); \
814 if ((add)->next) { \
815 (add)->next->prev = (add); \
817 (head)->prev = (add); \
820 DL_PREPEND2(head, add, prev, next); \
824 #define DL_APPEND_ELEM(head, el, add) \ argument
825 DL_APPEND_ELEM2(head, el, add, prev, next)
831 #define DL_INSERT_INORDER2(head,add,cmp,prev,next) \ argument
834 (add)->prev = (add); \
835 (add)->next = NULL; \
836 (head) = (add); \
837 } else if ((cmp(head, add)) >= 0) { \
838 (add)->prev = (head)->prev; \
839 (add)->next = (head); \
840 (head)->prev = (add); \
841 (head) = (add); \
844 while ((head)->next && (cmp((head)->next, add)) < 0) { \
847 (add)->prev = (head); \
848 (add)->next = (head)->next; \
849 (head)->next = (add); \
851 if ((add)->next) { \
852 (add)->next->prev = (add); \
854 (head)->prev = (add); \
863 #define CDL_APPEND(head,add) \ argument
864 CDL_APPEND2(head,add,prev,next)
866 #define CDL_APPEND2(head,add,prev,next) \ argument
869 (add)->prev = (head)->prev; \
870 (add)->next = (head); \
871 (head)->prev = (add); \
872 (add)->prev->next = (add); \
874 (add)->prev = (add); \
875 (add)->next = (add); \
876 (head) = (add); \
880 #define CDL_PREPEND(head,add) \ argument
881 CDL_PREPEND2(head,add,prev,next)
883 #define CDL_PREPEND2(head,add,prev,next) \ argument
886 (add)->prev = (head)->prev; \
887 (add)->next = (head); \
888 (head)->prev = (add); \
889 (add)->prev->next = (add); \
891 (add)->prev = (add); \
892 (add)->next = (add); \
894 (head) = (add); \
897 #define CDL_INSERT_INORDER(head,add,cmp) \ argument
898 CDL_INSERT_INORDER2(head,add,cmp,prev,next)
900 #define CDL_INSERT_INORDER2(head,add,cmp,prev,next) \ argument
904 CDL_LOWER_BOUND2(head, _tmp, add, cmp, next); \
905 CDL_APPEND_ELEM2(head, _tmp, add, prev, next); \
907 (head) = (add); \
986 #define CDL_REPLACE_ELEM2(head, el, add, prev, next) \ argument
990 assert((add) != NULL); \
992 (add)->next = (add); \
993 (add)->prev = (add); \
994 (head) = (add); \
996 (add)->next = (el)->next; \
997 (add)->prev = (el)->prev; \
998 (add)->next->prev = (add); \
999 (add)->prev->next = (add); \
1001 (head) = (add); \
1006 #define CDL_REPLACE_ELEM(head, el, add) \ argument
1007 CDL_REPLACE_ELEM2(head, el, add, prev, next)
1009 #define CDL_PREPEND_ELEM2(head, el, add, prev, next) \ argument
1013 assert((add) != NULL); \
1014 (add)->next = (el); \
1015 (add)->prev = (el)->prev; \
1016 (el)->prev = (add); \
1017 (add)->prev->next = (add); \
1019 (head) = (add); \
1022 CDL_APPEND2(head, add, prev, next); \
1026 #define CDL_PREPEND_ELEM(head, el, add) \ argument
1027 CDL_PREPEND_ELEM2(head, el, add, prev, next)
1029 #define CDL_APPEND_ELEM2(head, el, add, prev, next) \ argument
1033 assert((add) != NULL); \
1034 (add)->next = (el)->next; \
1035 (add)->prev = (el); \
1036 (el)->next = (add); \
1037 (add)->next->prev = (add); \
1039 CDL_PREPEND2(head, add, prev, next); \
1043 #define CDL_APPEND_ELEM(head, el, add) \ argument
1044 CDL_APPEND_ELEM2(head, el, add, prev, next)
1050 #define CDL_INSERT_INORDER2(head,add,cmp,prev,next) \ argument
1053 (add)->prev = (add); \
1054 (add)->next = (add); \
1055 (head) = (add); \
1056 } else if ((cmp(head, add)) >= 0) { \
1057 (add)->prev = (head)->prev; \
1058 (add)->next = (head); \
1059 (add)->prev->next = (add); \
1060 (head)->prev = (add); \
1061 (head) = (add); \
1064 while ((char*)(head)->next != _tmp && (cmp((head)->next, add)) < 0) { \
1067 (add)->prev = (head); \
1068 (add)->next = (head)->next; \
1069 (add)->next->prev = (add); \
1070 (head)->next = (add); \