subcase_destroy (&sc);
return reader;
}
+
+/* Reads all the cases from INPUT. Sorts the cases according to ORDERING,
+ combining cases that have the same ORDERING values using COMBINE.
+ Returns the sorted cases in a new casereader. */
+struct casereader *
+sort_distinct_execute (struct casereader *input,
+ const struct subcase *ordering,
+ sort_distinct_combine_func *combine,
+ sort_distinct_destroy_func *destroy,
+ void *aux)
+{
+ struct casewriter *output =
+ sort_distinct_create_writer (ordering, casereader_get_proto (input),
+ combine, destroy, aux);
+ casereader_transfer (input, output);
+ return casewriter_make_reader (output);
+}
\f
struct pqueue
{
sort_distinct_combine_func *,
sort_distinct_destroy_func *,
void *aux);
+struct casereader *sort_distinct_execute (struct casereader *,
+ const struct subcase *,
+ sort_distinct_combine_func *,
+ sort_distinct_destroy_func *,
+ void *aux);
#endif /* math/sort.h */