void * data
Holds the element's data, which can be a pointer to any kind of data.
c_list_t * c_list_find_custom(c_list_t *list, const void *data, c_list_compare_fn fn)
Finds an element, using a supplied function to find the desired element.
Used for each element in a doubly-linked list.
c_list_t * c_list_insert(c_list_t *list, void *data, long position)
Inserts a new element into the list at the given position.
void c_list_free(c_list_t *list)
Frees all elements from a c_list.
c_list_t * c_list_find(c_list_t *list, const void *data)
Finds the element in a c_list_t which contains the given data.
c_list_t * c_list_insert_sorted(c_list_t *list, void *data, c_list_compare_fn fn)
Inserts a new element into the list, using the given comparison function to determine its position...
c_list_t * c_list_alloc(void)
Allocates space for one c_list_t element.
struct c_list_s * prev
Link to the previous element in the list.
c_list_t * c_list_append(c_list_t *list, void *data)
Adds a new element on to the end of the list.
c_list_t * c_list_last(c_list_t *list)
Gets the last element in a c_list.
c_list_t * c_list_sort(c_list_t *list, c_list_compare_fn func)
Sorts the elements of a c_list.
int(* c_list_compare_fn)(const void *a, const void *b)
Specifies the type of a comparison function used to compare two values.
c_list_t * c_list_next(c_list_t *list)
Gets the next element in a c_list.
c_list_t * c_list_prev(c_list_t *list)
Gets the previous element in a c_list.
c_list_t * c_list_remove(c_list_t *list, void *data)
Removes an element from a c_list.
c_list_t * c_list_prepend(c_list_t *list, void *data)
Adds a new element on at the beginning of the list.
unsigned long c_list_length(c_list_t *list)
Gets the number of elements in a c_list.
c_list_t * c_list_position(c_list_t *list, long position)
Gets the element at the given positon in a c_list.
struct c_list_s * next
Link to the next element in the list.
c_list_t * c_list_first(c_list_t *list)
Gets the first element in a c_list.