X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fsort-cases.c;h=13e0c6edb247024e14541f9e94ca62729cfe6299;hb=4517b68e7248f22e7b7ed81f0d73179351a53047;hp=f50b67fec156245c32ebf328c14d5eac35aae5cc;hpb=81fff61a96bece351e381ad3fef8ab1248a952ba;p=pspp-builds.git diff --git a/src/language/stats/sort-cases.c b/src/language/stats/sort-cases.c index f50b67fe..13e0c6ed 100644 --- a/src/language/stats/sort-cases.c +++ b/src/language/stats/sort-cases.c @@ -1,6 +1,5 @@ /* PSPP - computes sample statistics. Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. - Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -40,24 +39,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) { @@ -65,10 +64,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; @@ -76,6 +75,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; }