diff -Nurd -X freeciv/diff_ignore freeciv/common/speclist.h list_sort-1/common/speclist.h --- freeciv/common/speclist.h Sun Mar 19 05:05:00 2000 +++ list_sort-1/common/speclist.h Wed Aug 1 00:42:23 2001 @@ -37,6 +37,8 @@ void foo_list_insert_back(struct foo_list *This, foo_t *pfoo); void foo_list_unlink(struct foo_list *This, foo_t *pfoo); void foo_list_unlink_all(struct foo_list *This); + void foo_list_sort(struct foo_list *This, + int (*compar)(const void *, const void *)); You should also define yourself: (this file cannot do this for you) @@ -81,6 +83,7 @@ void SPECLIST_FOO(_list_insert_back) (SPECLIST_LIST *This, SPECLIST_TYPE *pfoo); void SPECLIST_FOO(_list_unlink) (SPECLIST_LIST *This, SPECLIST_TYPE *pfoo); void SPECLIST_FOO(_list_unlink_all) (SPECLIST_LIST *This); +void SPECLIST_FOO(_list_sort) (SPECLIST_LIST *This, int (*compar)(const void *, const void *)); #undef SPECLIST_TAG #undef SPECLIST_TYPE diff -Nurd -X freeciv/diff_ignore freeciv/common/speclist_c.h list_sort-1/common/speclist_c.h --- freeciv/common/speclist_c.h Wed May 3 14:51:09 2000 +++ list_sort-1/common/speclist_c.h Wed Aug 1 00:42:23 2001 @@ -74,6 +74,11 @@ genlist_unlink_all(&tthis->list); } +void SPECLIST_FOO(_list_sort) (SPECLIST_LIST * tthis, int (*compar) (const void *, const void *)) +{ + genlist_sort(&tthis->list, compar); +} + #undef SPECLIST_TAG #undef SPECLIST_TYPE #undef SPECLIST_PASTE_