25 #ifndef __jack_jslist_h__
26 #define __jack_jslist_h__
42 jack_slist_alloc (
void)
47 new_list->
data = NULL;
48 new_list->
next = NULL;
55 jack_slist_prepend (
JSList *list,
61 new_list->
data = data;
62 new_list->
next = list;
67 #define jack_slist_next(slist) ((slist) ? (((JSList *)(slist))->next) : NULL)
70 jack_slist_last (
JSList *list)
83 jack_slist_remove_link (
JSList *list,
114 jack_slist_free (
JSList *list)
126 jack_slist_free_1 (
JSList *list)
136 jack_slist_remove (
JSList *list,
147 if (tmp->
data == data)
155 jack_slist_free (tmp);
169 jack_slist_length (
JSList *list)
185 jack_slist_find (
JSList *list,
190 if (list->
data == data)
200 jack_slist_copy (
JSList *list)
208 new_list = jack_slist_alloc ();
214 last->
next = jack_slist_alloc ();
226 jack_slist_append (
JSList *list,
232 new_list = jack_slist_alloc ();
233 new_list->
data = data;
237 last = jack_slist_last (list);
238 last->
next = new_list;
248 jack_slist_sort_merge (
JSList *l1,
258 if (compare_func(l1->
data,l2->
data) < 0)
269 l->
next= l1 ? l1 : l2;
276 jack_slist_sort (
JSList *list,
289 while ((l2 = l2->
next) != NULL)
291 if ((l2 = l2->
next) == NULL)
298 return jack_slist_sort_merge (jack_slist_sort (list, compare_func),
299 jack_slist_sort (l2, compare_func),
int(* JCompareFunc)(void *a, void *b)
Definition: jslist.h:32
void * data
Definition: jslist.h:36
JSList * next
Definition: jslist.h:37