THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
git
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
574B

  1. #ifndef MERGESORT_H
  2. #define MERGESORT_H
  3. /*
  4. * Sort linked list in place.
  5. * - get_next_fn() returns the next element given an element of a linked list.
  6. * - set_next_fn() takes two elements A and B, and makes B the "next" element
  7. * of A on the list.
  8. * - compare_fn() takes two elements A and B, and returns negative, 0, positive
  9. * as the same sign as "subtracting" B from A.
  10. */
  11. void *llist_mergesort(void *list,
  12. void *(*get_next_fn)(const void *),
  13. void (*set_next_fn)(void *, void *),
  14. int (*compare_fn)(const void *, const void *));
  15. #endif