1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 13:09:22 +00:00

An abstract mergesort function.

This commit is contained in:
Bruno Haible
2003-01-16 12:41:41 +00:00
parent c3467c5302
commit 826e4c8ba1
5 changed files with 123 additions and 95 deletions

View File

@@ -64,6 +64,16 @@ extern KeywordExt_List * copy_list (KeywordExt_List *list);
/* Deletes a linear list, keeping the list elements in memory. */
extern void delete_list (Keyword_List *list);
/* Sorts a linear list, given a comparison function.
Note: This uses a variant of mergesort that is *not* a stable sorting
algorithm. */
extern Keyword_List * mergesort_list (Keyword_List *list,
bool (*less) (Keyword *keyword1,
Keyword *keyword2));
extern KeywordExt_List * mergesort_list (KeywordExt_List *list,
bool (*less) (KeywordExt *keyword1,
KeywordExt *keyword2));
#ifdef __OPTIMIZE__
#define INLINE inline