X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fsort-cases.c;h=d73a79c4b38310faa29102d054cecd0714443390;hb=19d0debdc5b72e1bb6c79956403a4d3bc054f300;hp=ed442f74f1aa55134e27890c3d0db22518f97053;hpb=dcf9b154cbcaa35c3d8459a201b77eec8bcb30bd;p=pspp diff --git a/src/language/stats/sort-cases.c b/src/language/stats/sort-cases.c index ed442f74f1..d73a79c4b3 100644 --- a/src/language/stats/sort-cases.c +++ b/src/language/stats/sort-cases.c @@ -18,18 +18,21 @@ 02110-1301, USA. */ #include -#include + #include #include #include -#include "alloc.h" -#include "command.h" -#include "message.h" -#include "lexer.h" -#include "settings.h" + #include "sort-criteria.h" -#include "sort.h" -#include "variable.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "gettext.h" #define _(msgid) gettext (msgid) @@ -37,24 +40,24 @@ /* Performs the SORT CASES procedures. */ int -cmd_sort_cases (void) +cmd_sort_cases (struct lexer *lexer, struct dataset *ds) { struct sort_criteria *criteria; bool success = false; - lex_match (T_BY); + lex_match (lexer, T_BY); - criteria = sort_parse_criteria (default_dict, NULL, NULL, NULL, NULL); + criteria = sort_parse_criteria (lexer, dataset_dict (ds), NULL, NULL, NULL, NULL); if (criteria == NULL) return CMD_CASCADING_FAILURE; - if (get_testing_mode () && lex_match ('/')) + if (get_testing_mode () && lex_match (lexer, '/')) { - if (!lex_force_match_id ("BUFFERS") || !lex_match ('=') - || !lex_force_int ()) + if (!lex_force_match_id (lexer, "BUFFERS") || !lex_match (lexer, '=') + || !lex_force_int (lexer)) goto done; - min_buffers = max_buffers = lex_integer (); + min_buffers = max_buffers = lex_integer (lexer); allow_internal_sort = false; if (max_buffers < 2) { @@ -62,10 +65,10 @@ cmd_sort_cases (void) goto done; } - lex_get (); + lex_get (lexer); } - success = sort_active_file_in_place (criteria); + success = sort_active_file_in_place (ds, criteria); done: min_buffers = 64; @@ -73,6 +76,6 @@ cmd_sort_cases (void) allow_internal_sort = true; sort_destroy_criteria (criteria); - return success ? lex_end_of_command () : CMD_CASCADING_FAILURE; + return success ? lex_end_of_command (lexer) : CMD_CASCADING_FAILURE; }