X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fsort.h;h=928a5170b1340caeeb105687020e2ad11db61136;hb=f9d47b5bba8416419cf3bcd3aa23c2d40a05fcac;hp=15a5b2db25d71f6f3a7d554e63426021ca52504d;hpb=6ad392174e035d6e0823fd7894a0488acf274b97;p=pspp-builds.git diff --git a/src/sort.h b/src/sort.h index 15a5b2db..928a5170 100644 --- a/src/sort.h +++ b/src/sort.h @@ -22,12 +22,31 @@ #include "vfm.h" -/* SORT CASES programmatic interface. */ -int sort_cases (int separate); -void read_sort_output (write_case_func *, write_case_data); +/* 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. */ + }; -/* Variables to sort. */ -extern struct variable **v_sort; -extern int nv_sort; +/* 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 *); #endif /* !sort_h */