• Home
  • Raw
  • Download

Lines Matching refs:next

87 #define UTLIST_NEXT(elt,list,next) ((char*)((list)->next))  argument
88 #define UTLIST_NEXTASGN(elt,list,to,next) { char **_alias = (char**)&((list)->next); *_alias=(char*… argument
96 #define UTLIST_NEXT(elt,list,next) ((elt)->next) argument
97 #define UTLIST_NEXTASGN(elt,list,to,next) ((elt)->next)=(to) argument
109 LL_SORT2(list, cmp, next)
111 #define LL_SORT2(list, cmp, next) \ argument
133 UTLIST_SV(_ls_q,list); _ls_q = UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); \
140 UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \
143 UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \
146 UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \
149 UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \
152 UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_ls_e,next); UTLIST_RS(list); \
161 UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,NULL,next); UTLIST_RS(list); \
173 DL_SORT2(list, cmp, prev, next)
175 #define DL_SORT2(list, cmp, prev, next) \ argument
197 UTLIST_SV(_ls_q,list); _ls_q = UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); \
204 UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \
207 UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \
210 UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \
213 UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \
216 UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_ls_e,next); UTLIST_RS(list); \
226 UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,NULL,next); UTLIST_RS(list); \
236 CDL_SORT2(list, cmp, prev, next)
238 #define CDL_SORT2(list, cmp, prev, next) \ argument
263 if (UTLIST_NEXT(_ls_q,list,next) == _ls_oldhead) { \
266 _ls_q = UTLIST_NEXT(_ls_q,list,next); \
275 UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \
279 UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \
283 UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \
287 UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \
291 UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_ls_e,next); UTLIST_RS(list); \
302 UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_tmp,next); UTLIST_RS(list); \
315 LL_PREPEND2(head,add,next)
317 #define LL_PREPEND2(head,add,next) \ argument
319 (add)->next = (head); \
324 LL_CONCAT2(head1,head2,next)
326 #define LL_CONCAT2(head1,head2,next) \ argument
331 while (_tmp->next) { _tmp = _tmp->next; } \
332 _tmp->next=(head2); \
339 LL_APPEND2(head,add,next)
341 #define LL_APPEND2(head,add,next) \ argument
344 (add)->next=NULL; \
347 while (_tmp->next) { _tmp = _tmp->next; } \
348 _tmp->next=(add); \
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); \
365 (head)->next = NULL; \
370 LL_LOWER_BOUND2(head,elt,like,cmp,next)
372 #define LL_LOWER_BOUND2(head,elt,like,cmp,next) \ argument
377 for ((elt) = (head); (elt)->next != NULL; (elt) = (elt)->next) { \
378 if (cmp((elt)->next, like) >= 0) { \
386 LL_DELETE2(head,del,next)
388 #define LL_DELETE2(head,del,next) \ argument
392 (head)=(head)->next; \
395 while (_tmp->next && (_tmp->next != (del))) { \
396 _tmp = _tmp->next; \
398 if (_tmp->next) { \
399 _tmp->next = (del)->next; \
405 LL_COUNT2(head,el,counter,next) \
407 #define LL_COUNT2(head,el,counter,next) \ argument
410 LL_FOREACH2(head,el,next) { ++(counter); } \
414 LL_FOREACH2(head,el,next)
416 #define LL_FOREACH2(head,el,next) \ argument
417 for ((el) = (head); el; (el) = (el)->next)
420 LL_FOREACH_SAFE2(head,el,tmp,next)
422 #define LL_FOREACH_SAFE2(head,el,tmp,next) \ argument
423 for ((el) = (head); (el) && ((tmp) = (el)->next, 1); (el) = (tmp))
426 LL_SEARCH_SCALAR2(head,out,field,val,next)
428 #define LL_SEARCH_SCALAR2(head,out,field,val,next) \ argument
430 LL_FOREACH2(head,out,next) { \
436 LL_SEARCH2(head,out,elt,cmp,next)
438 #define LL_SEARCH2(head,out,elt,cmp,next) \ argument
440 LL_FOREACH2(head,out,next) { \
445 #define LL_REPLACE_ELEM2(head, el, add, next) \ argument
451 (add)->next = (el)->next; \
456 while (_tmp->next && (_tmp->next != (el))) { \
457 _tmp = _tmp->next; \
459 if (_tmp->next) { \
460 _tmp->next = (add); \
466 LL_REPLACE_ELEM2(head, el, add, next)
468 #define LL_PREPEND_ELEM2(head, el, add, next) \ argument
474 (add)->next = (el); \
479 while (_tmp->next && (_tmp->next != (el))) { \
480 _tmp = _tmp->next; \
482 if (_tmp->next) { \
483 _tmp->next = (add); \
487 LL_APPEND2(head, add, next); \
492 LL_PREPEND_ELEM2(head, el, add, next)
494 #define LL_APPEND_ELEM2(head, el, add, next) \ argument
499 (add)->next = (el)->next; \
500 (el)->next = (add); \
502 LL_PREPEND2(head, add, next); \
507 LL_APPEND_ELEM2(head, el, add, next)
513 #define LL_CONCAT2(head1,head2,next) \ argument
518 while ((head1)->next) { (head1) = (head1)->next; } \
519 (head1)->next = (head2); \
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); \
536 (add)->next=NULL; \
540 #define LL_INSERT_INORDER2(head,add,cmp,next) \ argument
543 (add)->next = (head); \
547 while ((head)->next != NULL && (cmp((head)->next, add)) < 0) { \
548 (head) = (head)->next; \
550 (add)->next = (head)->next; \
551 (head)->next = (add); \
557 #define LL_DELETE2(head,del,next) \ argument
560 (head)=(head)->next; \
563 while ((head)->next && ((head)->next != (del))) { \
564 (head) = (head)->next; \
566 if ((head)->next) { \
567 (head)->next = ((del)->next); \
574 #define LL_REPLACE_ELEM2(head, el, add, next) \ argument
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
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); \
622 DL_PREPEND2(head,add,prev,next)
624 #define DL_PREPEND2(head,add,prev,next) \ argument
626 (add)->next = (head); \
637 DL_APPEND2(head,add,prev,next)
639 #define DL_APPEND2(head,add,prev,next) \ argument
643 (head)->prev->next = (add); \
645 (add)->next = NULL; \
649 (head)->next = NULL; \
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); \
665 (head)->next = NULL; \
670 DL_LOWER_BOUND2(head,elt,like,cmp,next)
672 #define DL_LOWER_BOUND2(head,elt,like,cmp,next) \ argument
677 for ((elt) = (head); (elt)->next != NULL; (elt) = (elt)->next) { \
678 if ((cmp((elt)->next, like)) >= 0) { \
686 DL_CONCAT2(head1,head2,prev,next)
688 #define DL_CONCAT2(head1,head2,prev,next) \ argument
695 (head1)->prev->next = (head2); \
704 DL_DELETE2(head,del,prev,next)
706 #define DL_DELETE2(head,del,prev,next) \ argument
713 (del)->next->prev = (del)->prev; \
714 (head) = (del)->next; \
716 (del)->prev->next = (del)->next; \
717 if ((del)->next) { \
718 (del)->next->prev = (del)->prev; \
726 DL_COUNT2(head,el,counter,next) \
728 #define DL_COUNT2(head,el,counter,next) \ argument
731 DL_FOREACH2(head,el,next) { ++(counter); } \
735 DL_FOREACH2(head,el,next)
737 #define DL_FOREACH2(head,el,next) \ argument
738 for ((el) = (head); el; (el) = (el)->next)
742 DL_FOREACH_SAFE2(head,el,tmp,next)
744 #define DL_FOREACH_SAFE2(head,el,tmp,next) \ argument
745 for ((el) = (head); (el) && ((tmp) = (el)->next, 1); (el) = (tmp))
753 #define DL_REPLACE_ELEM2(head, el, add, prev, next) \ argument
760 (add)->next = (el)->next; \
761 if ((el)->next == NULL) { \
765 (add)->next->prev = (add); \
768 (add)->next = (el)->next; \
770 (add)->prev->next = (add); \
771 if ((el)->next == NULL) { \
774 (add)->next->prev = (add); \
780 DL_REPLACE_ELEM2(head, el, add, prev, next)
782 #define DL_PREPEND_ELEM2(head, el, add, prev, next) \ argument
787 (add)->next = (el); \
793 (add)->prev->next = (add); \
796 DL_APPEND2(head, add, prev, next); \
801 DL_PREPEND_ELEM2(head, el, add, prev, next)
803 #define DL_APPEND_ELEM2(head, el, add, prev, next) \ argument
808 (add)->next = (el)->next; \
810 (el)->next = (add); \
811 if ((add)->next) { \
812 (add)->next->prev = (add); \
817 DL_PREPEND2(head, add, prev, next); \
822 DL_APPEND_ELEM2(head, el, add, prev, next)
828 #define DL_INSERT_INORDER2(head,add,cmp,prev,next) \ argument
832 (add)->next = NULL; \
836 (add)->next = (head); \
841 while ((head)->next && (cmp((head)->next, add)) < 0) { \
842 (head) = (head)->next; \
845 (add)->next = (head)->next; \
846 (head)->next = (add); \
848 if ((add)->next) { \
849 (add)->next->prev = (add); \
861 CDL_APPEND2(head,add,prev,next)
863 #define CDL_APPEND2(head,add,prev,next) \ argument
867 (add)->next = (head); \
869 (add)->prev->next = (add); \
872 (add)->next = (add); \
878 CDL_PREPEND2(head,add,prev,next)
880 #define CDL_PREPEND2(head,add,prev,next) \ argument
884 (add)->next = (head); \
886 (add)->prev->next = (add); \
889 (add)->next = (add); \
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); \
905 (head)->next = (head); \
911 CDL_LOWER_BOUND2(head,elt,like,cmp,next)
913 #define CDL_LOWER_BOUND2(head,elt,like,cmp,next) \ argument
918 for ((elt) = (head); (elt)->next != (head); (elt) = (elt)->next) { \
919 if ((cmp((elt)->next, like)) >= 0) { \
927 CDL_DELETE2(head,del,prev,next)
929 #define CDL_DELETE2(head,del,prev,next) \ argument
931 if (((head)==(del)) && ((head)->next == (head))) { \
934 (del)->next->prev = (del)->prev; \
935 (del)->prev->next = (del)->next; \
936 if ((del) == (head)) (head)=(del)->next; \
941 CDL_COUNT2(head,el,counter,next) \
943 #define CDL_COUNT2(head, el, counter,next) \ argument
946 CDL_FOREACH2(head,el,next) { ++(counter); } \
950 CDL_FOREACH2(head,el,next)
952 #define CDL_FOREACH2(head,el,next) \ argument
953 for ((el)=(head);el;(el)=(((el)->next==(head)) ? NULL : (el)->next))
956 CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next)
958 #define CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next) \ argument
960 (el) && ((tmp2) = (el)->next, 1); \
964 CDL_SEARCH_SCALAR2(head,out,field,val,next)
966 #define CDL_SEARCH_SCALAR2(head,out,field,val,next) \ argument
968 CDL_FOREACH2(head,out,next) { \
974 CDL_SEARCH2(head,out,elt,cmp,next)
976 #define CDL_SEARCH2(head,out,elt,cmp,next) \ argument
978 CDL_FOREACH2(head,out,next) { \
983 #define CDL_REPLACE_ELEM2(head, el, add, prev, next) \ argument
988 if ((el)->next == (el)) { \
989 (add)->next = (add); \
993 (add)->next = (el)->next; \
995 (add)->next->prev = (add); \
996 (add)->prev->next = (add); \
1004 CDL_REPLACE_ELEM2(head, el, add, prev, next)
1006 #define CDL_PREPEND_ELEM2(head, el, add, prev, next) \ argument
1011 (add)->next = (el); \
1014 (add)->prev->next = (add); \
1019 CDL_APPEND2(head, add, prev, next); \
1024 CDL_PREPEND_ELEM2(head, el, add, prev, next)
1026 #define CDL_APPEND_ELEM2(head, el, add, prev, next) \ argument
1031 (add)->next = (el)->next; \
1033 (el)->next = (add); \
1034 (add)->next->prev = (add); \
1036 CDL_PREPEND2(head, add, prev, next); \
1041 CDL_APPEND_ELEM2(head, el, add, prev, next)
1047 #define CDL_INSERT_INORDER2(head,add,cmp,prev,next) \ argument
1051 (add)->next = (add); \
1055 (add)->next = (head); \
1056 (add)->prev->next = (add); \
1061 while ((char*)(head)->next != _tmp && (cmp((head)->next, add)) < 0) { \
1062 (head) = (head)->next; \
1065 (add)->next = (head)->next; \
1066 (add)->next->prev = (add); \
1067 (head)->next = (add); \