2 * Copyright 2001, 2002, 2003 David Mansfield and Cobite, Inc.
3 * See COPYING file for license information
10 void list_sort(struct list_head
* list
, int (*node_compare
)(struct list_head
*, struct list_head
*))
12 struct list_head
*p
, *q
, *t
;
33 while (q
!= list
&& psize
< k
)
41 while (psize
|| (qsize
&& q
!= list
))
43 if (psize
&& (qsize
== 0 || q
== list
|| node_compare(p
, q
) <= 0))
51 printf("whoaa. qsize is zero\n");
63 list_add(t
, tmp
.prev
);
69 if (!list_empty(list
))
71 printf("whoaa. initial list not empty\n");
75 list_splice(&tmp
, list
);
78 //printf("done w sort pass %d %d\n", k, merges);