openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/sysfsutils/2.1.0-r5/sysfsutils-2.1.0/lib/dlist.c
void* dlist_insert_sorted(struct dlist* list, void* new,
                          int (*sorter)(void*, void*))
{
    for (dlist_start(list), dlist_next(list);
         list->marker != list->head && !sorter(new, list->marker->data);
         dlist_next(list))
        ;
    return (dlist_insert_before(list, new));
}
/**
 * insert new into list in sorted order
 * sorter function in form int sorter(new,ith)
 *       must return 1 for when new should go before ith
 *       else 0
 * return pointer to inserted node
 * NOTE: assumes list is already sorted
 */
insert new into list in sorted order
sorter function in form int sorter(new,ith)
must return 1 for when new should go before ith
else 0
return pointer to inserted node
NOTE: assumes list is already sorted
insert new into list in sorted order sorter function in form int sorter ( new ith ) must return 1 for when new should go before ith else 0 return pointer to inserted node NOTE : assumes list is already sorted
void* dlist_insert_sorted(struct dlist* list, void* new,
                          int (*sorter)(void*, void*))
{
    for (dlist_start(list), dlist_next(list);
         list->marker != list->head && !sorter(new, list->marker->data);
         dlist_next(list))
        ;
    return (dlist_insert_before(list, new));
}
void * dlist_insert_sorted ( struct dlist * list , void * new , int ( * sorter ) ( void * , void * ) ) { for ( dlist_start ( list ) , dlist_next ( list ) ; list -> marker != list -> head && ! sorter ( new , list -> marker -> data ) ; dlist_next ( list ) ) ; return ( dlist_insert_before ( list , new ) ) ; }
insert new into list in sorted order
 sorter function in form int sorter(new,ith)
       must return 1 for when new should go before ith
       else 0
 return pointer to inserted node
 NOTE: assumes list is already sorted
insert new into list in sorted order sorter function in form int sorter ( new ith ) must return 1 for when new should go before ith else 0 return pointer to inserted node NOTE : assumes list is already sorted