X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fsort.h;h=4f8659e68d5de7100a431ee940c2e595a24506d7;hb=1f8a2f2be1bdfcbc0c85319da83c46d2e142e32b;hp=15a5b2db25d71f6f3a7d554e63426021ca52504d;hpb=5906e30c29662d12594199e1652ba3a7e5670944;p=pspp diff --git a/src/sort.h b/src/sort.h index 15a5b2db25..4f8659e68d 100644 --- a/src/sort.h +++ b/src/sort.h @@ -22,12 +22,35 @@ #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. */ + size_t case_size; /* Number of bytes in case. */ + }; + /* SORT CASES programmatic interface. */ -int sort_cases (int separate); -void read_sort_output (write_case_func *, write_case_data); -/* Variables to sort. */ -extern struct variable **v_sort; -extern int nv_sort; +typedef int read_sort_output_func (const struct ccase *, void *aux); + +struct sort_cases_pgm *parse_sort (void); +int sort_cases (struct sort_cases_pgm *, int separate); +void read_sort_output (struct sort_cases_pgm *, + read_sort_output_func, void *aux); +void destroy_sort_cases_pgm (struct sort_cases_pgm *); #endif /* !sort_h */