Lines Matching refs:next

330 #define SGLIB_LIST_ADD(type, list, elem, next) {\
331 (elem)->next = (list);\
335 #define SGLIB_LIST_CONCAT(type, first, second, next) {\
340 for(_p_ = (first); _p_->next!=NULL; _p_=_p_->next) ;\
341 _p_->next = (second);\
345 #define SGLIB_LIST_DELETE(type, list, elem, next) {\
347 for(_p_ = &(list); *_p_!=NULL && *_p_!=(elem); _p_= &(*_p_)->next) ;\
349 *_p_ = (*_p_)->next;\
352 #define SGLIB_LIST_ADD_IF_NOT_MEMBER(type, list, elem, comparator, next, member) {\
354 for(_p_ = (list); _p_!=NULL && comparator(_p_, (elem)) != 0; _p_= _p_->next) ;\
357 SGLIB_LIST_ADD(type, list, elem, next);\
361 #define SGLIB_LIST_DELETE_IF_MEMBER(type, list, elem, comparator, next, member) {\
363 for(_p_ = &(list); *_p_!=NULL && comparator((*_p_), (elem)) != 0; _p_= &(*_p_)->next) ;\
366 *_p_ = (*_p_)->next;\
370 #define SGLIB_LIST_IS_MEMBER(type, list, elem, next, result) {\
372 for(_p_ = (list); _p_!=NULL && _p_ != (elem); _p_= _p_->next) ;\
376 #define SGLIB_LIST_FIND_MEMBER(type, list, elem, comparator, next, member) {\
378 for(_p_ = (list); _p_!=NULL && comparator(_p_, (elem)) != 0; _p_= _p_->next) ;\
382 #define SGLIB_LIST_MAP_ON_ELEMENTS(type, list, iteratedVariable, next, command) {\
387 _ne_ = (iteratedVariable)->next;\
393 #define SGLIB_LIST_LEN(type, list, next, result) {\
397 SGLIB_LIST_MAP_ON_ELEMENTS(type, list, _ce_, next, (result)++);\
400 #define SGLIB_LIST_REVERSE(type, list, next) {\
405 _tmp_ = _list_->next; _list_->next = _res_;\
411 #define SGLIB_LIST_SORT(type, list, comparator, next) {\
422 for(_i_ = 1, _t_ = _a_; _i_ < _n_ && _t_!=NULL; _i_++, _t_ = _t_->next) ;\
427 _b_ = _t_->next; _t_->next=NULL;\
428 for(_i_ =1, _t_ = _b_; _i_<_n_ && _t_!=NULL; _i_++, _t_ = _t_->next) ;\
432 _todo_ = _t_->next; _t_->next=NULL;\
437 *_restail_ = _a_; _restail_ = &(_a_->next); _a_ = _a_->next;\
439 *_restail_ = _b_; _restail_ = &(_b_->next); _b_ = _b_->next;\
444 while (*_restail_!=NULL) _restail_ = &((*_restail_)->next);\
458 #define SGLIB_SORTED_LIST_ADD(type, list, elem, comparator, next) {\
461 SGLIB_SORTED_LIST_FIND_MEMBER_OR_PLACE(type, list, elem, comparator, next, _cmpres_, _e_);\
462 (elem)->next = *_e_;\
466 #define SGLIB_SORTED_LIST_ADD_IF_NOT_MEMBER(type, list, elem, comparator, next, member) {\
469 SGLIB_SORTED_LIST_FIND_MEMBER_OR_PLACE(type, list, elem, comparator, next, _cmp_res_, _e_);\
471 (elem)->next = *_e_;\
479 #define SGLIB_SORTED_LIST_DELETE(type, list, elem, next) {\
480 SGLIB_LIST_DELETE(type, list, elem, next);\
483 #define SGLIB_SORTED_LIST_DELETE_IF_MEMBER(type, list, elem, comparator, next, member) {\
486 SGLIB_SORTED_LIST_FIND_MEMBER_OR_PLACE(type, list, elem, comparator, next, _cmp_res_, _e_);\
489 *_e_ = (*_e_)->next;\
495 #define SGLIB_SORTED_LIST_FIND_MEMBER(type, list, elem, comparator, next, member) {\
498 for(_p_ = (list); _p_!=NULL && (_cmpres_=comparator(_p_, (elem))) < 0; _p_=_p_->next) ;\
503 #define SGLIB_SORTED_LIST_IS_MEMBER(type, list, elem, comparator, next, result) {\
505 for(_p_ = (list); _p_!=NULL && comparator(_p_, (elem)) < 0; _p_=_p_->next) ;\
506 while (_p_ != NULL && _p_ != (elem) && comparator(_p_, (elem)) == 0) _p_=_p_->next;\
510 #define SGLIB_SORTED_LIST_FIND_MEMBER_OR_PLACE(type, list, elem, comparator, next, comparator_result, member_ptr) {\
514 (member_ptr) = &(*(member_ptr))->next) ;\
517 #define SGLIB_SORTED_LIST_LEN(type, list, next, result) {\
518 SGLIB_LIST_LEN(type, list, next, result);\
521 #define SGLIB_SORTED_LIST_MAP_ON_ELEMENTS(type, list, iteratedVariable, next, command) {\
522 SGLIB_LIST_MAP_ON_ELEMENTS(type, list, iteratedVariable, next, command);\
532 #define SGLIB___DL_LIST_CREATE_SINGLETON(type, list, elem, previous, next) {\
534 (list)->next = (list)->previous = NULL;\
537 #define SGLIB_DL_LIST_ADD_AFTER(type, place, elem, previous, next) {\
539 SGLIB___DL_LIST_CREATE_SINGLETON(type, place, elem, previous, next);\
541 (elem)->next = (place)->next;\
543 (place)->next = (elem);\
544 if ((elem)->next != NULL) (elem)->next->previous = (elem);\
548 #define SGLIB_DL_LIST_ADD_BEFORE(type, place, elem, previous, next) {\
550 SGLIB___DL_LIST_CREATE_SINGLETON(type, place, elem, previous, next);\
552 (elem)->next = (place);\
555 if ((elem)->previous != NULL) (elem)->previous->next = (elem);\
559 #define SGLIB_DL_LIST_ADD(type, list, elem, previous, next) {\
560 SGLIB_DL_LIST_ADD_BEFORE(type, list, elem, previous, next)\
564 #define SGLIB___DL_LIST_GENERIC_ADD_IF_NOT_MEMBER(type, list, elem, comparator, previous, next, member, the_add_operation) {\
568 for(_dlp_ = (list)->next; _dlp_!=NULL && comparator(_dlp_, (elem)) != 0; _dlp_= _dlp_->next) ;\
572 the_add_operation(type, list, elem, previous, next);\
576 #define SGLIB_DL_LIST_ADD_BEFORE_IF_NOT_MEMBER(type, list, elem, comparator, previous, next, member) {\
577 SGLIB___DL_LIST_GENERIC_ADD_IF_NOT_MEMBER(type, list, elem, comparator, previous, next, member, SGLIB_DL_LIST_ADD_BEFORE);\
580 #define SGLIB_DL_LIST_ADD_AFTER_IF_NOT_MEMBER(type, list, elem, comparator, previous, next, member) {\
581 SGLIB___DL_LIST_GENERIC_ADD_IF_NOT_MEMBER(type, list, elem, comparator, previous, next, member, SGLIB_DL_LIST_ADD_AFTER);\
584 #define SGLIB_DL_LIST_ADD_IF_NOT_MEMBER(type, list, elem, comparator, previous, next, member) {\
585 SGLIB___DL_LIST_GENERIC_ADD_IF_NOT_MEMBER(type, list, elem, comparator, previous, next, member, SGLIB_DL_LIST_ADD);\
588 #define SGLIB_DL_LIST_CONCAT(type, first, second, previous, next) {\
593 for(_dlp_ = (first); _dlp_->next!=NULL; _dlp_=_dlp_->next) { };\
594 SGLIB_DL_LIST_ADD_AFTER(type, _dlp_, second, previous, next);\
598 #define SGLIB_DL_LIST_DELETE(type, list, elem, previous, next) {\
603 else _l_ = (elem)->next;\
605 if ((elem)->next != NULL) (elem)->next->previous = (elem)->previous;\
606 if ((elem)->previous != NULL) (elem)->previous->next = (elem)->next;\
610 #define SGLIB_DL_LIST_DELETE_IF_MEMBER(type, list, elem, comparator, previous, next, member) {\
614 for(_dlp_ = (list)->next; _dlp_!=NULL && comparator(_dlp_, (elem)) != 0; _dlp_= _dlp_->next) ;\
618 SGLIB_DL_LIST_DELETE(type, list, _dlp_, previous, next);\
622 #define SGLIB_DL_LIST_IS_MEMBER(type, list, elem, previous, next, result) {\
626 _dlp_ = (list)->next;\
627 SGLIB_LIST_IS_MEMBER(type, _dlp_, elem, next, result);\
631 #define SGLIB_DL_LIST_FIND_MEMBER(type, list, elem, comparator, previous, next, member) {\
635 _dlp_ = (list)->next;\
636 SGLIB_LIST_FIND_MEMBER(type, _dlp_, elem, comparator, next, member);\
640 #define SGLIB_DL_LIST_MAP_ON_ELEMENTS(type, list, iteratedVariable, previous, next, command) {\
645 _dl_ = (list)->next;\
647 SGLIB_LIST_MAP_ON_ELEMENTS(type, _dl_, iteratedVariable, next, command);\
651 #define SGLIB_DL_LIST_SORT(type, list, comparator, previous, next) {\
656 SGLIB_LIST_SORT(type, _dll_, comparator, next);\
657 SGLIB___DL_LIST_CREATE_FROM_LIST(type, _dll_, previous, next);\
662 #define SGLIB_DL_LIST_GET_FIRST(type, list, previous, next, result) {\
671 #define SGLIB_DL_LIST_GET_LAST(type, list, previous, next, result) {\
675 for(; _dll_->next!=NULL; _dll_=_dll_->next) ;\
680 #define SGLIB_DL_LIST_LEN(type, list, previous, next, result) {\
687 _dl_ = (list)->next;\
688 SGLIB_LIST_LEN(type, _dl_, next, _r2_);\
693 #define SGLIB_DL_LIST_REVERSE(type, list, previous, next) {\
697 _nlist_ = _list_->next;\
699 _dln_ = _list_->next;\
701 _list_->next = _dlp_;\
706 _dln_ = _nlist_->next;\
708 _nlist_->next = _dlp_;\
715 #define SGLIB___DL_LIST_CREATE_FROM_LIST(type, list, previous, next) {\
718 for(_dlt_ = (list); _dlt_!=NULL; _dlt_ = _dlt_->next) {\
1119 #define SGLIB_DEFINE_LIST_PROTOTYPES(type, comparator, next) \
1142 #define SGLIB_DEFINE_LIST_FUNCTIONS(type, comparator, next) \
1145 SGLIB_LIST_IS_MEMBER(type, list, elem, next, result);\
1150 SGLIB_LIST_FIND_MEMBER(type, list, elem, comparator, next, result);\
1154 SGLIB_LIST_ADD_IF_NOT_MEMBER(type, *list, elem, comparator, next, *member);\
1158 SGLIB_LIST_ADD(type, *list, elem, next);\
1161 SGLIB_LIST_CONCAT(type, *first, second, next);\
1164 SGLIB_LIST_DELETE(type, *list, elem, next);\
1167 SGLIB_LIST_DELETE_IF_MEMBER(type, *list, elem, comparator, next, *member);\
1171 SGLIB_LIST_SORT(type, *list, comparator, next);\
1175 SGLIB_LIST_LEN(type, list, next, res);\
1179 SGLIB_LIST_REVERSE(type, *list, next);\
1202 while (ce!=NULL && scp(ce, eq)!=0) ce = ce->next;\
1205 if (ce != NULL) it->nextelem = ce->next;\
1212 #define SGLIB_DEFINE_SORTED_LIST_PROTOTYPES(type, comparator, next) \
1233 #define SGLIB_DEFINE_SORTED_LIST_FUNCTIONS(type, comparator, next) \
1236 SGLIB_SORTED_LIST_IS_MEMBER(type, list, elem, comparator, next, result);\
1241 SGLIB_SORTED_LIST_FIND_MEMBER(type, list, elem, comparator, next, result);\
1245 SGLIB_SORTED_LIST_ADD_IF_NOT_MEMBER(type, *list, elem, comparator, next, *member);\
1249 SGLIB_SORTED_LIST_ADD(type, *list, elem, comparator, next);\
1252 SGLIB_SORTED_LIST_DELETE(type, *list, elem, next);\
1255 SGLIB_SORTED_LIST_DELETE_IF_MEMBER(type, *list, elem, comparator, next, *member);\
1260 SGLIB_SORTED_LIST_LEN(type, list, next, res);\
1264 SGLIB_LIST_SORT(type, *list, comparator, next);\
1288 while (ce!=NULL && (c=scp(ce, eq)) < 0) ce = ce->next;\
1292 if (ce != NULL) it->nextelem = ce->next;\
1300 #define SGLIB_DEFINE_DL_LIST_PROTOTYPES(type, comparator, previous, next) \
1330 #define SGLIB_DEFINE_DL_LIST_FUNCTIONS(type, comparator, previous, next) \
1332 SGLIB_DL_LIST_ADD(type, *list, elem, previous, next);\
1335 SGLIB_DL_LIST_ADD_AFTER(type, *list, elem, previous, next);\
1338 SGLIB_DL_LIST_ADD_BEFORE(type, *list, elem, previous, next);\
1341 SGLIB_DL_LIST_ADD_IF_NOT_MEMBER(type, *list, elem, comparator, previous, next, *member);\
1345 SGLIB_DL_LIST_ADD_AFTER_IF_NOT_MEMBER(type, *list, elem, comparator, previous, next, *member);\
1349 SGLIB_DL_LIST_ADD_BEFORE_IF_NOT_MEMBER(type, *list, elem, comparator, previous, next, *member);\
1353 SGLIB_DL_LIST_CONCAT(type, *first, second, previous, next);\
1356 SGLIB_DL_LIST_DELETE(type, *list, elem, previous, next);\
1359 SGLIB_DL_LIST_DELETE_IF_MEMBER(type, *list, elem, comparator, previous, next, *member);\
1364 SGLIB_DL_LIST_IS_MEMBER(type, list, elem, previous, next, result);\
1369 SGLIB_DL_LIST_FIND_MEMBER(type, list, elem, comparator, previous, next, result);\
1374 SGLIB_DL_LIST_GET_FIRST(type, list, previous, next, result);\
1379 SGLIB_DL_LIST_GET_LAST(type, list, previous, next, result);\
1383 SGLIB_DL_LIST_SORT(type, *list, comparator, previous, next);\
1387 SGLIB_DL_LIST_LEN(type, list, previous, next, res);\
1391 SGLIB_DL_LIST_REVERSE(type, *list, previous, next);\
1399 if (list != NULL) it->nextelem = list->next;\
1426 while (ce!=NULL && scp(ce, eq)!=0) ce = ce->next;\
1428 if (ce != NULL) it->nextelem = ce->next;\