Simple data structures / objects in plain C Snapshot
Functions
dring.c File Reference
#include <cutils/dring.h>

Go to the source code of this file.

Functions

void DRING_foreach (DRING *lst, DRING_VISITOR_V eval, void *data, int save_from_del)
 iterate over all elements of a list, callback is invoked for either element of the list. list is traversed forward from first element to the last element.
void DRING_foreach_reverse (DRING *lst, DRING_VISITOR_V eval, void *data, int save_from_delete)
 iterate over all elements of a list, callback is invoked for each element of the list. list is traversed backword from last element to the first element.
void DRING_insert_sorted (DRING *list, DRING_COMPARE compare, DRING *newentry)
 insert new element into sorted list; Maintains ordering relationship between elements of linked list (sort by ascending order) A sorting algorithm based on this function is not very efficient; it is of complexity O(n^2); nevertheless usefull if a list is modified and has to be always maintained in sorted order.