8 #include "sorted_list.h"
12 void sorted_list_insert(sorted_list_type* list, void* item) {
13 sorted_list_node *node, *p;
17 while(p->next != NULL && list->compare(item, p->next->data) > 0) {
21 node = xmalloc(sizeof *node);
29 sorted_list_node* sorted_list_next_item(sorted_list_type* list, sorted_list_node* prev) {
31 return list->root.next;
38 void sorted_list_destroy(sorted_list_type* list) {
39 sorted_list_node *p, *n;
48 list->root.next = NULL;
51 void sorted_list_initialise(sorted_list_type* list) {
52 list->root.next = NULL;