X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fsort.h;h=c8f97af0a98500ca291da93d610d709f32ce0338;hb=304c185799902df1dd96a8ff2d13d279005a82e5;hp=928a5170b1340caeeb105687020e2ad11db61136;hpb=f9d47b5bba8416419cf3bcd3aa23c2d40a05fcac;p=pspp diff --git a/src/sort.h b/src/sort.h index 928a5170b1..c8f97af0a9 100644 --- a/src/sort.h +++ b/src/sort.h @@ -20,33 +20,21 @@ #if !sort_h #define sort_h 1 -#include "vfm.h" - -/* Sort direction. */ -enum sort_direction - { - SRT_ASCEND, /* A, B, C, ..., X, Y, Z. */ - SRT_DESCEND /* Z, Y, X, ..., C, B, A. */ - }; - -/* SORT CASES input program. */ -struct sort_cases_pgm - { - int ref_cnt; /* Reference count. */ - - struct variable **vars; /* Variables to sort. */ - enum sort_direction *dirs; /* Sort directions. */ - int var_cnt; /* Number of variables to sort. */ - - struct internal_sort *isrt; /* Internal sort output. */ - struct external_sort *xsrt; /* External sort output. */ - }; - -/* SORT CASES programmatic interface. */ -struct sort_cases_pgm *parse_sort (void); -int sort_cases (struct sort_cases_pgm *, int separate); -void read_sort_output (struct sort_cases_pgm *, - write_case_func *, write_case_data); -void destroy_sort_cases_pgm (struct sort_cases_pgm *); +#include +#include "bool.h" + +struct casereader; +struct dictionary; +struct variable; + +struct sort_criteria *sort_parse_criteria (const struct dictionary *, + struct variable ***, int *, + bool *saw_direction); +void sort_destroy_criteria (struct sort_criteria *); + +struct casefile *sort_execute (struct casereader *, + const struct sort_criteria *); +int sort_active_file_in_place (const struct sort_criteria *); +struct casefile *sort_active_file_to_casefile (const struct sort_criteria *); #endif /* !sort_h */