205 tommy_list_insert_head_not_empty(list, node);
207 tommy_list_insert_first(list, node);
222 tommy_list_insert_tail_not_empty(head, node);
224 tommy_list_insert_first(list, node);
271 if (second_head == 0)
276 if (first_head == 0) {
282 first_tail = first_head->
prev;
285 first_head->
prev = second_head->
prev;
286 second_head->
prev = first_tail;
289 first_tail->
next = second_head;
360 void* data = node->
data;
374 void* data = node->
data;
void tommy_list_insert_head(tommy_list *list, tommy_node *node, void *data)
Inserts an element at the head of a list.
Definition: tommylist.h:200
tommy_uint32_t tommy_count_t
Generic unsigned integer for counting objects.
Definition: tommytypes.h:67
tommy_count_t tommy_list_count(tommy_list *list)
Gets the number of elements.
Definition: tommylist.h:314
tommy_node * tommy_list
Double linked list type.
Definition: tommylist.h:108
struct tommy_node_struct * next
Next node.
Definition: tommytypes.h:188
struct tommy_node_struct * prev
Previous node.
Definition: tommytypes.h:194
int tommy_compare_func(const void *obj_a, const void *obj_b)
Compare function for elements.
Definition: tommytypes.h:240
void tommy_list_concat(tommy_list *first, tommy_list *second)
Concats two lists.
Definition: tommylist.h:263
void tommy_list_sort(tommy_list *list, tommy_compare_func *cmp)
Sorts a list.
tommy_node * tommy_list_tail(tommy_list *list)
Gets the tail of the list.
Definition: tommylist.h:132
tommy_bool_t tommy_list_empty(tommy_list *list)
Checks if empty.
Definition: tommylist.h:305
Data structure node.
Definition: tommytypes.h:183
void tommy_foreach_func(void *obj)
Foreach function.
Definition: tommytypes.h:289
void tommy_list_init(tommy_list *list)
Initializes the list.
Definition: tommylist.h:114
void * tommy_list_remove_existing(tommy_list *list, tommy_node *node)
Removes an element from the list.
Definition: tommylist.h:237
void * data
Pointer to the object containing the node.
Definition: tommytypes.h:200
void tommy_list_foreach_arg(tommy_list *list, tommy_foreach_arg_func *func, void *arg)
Calls the specified function with an argument for each element in the list.
Definition: tommylist.h:369
int tommy_bool_t
Generic boolean type.
Definition: tommytypes.h:52
void tommy_list_foreach(tommy_list *list, tommy_foreach_func *func)
Calls the specified function for each element in the list.
Definition: tommylist.h:355
void tommy_foreach_arg_func(void *arg, void *obj)
Foreach function with an argument.
Definition: tommytypes.h:296
tommy_node * tommy_list_head(tommy_list *list)
Gets the head of the list.
Definition: tommylist.h:123
void tommy_list_insert_tail(tommy_list *list, tommy_node *node, void *data)
Inserts an element at the tail of a list.
Definition: tommylist.h:217