René Scharfe | 0db71e0 | 2012-04-01 00:10:11 +0200 | [diff] [blame] | 1 | #ifndef MERGESORT_H |
| 2 | #define MERGESORT_H |
| 3 | |
Junio C Hamano | 7365c95 | 2012-04-17 11:07:01 -0700 | [diff] [blame] | 4 | /* |
| 5 | * Sort linked list in place. |
| 6 | * - get_next_fn() returns the next element given an element of a linked list. |
| 7 | * - set_next_fn() takes two elements A and B, and makes B the "next" element |
| 8 | * of A on the list. |
| 9 | * - compare_fn() takes two elements A and B, and returns negative, 0, positive |
| 10 | * as the same sign as "subtracting" B from A. |
| 11 | */ |
| 12 | void *llist_mergesort(void *list, |
| 13 | void *(*get_next_fn)(const void *), |
| 14 | void (*set_next_fn)(void *, void *), |
| 15 | int (*compare_fn)(const void *, const void *)); |
René Scharfe | 0db71e0 | 2012-04-01 00:10:11 +0200 | [diff] [blame] | 16 | |
| 17 | #endif |