sort functions with user_data



I've been wanting user_data-bearing equivalents of the
following functions for a long time:

   qsort
   g_slist_sort
   g_list_sort
   g_tree_new

What would people think of a patch that added the following functions?
I'd be happy to cook up such a patch...

- Dave

-----------------------------------------------------

typedef gint     (*GComparatorFunc)   (gconstpointer      a,
                                       gconstpointer      a,
				       gpointer           user_data);

void             g_qsort_full         (gpointer           array,
                                       gsize              num_elements,
				       gsize              element_size,
				       GComparatorFunc    comparator,
				       gpointer           user_data);

GSList*          g_slist_sort_full    (GSList            *list,
		                       GComparatorFunc    compare_func,
				       gpointer           user_data);

GList*           g_list_sort_full     (GList            *list,
		                       GComparatorFunc    compare_func,
				       gpointer           user_data);

GTree*           g_tree_new_full      (GComparatorFunc    key_compare_func,
				       gpointer           user_data);






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]