From: John Darrington Date: Thu, 19 Oct 2006 15:04:52 +0000 (+0000) Subject: Encapsulated the static data of procedure.[ch] into a single object, to be X-Git-Tag: v0.6.0~727 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42489b63e0b4bec2e20c2f55c9791234f7b41764;p=pspp-builds.git Encapsulated the static data of procedure.[ch] into a single object, to be passed into its functions. Dealt with the consequences. --- diff --git a/po/de.po b/po/de.po index f17851f5..aecf07eb 100644 --- a/po/de.po +++ b/po/de.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: PSPP 0.4.2\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2006-10-06 17:58+0800\n" +"POT-Creation-Date: 2006-10-19 16:31+0800\n" "PO-Revision-Date: 2006-05-26 17:49+0800\n" "Last-Translator: John Darrington \n" "Language-Team: German \n" @@ -406,7 +406,7 @@ msgstr "Nummer" #: src/data/sys-file-reader.c:1368 src/data/sys-file-reader.c:1369 #: src/data/variable.c:42 src/language/dictionary/apply-dictionary.c:76 #: src/language/dictionary/apply-dictionary.c:77 -#: src/language/xforms/recode.c:478 src/language/xforms/recode.c:479 +#: src/language/xforms/recode.c:479 src/language/xforms/recode.c:480 msgid "numeric" msgstr "numerisch" @@ -415,7 +415,7 @@ msgstr "numerisch" #: src/data/variable.c:42 src/data/variable.c:50 #: src/language/dictionary/apply-dictionary.c:76 #: src/language/dictionary/apply-dictionary.c:77 -#: src/language/xforms/recode.c:478 src/language/xforms/recode.c:479 +#: src/language/xforms/recode.c:479 src/language/xforms/recode.c:480 msgid "string" msgstr "kette" @@ -983,94 +983,99 @@ msgstr "" msgid "scratch" msgstr "" -#: src/language/command.c:185 +#: src/language/command.c:183 +#, c-format +msgid "%s is unimplemented." +msgstr "" + +#: src/language/command.c:188 #, c-format msgid "%s may be used only in testing mode." msgstr "" -#: src/language/command.c:190 +#: src/language/command.c:193 #, c-format msgid "%s may be used only in enhanced syntax mode." msgstr "" -#: src/language/command.c:444 +#: src/language/command.c:447 msgid "expecting command name" msgstr "" -#: src/language/command.c:458 +#: src/language/command.c:461 #, c-format msgid "Unknown command %s." msgstr "" -#: src/language/command.c:584 +#: src/language/command.c:587 msgid "before the active file has been defined" msgstr "" -#: src/language/command.c:586 +#: src/language/command.c:589 msgid "after the active file has been defined" msgstr "" -#: src/language/command.c:588 +#: src/language/command.c:591 msgid "inside INPUT PROGRAM" msgstr "" -#: src/language/command.c:590 +#: src/language/command.c:593 msgid "inside FILE TYPE" msgstr "" -#: src/language/command.c:595 +#: src/language/command.c:598 #, c-format msgid "%s or %s" msgstr "" -#: src/language/command.c:597 +#: src/language/command.c:600 #, c-format msgid "%s, %s, or %s" msgstr "" -#: src/language/command.c:601 +#: src/language/command.c:604 #, c-format msgid "%s is allowed only %s." msgstr "" -#: src/language/command.c:606 +#: src/language/command.c:609 #, c-format msgid "%s is not allowed inside INPUT PROGRAM." msgstr "" -#: src/language/command.c:608 +#: src/language/command.c:611 #, c-format msgid "%s is not allowed inside FILE TYPE." msgstr "" -#: src/language/command.c:686 src/language/command.c:817 +#: src/language/command.c:689 src/language/command.c:820 #: src/language/utilities/permissions.c:102 msgid "This command not allowed when the SAFER option is set." msgstr "" -#: src/language/command.c:698 +#: src/language/command.c:701 #, c-format msgid "Error removing `%s': %s." msgstr "" -#: src/language/command.c:748 +#: src/language/command.c:751 #, c-format msgid "Couldn't fork: %s." msgstr "" -#: src/language/command.c:790 +#: src/language/command.c:793 #, c-format msgid "Error executing command: %s." msgstr "" -#: src/language/command.c:799 src/language/data-io/matrix-data.c:539 +#: src/language/command.c:802 src/language/data-io/matrix-data.c:539 #: src/language/data-io/print-space.c:76 src/language/dictionary/vector.c:201 #: src/language/lexer/lexer.c:453 src/language/stats/autorecode.c:154 #: src/language/xforms/select-if.c:62 msgid "expecting end of command" msgstr "" -#: src/language/command.c:838 +#: src/language/command.c:841 msgid "No operating system support for this command." msgstr "" @@ -1137,80 +1142,80 @@ msgstr "" msgid "Only one of FIXED, FREE, or LIST may be specified." msgstr "" -#: src/language/data-io/data-list.c:336 src/language/data-io/data-list.c:471 +#: src/language/data-io/data-list.c:337 src/language/data-io/data-list.c:472 #, c-format msgid "%s is a duplicate variable name." msgstr "" -#: src/language/data-io/data-list.c:343 +#: src/language/data-io/data-list.c:344 #, c-format msgid "There is already a variable %s of a different type." msgstr "" -#: src/language/data-io/data-list.c:350 +#: src/language/data-io/data-list.c:351 #, c-format msgid "There is already a string variable %s of a different width." msgstr "" -#: src/language/data-io/data-list.c:371 +#: src/language/data-io/data-list.c:372 msgid "At least one variable must be specified." msgstr "" -#: src/language/data-io/data-list.c:378 +#: src/language/data-io/data-list.c:379 msgid "" "Variables are specified on records that should not exist according to " "RECORDS subcommand." msgstr "" -#: src/language/data-io/data-list.c:403 src/language/data-io/data-list.c:503 +#: src/language/data-io/data-list.c:404 src/language/data-io/data-list.c:504 #: src/language/data-io/print.c:370 src/language/dictionary/split-file.c:84 #: src/language/dictionary/sys-file-info.c:144 #: src/language/dictionary/sys-file-info.c:378 -#: src/language/stats/descriptives.c:894 +#: src/language/stats/descriptives.c:897 msgid "Variable" msgstr "" -#: src/language/data-io/data-list.c:404 src/language/data-io/print.c:371 +#: src/language/data-io/data-list.c:405 src/language/data-io/print.c:371 msgid "Record" msgstr "" -#: src/language/data-io/data-list.c:405 src/language/data-io/print.c:372 +#: src/language/data-io/data-list.c:406 src/language/data-io/print.c:372 #: src/ui/gui/var-sheet.c:78 msgid "Columns" msgstr "Spalten" -#: src/language/data-io/data-list.c:406 src/language/data-io/data-list.c:504 +#: src/language/data-io/data-list.c:407 src/language/data-io/data-list.c:505 #: src/language/data-io/print.c:373 msgid "Format" msgstr "" -#: src/language/data-io/data-list.c:422 +#: src/language/data-io/data-list.c:423 #, c-format msgid "Reading %d record from %s." msgid_plural "Reading %d records from %s." msgstr[0] "" msgstr[1] "" -#: src/language/data-io/data-list.c:517 +#: src/language/data-io/data-list.c:518 #, c-format msgid "Reading free-form data from %s." msgstr "" -#: src/language/data-io/data-list.c:563 +#: src/language/data-io/data-list.c:564 msgid "Quoted string extends beyond end of line." msgstr "" -#: src/language/data-io/data-list.c:648 +#: src/language/data-io/data-list.c:649 #, c-format msgid "Partial case of %d of %d records discarded." msgstr "" -#: src/language/data-io/data-list.c:697 +#: src/language/data-io/data-list.c:698 #, c-format msgid "Partial case discarded. The first variable missing was %s." msgstr "" -#: src/language/data-io/data-list.c:733 +#: src/language/data-io/data-list.c:734 #, c-format msgid "" "Missing value(s) for all variables from %s onward. These will be filled " @@ -1311,17 +1316,17 @@ msgstr "" msgid "expecting COMM or TAPE" msgstr "" -#: src/language/data-io/get.c:358 src/language/data-io/get.c:372 -#: src/language/data-io/get.c:397 +#: src/language/data-io/get.c:359 src/language/data-io/get.c:373 +#: src/language/data-io/get.c:398 #, c-format msgid "expecting %s or %s" msgstr "" -#: src/language/data-io/get.c:606 src/language/data-io/print.c:174 +#: src/language/data-io/get.c:607 src/language/data-io/print.c:174 msgid "expecting a valid subcommand" msgstr "" -#: src/language/data-io/get.c:639 +#: src/language/data-io/get.c:640 #, c-format msgid "" "Cannot rename %s as %s because there already exists a variable named %s. To " @@ -1329,75 +1334,75 @@ msgid "" "as \"/RENAME (A=B)(B=C)(C=A)\", or equivalently, \"/RENAME (A B C=B C A)\"." msgstr "" -#: src/language/data-io/get.c:664 +#: src/language/data-io/get.c:665 msgid "`=' expected after variable list." msgstr "" -#: src/language/data-io/get.c:671 +#: src/language/data-io/get.c:672 #, c-format msgid "" "Number of variables on left side of `=' (%d) does not match number of " "variables on right side (%d), in parenthesized group %d of RENAME subcommand." msgstr "" -#: src/language/data-io/get.c:684 +#: src/language/data-io/get.c:685 #, c-format msgid "Requested renaming duplicates variable name %s." msgstr "" -#: src/language/data-io/get.c:714 +#: src/language/data-io/get.c:715 msgid "Cannot DROP all variables from dictionary." msgstr "" -#: src/language/data-io/get.c:891 +#: src/language/data-io/get.c:892 msgid "The active file may not be specified more than once." msgstr "" -#: src/language/data-io/get.c:899 +#: src/language/data-io/get.c:900 msgid "Cannot specify the active file since no active file has been defined." msgstr "" -#: src/language/data-io/get.c:906 +#: src/language/data-io/get.c:907 msgid "" "MATCH FILES may not be used after TEMPORARY when the active file is an input " "source. Temporary transformations will be made permanent." msgstr "" -#: src/language/data-io/get.c:942 +#: src/language/data-io/get.c:943 msgid "Multiple IN subcommands for a single FILE or TABLE." msgstr "" -#: src/language/data-io/get.c:962 +#: src/language/data-io/get.c:963 msgid "BY may appear at most once." msgstr "" -#: src/language/data-io/get.c:982 +#: src/language/data-io/get.c:983 #, c-format msgid "File %s lacks BY variable %s." msgstr "" -#: src/language/data-io/get.c:996 +#: src/language/data-io/get.c:997 msgid "FIRST may appear at most once." msgstr "" -#: src/language/data-io/get.c:1010 +#: src/language/data-io/get.c:1011 msgid "LAST may appear at most once." msgstr "" -#: src/language/data-io/get.c:1051 +#: src/language/data-io/get.c:1052 msgid "BY is required when TABLE is specified." msgstr "" -#: src/language/data-io/get.c:1056 +#: src/language/data-io/get.c:1057 msgid "BY is required when IN is specified." msgstr "" -#: src/language/data-io/get.c:1084 +#: src/language/data-io/get.c:1085 #, c-format msgid "IN variable name %s duplicates an existing variable name." msgstr "" -#: src/language/data-io/get.c:1538 +#: src/language/data-io/get.c:1541 #, c-format msgid "" "Variable %s in file %s (%s) has different type or width from the same " @@ -1412,16 +1417,16 @@ msgstr "" msgid "Input program did not create any variables." msgstr "" -#: src/language/data-io/inpt-pgm.c:337 +#: src/language/data-io/inpt-pgm.c:338 msgid "COLUMN subcommand multiply specified." msgstr "" -#: src/language/data-io/inpt-pgm.c:384 +#: src/language/data-io/inpt-pgm.c:385 msgid "" "REREAD: Column numbers must be positive finite numbers. Column set to 1." msgstr "" -#: src/language/data-io/list.q:152 src/language/stats/descriptives.c:361 +#: src/language/data-io/list.q:152 src/language/stats/descriptives.c:362 msgid "No variables specified." msgstr "" @@ -1561,79 +1566,79 @@ msgstr "" msgid "No continuous variables specified." msgstr "" -#: src/language/data-io/matrix-data.c:840 +#: src/language/data-io/matrix-data.c:841 msgid "Scope of string exceeds line." msgstr "" -#: src/language/data-io/matrix-data.c:901 +#: src/language/data-io/matrix-data.c:902 #, c-format msgid "End of line expected %s while reading %s." msgstr "" -#: src/language/data-io/matrix-data.c:1090 +#: src/language/data-io/matrix-data.c:1091 #, c-format msgid "expecting value for %s %s" msgstr "" -#: src/language/data-io/matrix-data.c:1255 +#: src/language/data-io/matrix-data.c:1256 #, c-format msgid "Syntax error expecting SPLIT FILE value %s." msgstr "" -#: src/language/data-io/matrix-data.c:1264 +#: src/language/data-io/matrix-data.c:1265 #, c-format msgid "Expecting value %g for %s." msgstr "" -#: src/language/data-io/matrix-data.c:1305 -#: src/language/data-io/matrix-data.c:1782 +#: src/language/data-io/matrix-data.c:1306 +#: src/language/data-io/matrix-data.c:1784 #, c-format msgid "Syntax error expecting factor value %s." msgstr "" -#: src/language/data-io/matrix-data.c:1314 +#: src/language/data-io/matrix-data.c:1315 #, c-format msgid "Syntax error expecting value %g for %s %s." msgstr "" -#: src/language/data-io/matrix-data.c:1558 +#: src/language/data-io/matrix-data.c:1560 #, c-format msgid "Syntax error %s expecting SPLIT FILE value." msgstr "" -#: src/language/data-io/matrix-data.c:1687 +#: src/language/data-io/matrix-data.c:1689 #, c-format msgid "" "Expected %d lines of data for %s content; actually saw %d lines. No data " "will be output for this content." msgstr "" -#: src/language/data-io/matrix-data.c:1724 +#: src/language/data-io/matrix-data.c:1726 #, c-format msgid "Multiply specified ROWTYPE_ %s." msgstr "" -#: src/language/data-io/matrix-data.c:1729 +#: src/language/data-io/matrix-data.c:1731 #, c-format msgid "Syntax error %s expecting ROWTYPE_ string." msgstr "" -#: src/language/data-io/matrix-data.c:1749 +#: src/language/data-io/matrix-data.c:1751 #, c-format msgid "Syntax error %s." msgstr "" -#: src/language/data-io/matrix-data.c:1900 +#: src/language/data-io/matrix-data.c:1902 #, c-format msgid "Duplicate specification for %s." msgstr "" -#: src/language/data-io/matrix-data.c:1912 +#: src/language/data-io/matrix-data.c:1914 #, c-format msgid "Too many rows of matrix data for %s." msgstr "" -#: src/language/data-io/matrix-data.c:1956 +#: src/language/data-io/matrix-data.c:1958 #, c-format msgid "Syntax error expecting value for %s %s." msgstr "" @@ -1697,11 +1702,11 @@ msgid_plural "Writing %d records." msgstr[0] "" msgstr[1] "" -#: src/language/data-io/print-space.c:116 +#: src/language/data-io/print-space.c:117 msgid "The expression on PRINT SPACE evaluated to the system-missing value." msgstr "" -#: src/language/data-io/print-space.c:119 +#: src/language/data-io/print-space.c:120 #, c-format msgid "The expression on PRINT SPACE evaluated to %g." msgstr "" @@ -1736,7 +1741,7 @@ msgid "`)' expected after output format." msgstr "" #: src/language/dictionary/missing-values.c:57 -#: src/language/stats/aggregate.c:447 +#: src/language/stats/aggregate.c:450 msgid "expecting `('" msgstr "" @@ -1877,8 +1882,8 @@ msgstr "" #: src/language/dictionary/split-file.c:85 #: src/language/dictionary/sys-file-info.c:523 -#: src/language/stats/crosstabs.q:1115 src/language/stats/crosstabs.q:1142 -#: src/language/stats/crosstabs.q:1162 src/language/stats/crosstabs.q:1184 +#: src/language/stats/crosstabs.q:1116 src/language/stats/crosstabs.q:1143 +#: src/language/stats/crosstabs.q:1163 src/language/stats/crosstabs.q:1185 #: src/language/stats/examine.q:1149 src/language/stats/frequencies.q:1177 #: src/language/stats/frequencies.q:1301 msgid "Value" @@ -2173,7 +2178,7 @@ msgstr "" msgid "Unknown identifier %s." msgstr "" -#: src/language/expressions/parse.c:854 src/language/stats/aggregate.c:503 +#: src/language/expressions/parse.c:854 src/language/stats/aggregate.c:506 msgid "expecting `)'" msgstr "" @@ -2247,7 +2252,7 @@ msgstr "" msgid "%s is not yet implemented." msgstr "" -#: src/language/expressions/parse.c:1235 +#: src/language/expressions/parse.c:1236 #, c-format msgid "%s may not appear after TEMPORARY." msgstr "" @@ -2308,50 +2313,50 @@ msgstr "" msgid "expecting identifier" msgstr "" -#: src/language/lexer/lexer.c:861 +#: src/language/lexer/lexer.c:862 msgid "" msgstr "" -#: src/language/lexer/lexer.c:1007 +#: src/language/lexer/lexer.c:1008 msgid "binary" msgstr "" -#: src/language/lexer/lexer.c:1012 +#: src/language/lexer/lexer.c:1013 msgid "octal" msgstr "" -#: src/language/lexer/lexer.c:1017 +#: src/language/lexer/lexer.c:1018 msgid "hex" msgstr "" -#: src/language/lexer/lexer.c:1027 +#: src/language/lexer/lexer.c:1028 #, c-format msgid "String of %s digits has %d characters, which is not a multiple of %d." msgstr "" -#: src/language/lexer/lexer.c:1056 +#: src/language/lexer/lexer.c:1057 #, c-format msgid "`%c' is not a valid %s digit." msgstr "" -#: src/language/lexer/lexer.c:1087 +#: src/language/lexer/lexer.c:1088 msgid "Unterminated string constant." msgstr "" -#: src/language/lexer/lexer.c:1141 +#: src/language/lexer/lexer.c:1142 msgid "Unexpected end of file in string concatenation." msgstr "" -#: src/language/lexer/lexer.c:1149 +#: src/language/lexer/lexer.c:1150 msgid "String expected following `+'." msgstr "" -#: src/language/lexer/lexer.c:1162 +#: src/language/lexer/lexer.c:1163 #, c-format msgid "String exceeds 255 characters in length (%d characters)." msgstr "" -#: src/language/lexer/lexer.c:1177 +#: src/language/lexer/lexer.c:1178 msgid "" "Sorry, literal strings may not contain null characters. Replacing with " "spaces." @@ -2487,40 +2492,40 @@ msgid "" "has no effect. Output data will be sorted the same way as the input data." msgstr "" -#: src/language/stats/aggregate.c:416 +#: src/language/stats/aggregate.c:419 msgid "expecting aggregation function" msgstr "" -#: src/language/stats/aggregate.c:432 +#: src/language/stats/aggregate.c:435 #, c-format msgid "Unknown aggregation function %s." msgstr "" -#: src/language/stats/aggregate.c:484 +#: src/language/stats/aggregate.c:487 #, c-format msgid "Missing argument %d to %s." msgstr "" -#: src/language/stats/aggregate.c:493 +#: src/language/stats/aggregate.c:496 #, c-format msgid "Arguments to %s must be of same type as source variables." msgstr "" -#: src/language/stats/aggregate.c:515 +#: src/language/stats/aggregate.c:518 #, c-format msgid "" "Number of source variables (%u) does not match number of target variables (%" "u)." msgstr "" -#: src/language/stats/aggregate.c:531 +#: src/language/stats/aggregate.c:534 #, c-format msgid "" "The value arguments passed to the %s function are out-of-order. They will " "be treated as if they had been specified in the correct order." msgstr "" -#: src/language/stats/aggregate.c:598 +#: src/language/stats/aggregate.c:601 #, c-format msgid "" "Variable name %s is not unique within the aggregate file dictionary, which " @@ -2568,380 +2573,380 @@ msgstr "" msgid "Maximum value (%ld) less than minimum value (%ld)." msgstr "" -#: src/language/stats/crosstabs.q:816 +#: src/language/stats/crosstabs.q:817 msgid "Summary." msgstr "" -#: src/language/stats/crosstabs.q:818 src/language/stats/examine.q:934 +#: src/language/stats/crosstabs.q:819 src/language/stats/examine.q:934 msgid "Cases" msgstr "" -#: src/language/stats/crosstabs.q:819 src/language/stats/examine.q:868 +#: src/language/stats/crosstabs.q:820 src/language/stats/examine.q:868 #: src/language/stats/frequencies.q:1175 src/language/stats/frequencies.q:1551 msgid "Valid" msgstr "" -#: src/language/stats/crosstabs.q:820 src/language/stats/examine.q:869 +#: src/language/stats/crosstabs.q:821 src/language/stats/examine.q:869 #: src/language/stats/frequencies.q:1244 src/language/stats/frequencies.q:1552 #: src/ui/gui/var-sheet.c:77 msgid "Missing" msgstr "Löse" -#: src/language/stats/crosstabs.q:821 src/language/stats/crosstabs.q:1024 -#: src/language/stats/crosstabs.q:1744 src/language/stats/examine.q:870 +#: src/language/stats/crosstabs.q:822 src/language/stats/crosstabs.q:1025 +#: src/language/stats/crosstabs.q:1745 src/language/stats/examine.q:870 #: src/language/stats/frequencies.q:1253 src/language/stats/oneway.q:317 #: src/language/stats/oneway.q:481 src/language/stats/regression.q:314 msgid "Total" msgstr "" -#: src/language/stats/crosstabs.q:831 src/language/stats/examine.q:946 +#: src/language/stats/crosstabs.q:832 src/language/stats/examine.q:946 #: src/language/stats/frequencies.q:1550 src/language/stats/oneway.q:403 #: src/language/stats/t-test.q:688 src/language/stats/t-test.q:711 #: src/language/stats/t-test.q:836 src/language/stats/t-test.q:1371 msgid "N" msgstr "" -#: src/language/stats/crosstabs.q:832 src/language/stats/examine.q:949 +#: src/language/stats/crosstabs.q:833 src/language/stats/examine.q:949 #: src/language/stats/frequencies.q:1179 src/language/stats/frequencies.q:1180 #: src/language/stats/frequencies.q:1181 msgid "Percent" msgstr "Prozent" -#: src/language/stats/crosstabs.q:1074 +#: src/language/stats/crosstabs.q:1075 msgid "count" msgstr "" -#: src/language/stats/crosstabs.q:1075 +#: src/language/stats/crosstabs.q:1076 msgid "row %" msgstr "" -#: src/language/stats/crosstabs.q:1076 +#: src/language/stats/crosstabs.q:1077 msgid "column %" msgstr "" -#: src/language/stats/crosstabs.q:1077 +#: src/language/stats/crosstabs.q:1078 msgid "total %" msgstr "" -#: src/language/stats/crosstabs.q:1078 +#: src/language/stats/crosstabs.q:1079 msgid "expected" msgstr "" -#: src/language/stats/crosstabs.q:1079 +#: src/language/stats/crosstabs.q:1080 msgid "residual" msgstr "" -#: src/language/stats/crosstabs.q:1080 +#: src/language/stats/crosstabs.q:1081 msgid "std. resid." msgstr "" -#: src/language/stats/crosstabs.q:1081 +#: src/language/stats/crosstabs.q:1082 msgid "adj. resid." msgstr "" -#: src/language/stats/crosstabs.q:1111 +#: src/language/stats/crosstabs.q:1112 msgid "Chi-square tests." msgstr "" -#: src/language/stats/crosstabs.q:1114 src/language/stats/crosstabs.q:1141 -#: src/language/stats/crosstabs.q:1161 src/language/stats/crosstabs.q:1182 +#: src/language/stats/crosstabs.q:1115 src/language/stats/crosstabs.q:1142 +#: src/language/stats/crosstabs.q:1162 src/language/stats/crosstabs.q:1183 #: src/language/stats/examine.q:1380 msgid "Statistic" msgstr "" -#: src/language/stats/crosstabs.q:1116 src/language/stats/oneway.q:290 +#: src/language/stats/crosstabs.q:1117 src/language/stats/oneway.q:290 #: src/language/stats/oneway.q:693 src/language/stats/regression.q:307 #: src/language/stats/t-test.q:986 src/language/stats/t-test.q:1178 #: src/language/stats/t-test.q:1270 msgid "df" msgstr "" -#: src/language/stats/crosstabs.q:1118 +#: src/language/stats/crosstabs.q:1119 msgid "Asymp. Sig. (2-sided)" msgstr "" -#: src/language/stats/crosstabs.q:1120 +#: src/language/stats/crosstabs.q:1121 msgid "Exact. Sig. (2-sided)" msgstr "" -#: src/language/stats/crosstabs.q:1122 +#: src/language/stats/crosstabs.q:1123 msgid "Exact. Sig. (1-sided)" msgstr "" -#: src/language/stats/crosstabs.q:1137 +#: src/language/stats/crosstabs.q:1138 msgid "Symmetric measures." msgstr "" -#: src/language/stats/crosstabs.q:1140 src/language/stats/crosstabs.q:1181 +#: src/language/stats/crosstabs.q:1141 src/language/stats/crosstabs.q:1182 msgid "Category" msgstr "" -#: src/language/stats/crosstabs.q:1143 src/language/stats/crosstabs.q:1185 +#: src/language/stats/crosstabs.q:1144 src/language/stats/crosstabs.q:1186 msgid "Asymp. Std. Error" msgstr "" -#: src/language/stats/crosstabs.q:1144 src/language/stats/crosstabs.q:1186 +#: src/language/stats/crosstabs.q:1145 src/language/stats/crosstabs.q:1187 msgid "Approx. T" msgstr "" -#: src/language/stats/crosstabs.q:1145 src/language/stats/crosstabs.q:1187 +#: src/language/stats/crosstabs.q:1146 src/language/stats/crosstabs.q:1188 msgid "Approx. Sig." msgstr "" -#: src/language/stats/crosstabs.q:1156 +#: src/language/stats/crosstabs.q:1157 msgid "Risk estimate." msgstr "" -#: src/language/stats/crosstabs.q:1160 +#: src/language/stats/crosstabs.q:1161 #, c-format msgid "95%% Confidence Interval" msgstr "" -#: src/language/stats/crosstabs.q:1163 src/language/stats/t-test.q:990 +#: src/language/stats/crosstabs.q:1164 src/language/stats/t-test.q:990 #: src/language/stats/t-test.q:1175 src/language/stats/t-test.q:1273 msgid "Lower" msgstr "" -#: src/language/stats/crosstabs.q:1164 src/language/stats/t-test.q:991 +#: src/language/stats/crosstabs.q:1165 src/language/stats/t-test.q:991 #: src/language/stats/t-test.q:1176 src/language/stats/t-test.q:1274 msgid "Upper" msgstr "" -#: src/language/stats/crosstabs.q:1178 +#: src/language/stats/crosstabs.q:1179 msgid "Directional measures." msgstr "" -#: src/language/stats/crosstabs.q:1183 src/ui/gui/var-sheet.c:72 +#: src/language/stats/crosstabs.q:1184 src/ui/gui/var-sheet.c:72 msgid "Type" msgstr "Typ" -#: src/language/stats/crosstabs.q:1936 +#: src/language/stats/crosstabs.q:1937 msgid "Pearson Chi-Square" msgstr "" -#: src/language/stats/crosstabs.q:1937 +#: src/language/stats/crosstabs.q:1938 msgid "Likelihood Ratio" msgstr "" -#: src/language/stats/crosstabs.q:1938 +#: src/language/stats/crosstabs.q:1939 msgid "Fisher's Exact Test" msgstr "" -#: src/language/stats/crosstabs.q:1939 +#: src/language/stats/crosstabs.q:1940 msgid "Continuity Correction" msgstr "" -#: src/language/stats/crosstabs.q:1940 +#: src/language/stats/crosstabs.q:1941 msgid "Linear-by-Linear Association" msgstr "" -#: src/language/stats/crosstabs.q:1977 src/language/stats/crosstabs.q:2047 -#: src/language/stats/crosstabs.q:2106 +#: src/language/stats/crosstabs.q:1978 src/language/stats/crosstabs.q:2048 +#: src/language/stats/crosstabs.q:2107 msgid "N of Valid Cases" msgstr "" -#: src/language/stats/crosstabs.q:1993 src/language/stats/crosstabs.q:2122 +#: src/language/stats/crosstabs.q:1994 src/language/stats/crosstabs.q:2123 msgid "Nominal by Nominal" msgstr "" -#: src/language/stats/crosstabs.q:1994 src/language/stats/crosstabs.q:2123 +#: src/language/stats/crosstabs.q:1995 src/language/stats/crosstabs.q:2124 msgid "Ordinal by Ordinal" msgstr "" -#: src/language/stats/crosstabs.q:1995 +#: src/language/stats/crosstabs.q:1996 msgid "Interval by Interval" msgstr "" -#: src/language/stats/crosstabs.q:1996 +#: src/language/stats/crosstabs.q:1997 msgid "Measure of Agreement" msgstr "" -#: src/language/stats/crosstabs.q:2001 +#: src/language/stats/crosstabs.q:2002 msgid "Phi" msgstr "" -#: src/language/stats/crosstabs.q:2002 +#: src/language/stats/crosstabs.q:2003 msgid "Cramer's V" msgstr "" -#: src/language/stats/crosstabs.q:2003 +#: src/language/stats/crosstabs.q:2004 msgid "Contingency Coefficient" msgstr "" -#: src/language/stats/crosstabs.q:2004 +#: src/language/stats/crosstabs.q:2005 msgid "Kendall's tau-b" msgstr "" -#: src/language/stats/crosstabs.q:2005 +#: src/language/stats/crosstabs.q:2006 msgid "Kendall's tau-c" msgstr "" -#: src/language/stats/crosstabs.q:2006 +#: src/language/stats/crosstabs.q:2007 msgid "Gamma" msgstr "" -#: src/language/stats/crosstabs.q:2007 +#: src/language/stats/crosstabs.q:2008 msgid "Spearman Correlation" msgstr "" -#: src/language/stats/crosstabs.q:2008 +#: src/language/stats/crosstabs.q:2009 msgid "Pearson's R" msgstr "" -#: src/language/stats/crosstabs.q:2009 +#: src/language/stats/crosstabs.q:2010 msgid "Kappa" msgstr "" -#: src/language/stats/crosstabs.q:2079 +#: src/language/stats/crosstabs.q:2080 #, c-format msgid "Odds Ratio for %s (%g / %g)" msgstr "" -#: src/language/stats/crosstabs.q:2082 +#: src/language/stats/crosstabs.q:2083 #, c-format msgid "Odds Ratio for %s (%.*s / %.*s)" msgstr "" -#: src/language/stats/crosstabs.q:2090 +#: src/language/stats/crosstabs.q:2091 #, c-format msgid "For cohort %s = %g" msgstr "" -#: src/language/stats/crosstabs.q:2093 +#: src/language/stats/crosstabs.q:2094 #, c-format msgid "For cohort %s = %.*s" msgstr "" -#: src/language/stats/crosstabs.q:2124 +#: src/language/stats/crosstabs.q:2125 msgid "Nominal by Interval" msgstr "" -#: src/language/stats/crosstabs.q:2129 +#: src/language/stats/crosstabs.q:2130 msgid "Lambda" msgstr "" -#: src/language/stats/crosstabs.q:2130 +#: src/language/stats/crosstabs.q:2131 msgid "Goodman and Kruskal tau" msgstr "" -#: src/language/stats/crosstabs.q:2131 +#: src/language/stats/crosstabs.q:2132 msgid "Uncertainty Coefficient" msgstr "" -#: src/language/stats/crosstabs.q:2132 +#: src/language/stats/crosstabs.q:2133 msgid "Somers' d" msgstr "" -#: src/language/stats/crosstabs.q:2133 +#: src/language/stats/crosstabs.q:2134 msgid "Eta" msgstr "" -#: src/language/stats/crosstabs.q:2138 +#: src/language/stats/crosstabs.q:2139 msgid "Symmetric" msgstr "" -#: src/language/stats/crosstabs.q:2139 src/language/stats/crosstabs.q:2140 +#: src/language/stats/crosstabs.q:2140 src/language/stats/crosstabs.q:2141 #, c-format msgid "%s Dependent" msgstr "" -#: src/language/stats/descriptives.c:107 src/language/stats/examine.q:1485 +#: src/language/stats/descriptives.c:108 src/language/stats/examine.q:1485 #: src/language/stats/frequencies.q:123 src/language/stats/oneway.q:404 #: src/language/stats/t-test.q:689 src/language/stats/t-test.q:712 #: src/language/stats/t-test.q:835 src/language/stats/t-test.q:1172 msgid "Mean" msgstr "" -#: src/language/stats/descriptives.c:108 +#: src/language/stats/descriptives.c:109 msgid "S E Mean" msgstr "" -#: src/language/stats/descriptives.c:109 src/language/stats/frequencies.q:127 +#: src/language/stats/descriptives.c:110 src/language/stats/frequencies.q:127 msgid "Std Dev" msgstr "" -#: src/language/stats/descriptives.c:110 src/language/stats/examine.q:1565 +#: src/language/stats/descriptives.c:111 src/language/stats/examine.q:1565 #: src/language/stats/frequencies.q:128 msgid "Variance" msgstr "" -#: src/language/stats/descriptives.c:111 src/language/stats/examine.q:1672 +#: src/language/stats/descriptives.c:112 src/language/stats/examine.q:1672 #: src/language/stats/frequencies.q:129 msgid "Kurtosis" msgstr "" -#: src/language/stats/descriptives.c:112 +#: src/language/stats/descriptives.c:113 msgid "S E Kurt" msgstr "" -#: src/language/stats/descriptives.c:113 src/language/stats/examine.q:1652 +#: src/language/stats/descriptives.c:114 src/language/stats/examine.q:1652 #: src/language/stats/frequencies.q:131 msgid "Skewness" msgstr "" -#: src/language/stats/descriptives.c:114 +#: src/language/stats/descriptives.c:115 msgid "S E Skew" msgstr "" -#: src/language/stats/descriptives.c:115 src/language/stats/examine.q:1613 +#: src/language/stats/descriptives.c:116 src/language/stats/examine.q:1613 #: src/language/stats/frequencies.q:133 msgid "Range" msgstr "" -#: src/language/stats/descriptives.c:116 src/language/stats/examine.q:1590 +#: src/language/stats/descriptives.c:117 src/language/stats/examine.q:1590 #: src/language/stats/frequencies.q:134 src/language/stats/oneway.q:416 msgid "Minimum" msgstr "" -#: src/language/stats/descriptives.c:117 src/language/stats/examine.q:1601 +#: src/language/stats/descriptives.c:118 src/language/stats/examine.q:1601 #: src/language/stats/frequencies.q:135 src/language/stats/oneway.q:417 msgid "Maximum" msgstr "" -#: src/language/stats/descriptives.c:118 src/language/stats/frequencies.q:136 +#: src/language/stats/descriptives.c:119 src/language/stats/frequencies.q:136 msgid "Sum" msgstr "" -#: src/language/stats/descriptives.c:343 +#: src/language/stats/descriptives.c:344 #, c-format msgid "Z-score variable name %s would be a duplicate variable name." msgstr "" -#: src/language/stats/descriptives.c:445 +#: src/language/stats/descriptives.c:446 msgid "expecting statistic name: reverting to default" msgstr "" -#: src/language/stats/descriptives.c:517 +#: src/language/stats/descriptives.c:518 msgid "" "Ran out of generic names for Z-score variables. There are only 126 generic " "names: ZSC001-ZSC0999, STDZ01-STDZ09, ZZZZ01-ZZZZ09, ZQZQ01-ZQZQ09." msgstr "" -#: src/language/stats/descriptives.c:548 +#: src/language/stats/descriptives.c:550 msgid "Mapping of variables to corresponding Z-scores." msgstr "" -#: src/language/stats/descriptives.c:553 +#: src/language/stats/descriptives.c:555 msgid "Source" msgstr "" -#: src/language/stats/descriptives.c:554 +#: src/language/stats/descriptives.c:556 msgid "Target" msgstr "" -#: src/language/stats/descriptives.c:672 src/language/stats/descriptives.c:678 +#: src/language/stats/descriptives.c:674 src/language/stats/descriptives.c:680 msgid "Z-score of " msgstr "" -#: src/language/stats/descriptives.c:897 +#: src/language/stats/descriptives.c:900 msgid "Valid N" msgstr "" -#: src/language/stats/descriptives.c:898 +#: src/language/stats/descriptives.c:901 msgid "Missing N" msgstr "" -#: src/language/stats/descriptives.c:925 +#: src/language/stats/descriptives.c:928 #, c-format msgid "Valid cases = %g; cases with missing value(s) = %g." msgstr "" @@ -3316,46 +3321,46 @@ msgstr "" msgid "%s of %s" msgstr "" -#: src/language/stats/rank.q:710 +#: src/language/stats/rank.q:718 msgid "Cannot create new rank variable. All candidates in use." msgstr "" -#: src/language/stats/rank.q:810 +#: src/language/stats/rank.q:818 msgid "Variables Created By RANK" msgstr "" -#: src/language/stats/rank.q:834 +#: src/language/stats/rank.q:842 #, c-format msgid "%s into %s(%s of %s using %s BY %s)" msgstr "" -#: src/language/stats/rank.q:845 +#: src/language/stats/rank.q:853 #, c-format msgid "%s into %s(%s of %s BY %s)" msgstr "" -#: src/language/stats/rank.q:859 +#: src/language/stats/rank.q:867 #, c-format msgid "%s into %s(%s of %s using %s)" msgstr "" -#: src/language/stats/rank.q:869 +#: src/language/stats/rank.q:877 #, c-format msgid "%s into %s(%s of %s)" msgstr "" -#: src/language/stats/rank.q:882 +#: src/language/stats/rank.q:890 msgid "" "FRACTION has been specified, but NORMAL and PROPORTION rank functions have " "not been requested. The FRACTION subcommand will be ignored." msgstr "" -#: src/language/stats/rank.q:974 +#: src/language/stats/rank.q:982 #, c-format msgid "Variable %s already exists." msgstr "" -#: src/language/stats/rank.q:979 +#: src/language/stats/rank.q:987 msgid "Too many variables in INTO clause." msgstr "" @@ -3723,20 +3728,20 @@ msgstr "" msgid "Document entered %s by %s:" msgstr "" -#: src/language/xforms/compute.c:143 src/language/xforms/compute.c:190 +#: src/language/xforms/compute.c:144 src/language/xforms/compute.c:191 #, c-format msgid "" "When executing COMPUTE: SYSMIS is not a valid value as an index into vector %" "s." msgstr "" -#: src/language/xforms/compute.c:146 src/language/xforms/compute.c:197 +#: src/language/xforms/compute.c:147 src/language/xforms/compute.c:198 #, c-format msgid "" "When executing COMPUTE: %g is not a valid value as an index into vector %s." msgstr "" -#: src/language/xforms/compute.c:331 +#: src/language/xforms/compute.c:333 #, c-format msgid "There is no vector named %s." msgstr "" @@ -3745,40 +3750,40 @@ msgstr "" msgid "Destination cannot be a string variable." msgstr "" -#: src/language/xforms/recode.c:247 +#: src/language/xforms/recode.c:248 msgid "" "Inconsistent target variable types. Target variables must be all numeric or " "all string." msgstr "" -#: src/language/xforms/recode.c:267 +#: src/language/xforms/recode.c:268 msgid "CONVERT requires string input values and numeric output values." msgstr "" -#: src/language/xforms/recode.c:385 +#: src/language/xforms/recode.c:386 msgid "expecting output value" msgstr "" -#: src/language/xforms/recode.c:432 +#: src/language/xforms/recode.c:433 #, c-format msgid "" "%u variable(s) cannot be recoded into %u variable(s). Specify the same " "number of variables as source and target variables." msgstr "" -#: src/language/xforms/recode.c:448 +#: src/language/xforms/recode.c:449 #, c-format msgid "" "There is no variable named %s. (All string variables specified on INTO must " "already exist. Use the STRING command to create a string variable.)" msgstr "" -#: src/language/xforms/recode.c:463 +#: src/language/xforms/recode.c:464 #, c-format msgid "INTO is required with %s input values and %s output values." msgstr "" -#: src/language/xforms/recode.c:476 +#: src/language/xforms/recode.c:477 #, c-format msgid "Type mismatch. Cannot store %s data in %s variable %s." msgstr "" @@ -3804,7 +3809,7 @@ msgstr "" msgid "The filter variable may not be scratch." msgstr "" -#: src/libpspp/hash.c:601 +#: src/libpspp/hash.c:617 #, c-format msgid "hash table:" msgstr "" @@ -3983,16 +3988,16 @@ msgstr "" msgid "PSPP Output" msgstr "" -#: src/output/html.c:168 +#: src/output/html.c:170 #, c-format msgid "unknown configuration parameter `%s' for HTML device driver" msgstr "" -#: src/output/html.c:184 +#: src/output/html.c:186 msgid "`chart-files' value must contain `#'" msgstr "" -#: src/output/html.c:382 +#: src/output/html.c:384 #, c-format msgid "creating \"%s\"" msgstr "" @@ -4223,12 +4228,12 @@ msgstr "" msgid "invalid numeric format" msgstr "" -#: src/output/table.c:231 +#: src/output/table.c:232 #, c-format msgid "bad vline: x=%d+%d=%d y=(%d+%d=%d,%d+%d=%d) in table size (%d,%d)\n" msgstr "" -#: src/output/table.c:302 +#: src/output/table.c:303 #, c-format msgid "" "bad box: (%d+%d=%d,%d+%d=%d)-(%d+%d=%d,%d+%d=%d) in table size (%d,%d)\n" diff --git a/po/pspp.pot b/po/pspp.pot index 88294177..ebefd7c0 100644 --- a/po/pspp.pot +++ b/po/pspp.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2006-10-06 17:58+0800\n" +"POT-Creation-Date: 2006-10-19 16:31+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -405,7 +405,7 @@ msgstr "" #: src/data/sys-file-reader.c:1368 src/data/sys-file-reader.c:1369 #: src/data/variable.c:42 src/language/dictionary/apply-dictionary.c:76 #: src/language/dictionary/apply-dictionary.c:77 -#: src/language/xforms/recode.c:478 src/language/xforms/recode.c:479 +#: src/language/xforms/recode.c:479 src/language/xforms/recode.c:480 msgid "numeric" msgstr "" @@ -414,7 +414,7 @@ msgstr "" #: src/data/variable.c:42 src/data/variable.c:50 #: src/language/dictionary/apply-dictionary.c:76 #: src/language/dictionary/apply-dictionary.c:77 -#: src/language/xforms/recode.c:478 src/language/xforms/recode.c:479 +#: src/language/xforms/recode.c:479 src/language/xforms/recode.c:480 msgid "string" msgstr "" @@ -982,94 +982,99 @@ msgstr "" msgid "scratch" msgstr "" -#: src/language/command.c:185 +#: src/language/command.c:183 +#, c-format +msgid "%s is unimplemented." +msgstr "" + +#: src/language/command.c:188 #, c-format msgid "%s may be used only in testing mode." msgstr "" -#: src/language/command.c:190 +#: src/language/command.c:193 #, c-format msgid "%s may be used only in enhanced syntax mode." msgstr "" -#: src/language/command.c:444 +#: src/language/command.c:447 msgid "expecting command name" msgstr "" -#: src/language/command.c:458 +#: src/language/command.c:461 #, c-format msgid "Unknown command %s." msgstr "" -#: src/language/command.c:584 +#: src/language/command.c:587 msgid "before the active file has been defined" msgstr "" -#: src/language/command.c:586 +#: src/language/command.c:589 msgid "after the active file has been defined" msgstr "" -#: src/language/command.c:588 +#: src/language/command.c:591 msgid "inside INPUT PROGRAM" msgstr "" -#: src/language/command.c:590 +#: src/language/command.c:593 msgid "inside FILE TYPE" msgstr "" -#: src/language/command.c:595 +#: src/language/command.c:598 #, c-format msgid "%s or %s" msgstr "" -#: src/language/command.c:597 +#: src/language/command.c:600 #, c-format msgid "%s, %s, or %s" msgstr "" -#: src/language/command.c:601 +#: src/language/command.c:604 #, c-format msgid "%s is allowed only %s." msgstr "" -#: src/language/command.c:606 +#: src/language/command.c:609 #, c-format msgid "%s is not allowed inside INPUT PROGRAM." msgstr "" -#: src/language/command.c:608 +#: src/language/command.c:611 #, c-format msgid "%s is not allowed inside FILE TYPE." msgstr "" -#: src/language/command.c:686 src/language/command.c:817 +#: src/language/command.c:689 src/language/command.c:820 #: src/language/utilities/permissions.c:102 msgid "This command not allowed when the SAFER option is set." msgstr "" -#: src/language/command.c:698 +#: src/language/command.c:701 #, c-format msgid "Error removing `%s': %s." msgstr "" -#: src/language/command.c:748 +#: src/language/command.c:751 #, c-format msgid "Couldn't fork: %s." msgstr "" -#: src/language/command.c:790 +#: src/language/command.c:793 #, c-format msgid "Error executing command: %s." msgstr "" -#: src/language/command.c:799 src/language/data-io/matrix-data.c:539 +#: src/language/command.c:802 src/language/data-io/matrix-data.c:539 #: src/language/data-io/print-space.c:76 src/language/dictionary/vector.c:201 #: src/language/lexer/lexer.c:453 src/language/stats/autorecode.c:154 #: src/language/xforms/select-if.c:62 msgid "expecting end of command" msgstr "" -#: src/language/command.c:838 +#: src/language/command.c:841 msgid "No operating system support for this command." msgstr "" @@ -1136,80 +1141,80 @@ msgstr "" msgid "Only one of FIXED, FREE, or LIST may be specified." msgstr "" -#: src/language/data-io/data-list.c:336 src/language/data-io/data-list.c:471 +#: src/language/data-io/data-list.c:337 src/language/data-io/data-list.c:472 #, c-format msgid "%s is a duplicate variable name." msgstr "" -#: src/language/data-io/data-list.c:343 +#: src/language/data-io/data-list.c:344 #, c-format msgid "There is already a variable %s of a different type." msgstr "" -#: src/language/data-io/data-list.c:350 +#: src/language/data-io/data-list.c:351 #, c-format msgid "There is already a string variable %s of a different width." msgstr "" -#: src/language/data-io/data-list.c:371 +#: src/language/data-io/data-list.c:372 msgid "At least one variable must be specified." msgstr "" -#: src/language/data-io/data-list.c:378 +#: src/language/data-io/data-list.c:379 msgid "" "Variables are specified on records that should not exist according to " "RECORDS subcommand." msgstr "" -#: src/language/data-io/data-list.c:403 src/language/data-io/data-list.c:503 +#: src/language/data-io/data-list.c:404 src/language/data-io/data-list.c:504 #: src/language/data-io/print.c:370 src/language/dictionary/split-file.c:84 #: src/language/dictionary/sys-file-info.c:144 #: src/language/dictionary/sys-file-info.c:378 -#: src/language/stats/descriptives.c:894 +#: src/language/stats/descriptives.c:897 msgid "Variable" msgstr "" -#: src/language/data-io/data-list.c:404 src/language/data-io/print.c:371 +#: src/language/data-io/data-list.c:405 src/language/data-io/print.c:371 msgid "Record" msgstr "" -#: src/language/data-io/data-list.c:405 src/language/data-io/print.c:372 +#: src/language/data-io/data-list.c:406 src/language/data-io/print.c:372 #: src/ui/gui/var-sheet.c:78 msgid "Columns" msgstr "" -#: src/language/data-io/data-list.c:406 src/language/data-io/data-list.c:504 +#: src/language/data-io/data-list.c:407 src/language/data-io/data-list.c:505 #: src/language/data-io/print.c:373 msgid "Format" msgstr "" -#: src/language/data-io/data-list.c:422 +#: src/language/data-io/data-list.c:423 #, c-format msgid "Reading %d record from %s." msgid_plural "Reading %d records from %s." msgstr[0] "" msgstr[1] "" -#: src/language/data-io/data-list.c:517 +#: src/language/data-io/data-list.c:518 #, c-format msgid "Reading free-form data from %s." msgstr "" -#: src/language/data-io/data-list.c:563 +#: src/language/data-io/data-list.c:564 msgid "Quoted string extends beyond end of line." msgstr "" -#: src/language/data-io/data-list.c:648 +#: src/language/data-io/data-list.c:649 #, c-format msgid "Partial case of %d of %d records discarded." msgstr "" -#: src/language/data-io/data-list.c:697 +#: src/language/data-io/data-list.c:698 #, c-format msgid "Partial case discarded. The first variable missing was %s." msgstr "" -#: src/language/data-io/data-list.c:733 +#: src/language/data-io/data-list.c:734 #, c-format msgid "" "Missing value(s) for all variables from %s onward. These will be filled " @@ -1310,17 +1315,17 @@ msgstr "" msgid "expecting COMM or TAPE" msgstr "" -#: src/language/data-io/get.c:358 src/language/data-io/get.c:372 -#: src/language/data-io/get.c:397 +#: src/language/data-io/get.c:359 src/language/data-io/get.c:373 +#: src/language/data-io/get.c:398 #, c-format msgid "expecting %s or %s" msgstr "" -#: src/language/data-io/get.c:606 src/language/data-io/print.c:174 +#: src/language/data-io/get.c:607 src/language/data-io/print.c:174 msgid "expecting a valid subcommand" msgstr "" -#: src/language/data-io/get.c:639 +#: src/language/data-io/get.c:640 #, c-format msgid "" "Cannot rename %s as %s because there already exists a variable named %s. To " @@ -1328,75 +1333,75 @@ msgid "" "as \"/RENAME (A=B)(B=C)(C=A)\", or equivalently, \"/RENAME (A B C=B C A)\"." msgstr "" -#: src/language/data-io/get.c:664 +#: src/language/data-io/get.c:665 msgid "`=' expected after variable list." msgstr "" -#: src/language/data-io/get.c:671 +#: src/language/data-io/get.c:672 #, c-format msgid "" "Number of variables on left side of `=' (%d) does not match number of " "variables on right side (%d), in parenthesized group %d of RENAME subcommand." msgstr "" -#: src/language/data-io/get.c:684 +#: src/language/data-io/get.c:685 #, c-format msgid "Requested renaming duplicates variable name %s." msgstr "" -#: src/language/data-io/get.c:714 +#: src/language/data-io/get.c:715 msgid "Cannot DROP all variables from dictionary." msgstr "" -#: src/language/data-io/get.c:891 +#: src/language/data-io/get.c:892 msgid "The active file may not be specified more than once." msgstr "" -#: src/language/data-io/get.c:899 +#: src/language/data-io/get.c:900 msgid "Cannot specify the active file since no active file has been defined." msgstr "" -#: src/language/data-io/get.c:906 +#: src/language/data-io/get.c:907 msgid "" "MATCH FILES may not be used after TEMPORARY when the active file is an input " "source. Temporary transformations will be made permanent." msgstr "" -#: src/language/data-io/get.c:942 +#: src/language/data-io/get.c:943 msgid "Multiple IN subcommands for a single FILE or TABLE." msgstr "" -#: src/language/data-io/get.c:962 +#: src/language/data-io/get.c:963 msgid "BY may appear at most once." msgstr "" -#: src/language/data-io/get.c:982 +#: src/language/data-io/get.c:983 #, c-format msgid "File %s lacks BY variable %s." msgstr "" -#: src/language/data-io/get.c:996 +#: src/language/data-io/get.c:997 msgid "FIRST may appear at most once." msgstr "" -#: src/language/data-io/get.c:1010 +#: src/language/data-io/get.c:1011 msgid "LAST may appear at most once." msgstr "" -#: src/language/data-io/get.c:1051 +#: src/language/data-io/get.c:1052 msgid "BY is required when TABLE is specified." msgstr "" -#: src/language/data-io/get.c:1056 +#: src/language/data-io/get.c:1057 msgid "BY is required when IN is specified." msgstr "" -#: src/language/data-io/get.c:1084 +#: src/language/data-io/get.c:1085 #, c-format msgid "IN variable name %s duplicates an existing variable name." msgstr "" -#: src/language/data-io/get.c:1538 +#: src/language/data-io/get.c:1541 #, c-format msgid "" "Variable %s in file %s (%s) has different type or width from the same " @@ -1411,16 +1416,16 @@ msgstr "" msgid "Input program did not create any variables." msgstr "" -#: src/language/data-io/inpt-pgm.c:337 +#: src/language/data-io/inpt-pgm.c:338 msgid "COLUMN subcommand multiply specified." msgstr "" -#: src/language/data-io/inpt-pgm.c:384 +#: src/language/data-io/inpt-pgm.c:385 msgid "" "REREAD: Column numbers must be positive finite numbers. Column set to 1." msgstr "" -#: src/language/data-io/list.q:152 src/language/stats/descriptives.c:361 +#: src/language/data-io/list.q:152 src/language/stats/descriptives.c:362 msgid "No variables specified." msgstr "" @@ -1560,79 +1565,79 @@ msgstr "" msgid "No continuous variables specified." msgstr "" -#: src/language/data-io/matrix-data.c:840 +#: src/language/data-io/matrix-data.c:841 msgid "Scope of string exceeds line." msgstr "" -#: src/language/data-io/matrix-data.c:901 +#: src/language/data-io/matrix-data.c:902 #, c-format msgid "End of line expected %s while reading %s." msgstr "" -#: src/language/data-io/matrix-data.c:1090 +#: src/language/data-io/matrix-data.c:1091 #, c-format msgid "expecting value for %s %s" msgstr "" -#: src/language/data-io/matrix-data.c:1255 +#: src/language/data-io/matrix-data.c:1256 #, c-format msgid "Syntax error expecting SPLIT FILE value %s." msgstr "" -#: src/language/data-io/matrix-data.c:1264 +#: src/language/data-io/matrix-data.c:1265 #, c-format msgid "Expecting value %g for %s." msgstr "" -#: src/language/data-io/matrix-data.c:1305 -#: src/language/data-io/matrix-data.c:1782 +#: src/language/data-io/matrix-data.c:1306 +#: src/language/data-io/matrix-data.c:1784 #, c-format msgid "Syntax error expecting factor value %s." msgstr "" -#: src/language/data-io/matrix-data.c:1314 +#: src/language/data-io/matrix-data.c:1315 #, c-format msgid "Syntax error expecting value %g for %s %s." msgstr "" -#: src/language/data-io/matrix-data.c:1558 +#: src/language/data-io/matrix-data.c:1560 #, c-format msgid "Syntax error %s expecting SPLIT FILE value." msgstr "" -#: src/language/data-io/matrix-data.c:1687 +#: src/language/data-io/matrix-data.c:1689 #, c-format msgid "" "Expected %d lines of data for %s content; actually saw %d lines. No data " "will be output for this content." msgstr "" -#: src/language/data-io/matrix-data.c:1724 +#: src/language/data-io/matrix-data.c:1726 #, c-format msgid "Multiply specified ROWTYPE_ %s." msgstr "" -#: src/language/data-io/matrix-data.c:1729 +#: src/language/data-io/matrix-data.c:1731 #, c-format msgid "Syntax error %s expecting ROWTYPE_ string." msgstr "" -#: src/language/data-io/matrix-data.c:1749 +#: src/language/data-io/matrix-data.c:1751 #, c-format msgid "Syntax error %s." msgstr "" -#: src/language/data-io/matrix-data.c:1900 +#: src/language/data-io/matrix-data.c:1902 #, c-format msgid "Duplicate specification for %s." msgstr "" -#: src/language/data-io/matrix-data.c:1912 +#: src/language/data-io/matrix-data.c:1914 #, c-format msgid "Too many rows of matrix data for %s." msgstr "" -#: src/language/data-io/matrix-data.c:1956 +#: src/language/data-io/matrix-data.c:1958 #, c-format msgid "Syntax error expecting value for %s %s." msgstr "" @@ -1696,11 +1701,11 @@ msgid_plural "Writing %d records." msgstr[0] "" msgstr[1] "" -#: src/language/data-io/print-space.c:116 +#: src/language/data-io/print-space.c:117 msgid "The expression on PRINT SPACE evaluated to the system-missing value." msgstr "" -#: src/language/data-io/print-space.c:119 +#: src/language/data-io/print-space.c:120 #, c-format msgid "The expression on PRINT SPACE evaluated to %g." msgstr "" @@ -1735,7 +1740,7 @@ msgid "`)' expected after output format." msgstr "" #: src/language/dictionary/missing-values.c:57 -#: src/language/stats/aggregate.c:447 +#: src/language/stats/aggregate.c:450 msgid "expecting `('" msgstr "" @@ -1876,8 +1881,8 @@ msgstr "" #: src/language/dictionary/split-file.c:85 #: src/language/dictionary/sys-file-info.c:523 -#: src/language/stats/crosstabs.q:1115 src/language/stats/crosstabs.q:1142 -#: src/language/stats/crosstabs.q:1162 src/language/stats/crosstabs.q:1184 +#: src/language/stats/crosstabs.q:1116 src/language/stats/crosstabs.q:1143 +#: src/language/stats/crosstabs.q:1163 src/language/stats/crosstabs.q:1185 #: src/language/stats/examine.q:1149 src/language/stats/frequencies.q:1177 #: src/language/stats/frequencies.q:1301 msgid "Value" @@ -2172,7 +2177,7 @@ msgstr "" msgid "Unknown identifier %s." msgstr "" -#: src/language/expressions/parse.c:854 src/language/stats/aggregate.c:503 +#: src/language/expressions/parse.c:854 src/language/stats/aggregate.c:506 msgid "expecting `)'" msgstr "" @@ -2246,7 +2251,7 @@ msgstr "" msgid "%s is not yet implemented." msgstr "" -#: src/language/expressions/parse.c:1235 +#: src/language/expressions/parse.c:1236 #, c-format msgid "%s may not appear after TEMPORARY." msgstr "" @@ -2307,50 +2312,50 @@ msgstr "" msgid "expecting identifier" msgstr "" -#: src/language/lexer/lexer.c:861 +#: src/language/lexer/lexer.c:862 msgid "" msgstr "" -#: src/language/lexer/lexer.c:1007 +#: src/language/lexer/lexer.c:1008 msgid "binary" msgstr "" -#: src/language/lexer/lexer.c:1012 +#: src/language/lexer/lexer.c:1013 msgid "octal" msgstr "" -#: src/language/lexer/lexer.c:1017 +#: src/language/lexer/lexer.c:1018 msgid "hex" msgstr "" -#: src/language/lexer/lexer.c:1027 +#: src/language/lexer/lexer.c:1028 #, c-format msgid "String of %s digits has %d characters, which is not a multiple of %d." msgstr "" -#: src/language/lexer/lexer.c:1056 +#: src/language/lexer/lexer.c:1057 #, c-format msgid "`%c' is not a valid %s digit." msgstr "" -#: src/language/lexer/lexer.c:1087 +#: src/language/lexer/lexer.c:1088 msgid "Unterminated string constant." msgstr "" -#: src/language/lexer/lexer.c:1141 +#: src/language/lexer/lexer.c:1142 msgid "Unexpected end of file in string concatenation." msgstr "" -#: src/language/lexer/lexer.c:1149 +#: src/language/lexer/lexer.c:1150 msgid "String expected following `+'." msgstr "" -#: src/language/lexer/lexer.c:1162 +#: src/language/lexer/lexer.c:1163 #, c-format msgid "String exceeds 255 characters in length (%d characters)." msgstr "" -#: src/language/lexer/lexer.c:1177 +#: src/language/lexer/lexer.c:1178 msgid "" "Sorry, literal strings may not contain null characters. Replacing with " "spaces." @@ -2486,40 +2491,40 @@ msgid "" "has no effect. Output data will be sorted the same way as the input data." msgstr "" -#: src/language/stats/aggregate.c:416 +#: src/language/stats/aggregate.c:419 msgid "expecting aggregation function" msgstr "" -#: src/language/stats/aggregate.c:432 +#: src/language/stats/aggregate.c:435 #, c-format msgid "Unknown aggregation function %s." msgstr "" -#: src/language/stats/aggregate.c:484 +#: src/language/stats/aggregate.c:487 #, c-format msgid "Missing argument %d to %s." msgstr "" -#: src/language/stats/aggregate.c:493 +#: src/language/stats/aggregate.c:496 #, c-format msgid "Arguments to %s must be of same type as source variables." msgstr "" -#: src/language/stats/aggregate.c:515 +#: src/language/stats/aggregate.c:518 #, c-format msgid "" "Number of source variables (%u) does not match number of target variables (%" "u)." msgstr "" -#: src/language/stats/aggregate.c:531 +#: src/language/stats/aggregate.c:534 #, c-format msgid "" "The value arguments passed to the %s function are out-of-order. They will " "be treated as if they had been specified in the correct order." msgstr "" -#: src/language/stats/aggregate.c:598 +#: src/language/stats/aggregate.c:601 #, c-format msgid "" "Variable name %s is not unique within the aggregate file dictionary, which " @@ -2567,380 +2572,380 @@ msgstr "" msgid "Maximum value (%ld) less than minimum value (%ld)." msgstr "" -#: src/language/stats/crosstabs.q:816 +#: src/language/stats/crosstabs.q:817 msgid "Summary." msgstr "" -#: src/language/stats/crosstabs.q:818 src/language/stats/examine.q:934 +#: src/language/stats/crosstabs.q:819 src/language/stats/examine.q:934 msgid "Cases" msgstr "" -#: src/language/stats/crosstabs.q:819 src/language/stats/examine.q:868 +#: src/language/stats/crosstabs.q:820 src/language/stats/examine.q:868 #: src/language/stats/frequencies.q:1175 src/language/stats/frequencies.q:1551 msgid "Valid" msgstr "" -#: src/language/stats/crosstabs.q:820 src/language/stats/examine.q:869 +#: src/language/stats/crosstabs.q:821 src/language/stats/examine.q:869 #: src/language/stats/frequencies.q:1244 src/language/stats/frequencies.q:1552 #: src/ui/gui/var-sheet.c:77 msgid "Missing" msgstr "" -#: src/language/stats/crosstabs.q:821 src/language/stats/crosstabs.q:1024 -#: src/language/stats/crosstabs.q:1744 src/language/stats/examine.q:870 +#: src/language/stats/crosstabs.q:822 src/language/stats/crosstabs.q:1025 +#: src/language/stats/crosstabs.q:1745 src/language/stats/examine.q:870 #: src/language/stats/frequencies.q:1253 src/language/stats/oneway.q:317 #: src/language/stats/oneway.q:481 src/language/stats/regression.q:314 msgid "Total" msgstr "" -#: src/language/stats/crosstabs.q:831 src/language/stats/examine.q:946 +#: src/language/stats/crosstabs.q:832 src/language/stats/examine.q:946 #: src/language/stats/frequencies.q:1550 src/language/stats/oneway.q:403 #: src/language/stats/t-test.q:688 src/language/stats/t-test.q:711 #: src/language/stats/t-test.q:836 src/language/stats/t-test.q:1371 msgid "N" msgstr "" -#: src/language/stats/crosstabs.q:832 src/language/stats/examine.q:949 +#: src/language/stats/crosstabs.q:833 src/language/stats/examine.q:949 #: src/language/stats/frequencies.q:1179 src/language/stats/frequencies.q:1180 #: src/language/stats/frequencies.q:1181 msgid "Percent" msgstr "" -#: src/language/stats/crosstabs.q:1074 +#: src/language/stats/crosstabs.q:1075 msgid "count" msgstr "" -#: src/language/stats/crosstabs.q:1075 +#: src/language/stats/crosstabs.q:1076 msgid "row %" msgstr "" -#: src/language/stats/crosstabs.q:1076 +#: src/language/stats/crosstabs.q:1077 msgid "column %" msgstr "" -#: src/language/stats/crosstabs.q:1077 +#: src/language/stats/crosstabs.q:1078 msgid "total %" msgstr "" -#: src/language/stats/crosstabs.q:1078 +#: src/language/stats/crosstabs.q:1079 msgid "expected" msgstr "" -#: src/language/stats/crosstabs.q:1079 +#: src/language/stats/crosstabs.q:1080 msgid "residual" msgstr "" -#: src/language/stats/crosstabs.q:1080 +#: src/language/stats/crosstabs.q:1081 msgid "std. resid." msgstr "" -#: src/language/stats/crosstabs.q:1081 +#: src/language/stats/crosstabs.q:1082 msgid "adj. resid." msgstr "" -#: src/language/stats/crosstabs.q:1111 +#: src/language/stats/crosstabs.q:1112 msgid "Chi-square tests." msgstr "" -#: src/language/stats/crosstabs.q:1114 src/language/stats/crosstabs.q:1141 -#: src/language/stats/crosstabs.q:1161 src/language/stats/crosstabs.q:1182 +#: src/language/stats/crosstabs.q:1115 src/language/stats/crosstabs.q:1142 +#: src/language/stats/crosstabs.q:1162 src/language/stats/crosstabs.q:1183 #: src/language/stats/examine.q:1380 msgid "Statistic" msgstr "" -#: src/language/stats/crosstabs.q:1116 src/language/stats/oneway.q:290 +#: src/language/stats/crosstabs.q:1117 src/language/stats/oneway.q:290 #: src/language/stats/oneway.q:693 src/language/stats/regression.q:307 #: src/language/stats/t-test.q:986 src/language/stats/t-test.q:1178 #: src/language/stats/t-test.q:1270 msgid "df" msgstr "" -#: src/language/stats/crosstabs.q:1118 +#: src/language/stats/crosstabs.q:1119 msgid "Asymp. Sig. (2-sided)" msgstr "" -#: src/language/stats/crosstabs.q:1120 +#: src/language/stats/crosstabs.q:1121 msgid "Exact. Sig. (2-sided)" msgstr "" -#: src/language/stats/crosstabs.q:1122 +#: src/language/stats/crosstabs.q:1123 msgid "Exact. Sig. (1-sided)" msgstr "" -#: src/language/stats/crosstabs.q:1137 +#: src/language/stats/crosstabs.q:1138 msgid "Symmetric measures." msgstr "" -#: src/language/stats/crosstabs.q:1140 src/language/stats/crosstabs.q:1181 +#: src/language/stats/crosstabs.q:1141 src/language/stats/crosstabs.q:1182 msgid "Category" msgstr "" -#: src/language/stats/crosstabs.q:1143 src/language/stats/crosstabs.q:1185 +#: src/language/stats/crosstabs.q:1144 src/language/stats/crosstabs.q:1186 msgid "Asymp. Std. Error" msgstr "" -#: src/language/stats/crosstabs.q:1144 src/language/stats/crosstabs.q:1186 +#: src/language/stats/crosstabs.q:1145 src/language/stats/crosstabs.q:1187 msgid "Approx. T" msgstr "" -#: src/language/stats/crosstabs.q:1145 src/language/stats/crosstabs.q:1187 +#: src/language/stats/crosstabs.q:1146 src/language/stats/crosstabs.q:1188 msgid "Approx. Sig." msgstr "" -#: src/language/stats/crosstabs.q:1156 +#: src/language/stats/crosstabs.q:1157 msgid "Risk estimate." msgstr "" -#: src/language/stats/crosstabs.q:1160 +#: src/language/stats/crosstabs.q:1161 #, c-format msgid "95%% Confidence Interval" msgstr "" -#: src/language/stats/crosstabs.q:1163 src/language/stats/t-test.q:990 +#: src/language/stats/crosstabs.q:1164 src/language/stats/t-test.q:990 #: src/language/stats/t-test.q:1175 src/language/stats/t-test.q:1273 msgid "Lower" msgstr "" -#: src/language/stats/crosstabs.q:1164 src/language/stats/t-test.q:991 +#: src/language/stats/crosstabs.q:1165 src/language/stats/t-test.q:991 #: src/language/stats/t-test.q:1176 src/language/stats/t-test.q:1274 msgid "Upper" msgstr "" -#: src/language/stats/crosstabs.q:1178 +#: src/language/stats/crosstabs.q:1179 msgid "Directional measures." msgstr "" -#: src/language/stats/crosstabs.q:1183 src/ui/gui/var-sheet.c:72 +#: src/language/stats/crosstabs.q:1184 src/ui/gui/var-sheet.c:72 msgid "Type" msgstr "" -#: src/language/stats/crosstabs.q:1936 +#: src/language/stats/crosstabs.q:1937 msgid "Pearson Chi-Square" msgstr "" -#: src/language/stats/crosstabs.q:1937 +#: src/language/stats/crosstabs.q:1938 msgid "Likelihood Ratio" msgstr "" -#: src/language/stats/crosstabs.q:1938 +#: src/language/stats/crosstabs.q:1939 msgid "Fisher's Exact Test" msgstr "" -#: src/language/stats/crosstabs.q:1939 +#: src/language/stats/crosstabs.q:1940 msgid "Continuity Correction" msgstr "" -#: src/language/stats/crosstabs.q:1940 +#: src/language/stats/crosstabs.q:1941 msgid "Linear-by-Linear Association" msgstr "" -#: src/language/stats/crosstabs.q:1977 src/language/stats/crosstabs.q:2047 -#: src/language/stats/crosstabs.q:2106 +#: src/language/stats/crosstabs.q:1978 src/language/stats/crosstabs.q:2048 +#: src/language/stats/crosstabs.q:2107 msgid "N of Valid Cases" msgstr "" -#: src/language/stats/crosstabs.q:1993 src/language/stats/crosstabs.q:2122 +#: src/language/stats/crosstabs.q:1994 src/language/stats/crosstabs.q:2123 msgid "Nominal by Nominal" msgstr "" -#: src/language/stats/crosstabs.q:1994 src/language/stats/crosstabs.q:2123 +#: src/language/stats/crosstabs.q:1995 src/language/stats/crosstabs.q:2124 msgid "Ordinal by Ordinal" msgstr "" -#: src/language/stats/crosstabs.q:1995 +#: src/language/stats/crosstabs.q:1996 msgid "Interval by Interval" msgstr "" -#: src/language/stats/crosstabs.q:1996 +#: src/language/stats/crosstabs.q:1997 msgid "Measure of Agreement" msgstr "" -#: src/language/stats/crosstabs.q:2001 +#: src/language/stats/crosstabs.q:2002 msgid "Phi" msgstr "" -#: src/language/stats/crosstabs.q:2002 +#: src/language/stats/crosstabs.q:2003 msgid "Cramer's V" msgstr "" -#: src/language/stats/crosstabs.q:2003 +#: src/language/stats/crosstabs.q:2004 msgid "Contingency Coefficient" msgstr "" -#: src/language/stats/crosstabs.q:2004 +#: src/language/stats/crosstabs.q:2005 msgid "Kendall's tau-b" msgstr "" -#: src/language/stats/crosstabs.q:2005 +#: src/language/stats/crosstabs.q:2006 msgid "Kendall's tau-c" msgstr "" -#: src/language/stats/crosstabs.q:2006 +#: src/language/stats/crosstabs.q:2007 msgid "Gamma" msgstr "" -#: src/language/stats/crosstabs.q:2007 +#: src/language/stats/crosstabs.q:2008 msgid "Spearman Correlation" msgstr "" -#: src/language/stats/crosstabs.q:2008 +#: src/language/stats/crosstabs.q:2009 msgid "Pearson's R" msgstr "" -#: src/language/stats/crosstabs.q:2009 +#: src/language/stats/crosstabs.q:2010 msgid "Kappa" msgstr "" -#: src/language/stats/crosstabs.q:2079 +#: src/language/stats/crosstabs.q:2080 #, c-format msgid "Odds Ratio for %s (%g / %g)" msgstr "" -#: src/language/stats/crosstabs.q:2082 +#: src/language/stats/crosstabs.q:2083 #, c-format msgid "Odds Ratio for %s (%.*s / %.*s)" msgstr "" -#: src/language/stats/crosstabs.q:2090 +#: src/language/stats/crosstabs.q:2091 #, c-format msgid "For cohort %s = %g" msgstr "" -#: src/language/stats/crosstabs.q:2093 +#: src/language/stats/crosstabs.q:2094 #, c-format msgid "For cohort %s = %.*s" msgstr "" -#: src/language/stats/crosstabs.q:2124 +#: src/language/stats/crosstabs.q:2125 msgid "Nominal by Interval" msgstr "" -#: src/language/stats/crosstabs.q:2129 +#: src/language/stats/crosstabs.q:2130 msgid "Lambda" msgstr "" -#: src/language/stats/crosstabs.q:2130 +#: src/language/stats/crosstabs.q:2131 msgid "Goodman and Kruskal tau" msgstr "" -#: src/language/stats/crosstabs.q:2131 +#: src/language/stats/crosstabs.q:2132 msgid "Uncertainty Coefficient" msgstr "" -#: src/language/stats/crosstabs.q:2132 +#: src/language/stats/crosstabs.q:2133 msgid "Somers' d" msgstr "" -#: src/language/stats/crosstabs.q:2133 +#: src/language/stats/crosstabs.q:2134 msgid "Eta" msgstr "" -#: src/language/stats/crosstabs.q:2138 +#: src/language/stats/crosstabs.q:2139 msgid "Symmetric" msgstr "" -#: src/language/stats/crosstabs.q:2139 src/language/stats/crosstabs.q:2140 +#: src/language/stats/crosstabs.q:2140 src/language/stats/crosstabs.q:2141 #, c-format msgid "%s Dependent" msgstr "" -#: src/language/stats/descriptives.c:107 src/language/stats/examine.q:1485 +#: src/language/stats/descriptives.c:108 src/language/stats/examine.q:1485 #: src/language/stats/frequencies.q:123 src/language/stats/oneway.q:404 #: src/language/stats/t-test.q:689 src/language/stats/t-test.q:712 #: src/language/stats/t-test.q:835 src/language/stats/t-test.q:1172 msgid "Mean" msgstr "" -#: src/language/stats/descriptives.c:108 +#: src/language/stats/descriptives.c:109 msgid "S E Mean" msgstr "" -#: src/language/stats/descriptives.c:109 src/language/stats/frequencies.q:127 +#: src/language/stats/descriptives.c:110 src/language/stats/frequencies.q:127 msgid "Std Dev" msgstr "" -#: src/language/stats/descriptives.c:110 src/language/stats/examine.q:1565 +#: src/language/stats/descriptives.c:111 src/language/stats/examine.q:1565 #: src/language/stats/frequencies.q:128 msgid "Variance" msgstr "" -#: src/language/stats/descriptives.c:111 src/language/stats/examine.q:1672 +#: src/language/stats/descriptives.c:112 src/language/stats/examine.q:1672 #: src/language/stats/frequencies.q:129 msgid "Kurtosis" msgstr "" -#: src/language/stats/descriptives.c:112 +#: src/language/stats/descriptives.c:113 msgid "S E Kurt" msgstr "" -#: src/language/stats/descriptives.c:113 src/language/stats/examine.q:1652 +#: src/language/stats/descriptives.c:114 src/language/stats/examine.q:1652 #: src/language/stats/frequencies.q:131 msgid "Skewness" msgstr "" -#: src/language/stats/descriptives.c:114 +#: src/language/stats/descriptives.c:115 msgid "S E Skew" msgstr "" -#: src/language/stats/descriptives.c:115 src/language/stats/examine.q:1613 +#: src/language/stats/descriptives.c:116 src/language/stats/examine.q:1613 #: src/language/stats/frequencies.q:133 msgid "Range" msgstr "" -#: src/language/stats/descriptives.c:116 src/language/stats/examine.q:1590 +#: src/language/stats/descriptives.c:117 src/language/stats/examine.q:1590 #: src/language/stats/frequencies.q:134 src/language/stats/oneway.q:416 msgid "Minimum" msgstr "" -#: src/language/stats/descriptives.c:117 src/language/stats/examine.q:1601 +#: src/language/stats/descriptives.c:118 src/language/stats/examine.q:1601 #: src/language/stats/frequencies.q:135 src/language/stats/oneway.q:417 msgid "Maximum" msgstr "" -#: src/language/stats/descriptives.c:118 src/language/stats/frequencies.q:136 +#: src/language/stats/descriptives.c:119 src/language/stats/frequencies.q:136 msgid "Sum" msgstr "" -#: src/language/stats/descriptives.c:343 +#: src/language/stats/descriptives.c:344 #, c-format msgid "Z-score variable name %s would be a duplicate variable name." msgstr "" -#: src/language/stats/descriptives.c:445 +#: src/language/stats/descriptives.c:446 msgid "expecting statistic name: reverting to default" msgstr "" -#: src/language/stats/descriptives.c:517 +#: src/language/stats/descriptives.c:518 msgid "" "Ran out of generic names for Z-score variables. There are only 126 generic " "names: ZSC001-ZSC0999, STDZ01-STDZ09, ZZZZ01-ZZZZ09, ZQZQ01-ZQZQ09." msgstr "" -#: src/language/stats/descriptives.c:548 +#: src/language/stats/descriptives.c:550 msgid "Mapping of variables to corresponding Z-scores." msgstr "" -#: src/language/stats/descriptives.c:553 +#: src/language/stats/descriptives.c:555 msgid "Source" msgstr "" -#: src/language/stats/descriptives.c:554 +#: src/language/stats/descriptives.c:556 msgid "Target" msgstr "" -#: src/language/stats/descriptives.c:672 src/language/stats/descriptives.c:678 +#: src/language/stats/descriptives.c:674 src/language/stats/descriptives.c:680 msgid "Z-score of " msgstr "" -#: src/language/stats/descriptives.c:897 +#: src/language/stats/descriptives.c:900 msgid "Valid N" msgstr "" -#: src/language/stats/descriptives.c:898 +#: src/language/stats/descriptives.c:901 msgid "Missing N" msgstr "" -#: src/language/stats/descriptives.c:925 +#: src/language/stats/descriptives.c:928 #, c-format msgid "Valid cases = %g; cases with missing value(s) = %g." msgstr "" @@ -3315,46 +3320,46 @@ msgstr "" msgid "%s of %s" msgstr "" -#: src/language/stats/rank.q:710 +#: src/language/stats/rank.q:718 msgid "Cannot create new rank variable. All candidates in use." msgstr "" -#: src/language/stats/rank.q:810 +#: src/language/stats/rank.q:818 msgid "Variables Created By RANK" msgstr "" -#: src/language/stats/rank.q:834 +#: src/language/stats/rank.q:842 #, c-format msgid "%s into %s(%s of %s using %s BY %s)" msgstr "" -#: src/language/stats/rank.q:845 +#: src/language/stats/rank.q:853 #, c-format msgid "%s into %s(%s of %s BY %s)" msgstr "" -#: src/language/stats/rank.q:859 +#: src/language/stats/rank.q:867 #, c-format msgid "%s into %s(%s of %s using %s)" msgstr "" -#: src/language/stats/rank.q:869 +#: src/language/stats/rank.q:877 #, c-format msgid "%s into %s(%s of %s)" msgstr "" -#: src/language/stats/rank.q:882 +#: src/language/stats/rank.q:890 msgid "" "FRACTION has been specified, but NORMAL and PROPORTION rank functions have " "not been requested. The FRACTION subcommand will be ignored." msgstr "" -#: src/language/stats/rank.q:974 +#: src/language/stats/rank.q:982 #, c-format msgid "Variable %s already exists." msgstr "" -#: src/language/stats/rank.q:979 +#: src/language/stats/rank.q:987 msgid "Too many variables in INTO clause." msgstr "" @@ -3722,20 +3727,20 @@ msgstr "" msgid "Document entered %s by %s:" msgstr "" -#: src/language/xforms/compute.c:143 src/language/xforms/compute.c:190 +#: src/language/xforms/compute.c:144 src/language/xforms/compute.c:191 #, c-format msgid "" "When executing COMPUTE: SYSMIS is not a valid value as an index into vector %" "s." msgstr "" -#: src/language/xforms/compute.c:146 src/language/xforms/compute.c:197 +#: src/language/xforms/compute.c:147 src/language/xforms/compute.c:198 #, c-format msgid "" "When executing COMPUTE: %g is not a valid value as an index into vector %s." msgstr "" -#: src/language/xforms/compute.c:331 +#: src/language/xforms/compute.c:333 #, c-format msgid "There is no vector named %s." msgstr "" @@ -3744,40 +3749,40 @@ msgstr "" msgid "Destination cannot be a string variable." msgstr "" -#: src/language/xforms/recode.c:247 +#: src/language/xforms/recode.c:248 msgid "" "Inconsistent target variable types. Target variables must be all numeric or " "all string." msgstr "" -#: src/language/xforms/recode.c:267 +#: src/language/xforms/recode.c:268 msgid "CONVERT requires string input values and numeric output values." msgstr "" -#: src/language/xforms/recode.c:385 +#: src/language/xforms/recode.c:386 msgid "expecting output value" msgstr "" -#: src/language/xforms/recode.c:432 +#: src/language/xforms/recode.c:433 #, c-format msgid "" "%u variable(s) cannot be recoded into %u variable(s). Specify the same " "number of variables as source and target variables." msgstr "" -#: src/language/xforms/recode.c:448 +#: src/language/xforms/recode.c:449 #, c-format msgid "" "There is no variable named %s. (All string variables specified on INTO must " "already exist. Use the STRING command to create a string variable.)" msgstr "" -#: src/language/xforms/recode.c:463 +#: src/language/xforms/recode.c:464 #, c-format msgid "INTO is required with %s input values and %s output values." msgstr "" -#: src/language/xforms/recode.c:476 +#: src/language/xforms/recode.c:477 #, c-format msgid "Type mismatch. Cannot store %s data in %s variable %s." msgstr "" @@ -3803,7 +3808,7 @@ msgstr "" msgid "The filter variable may not be scratch." msgstr "" -#: src/libpspp/hash.c:601 +#: src/libpspp/hash.c:617 #, c-format msgid "hash table:" msgstr "" @@ -3982,16 +3987,16 @@ msgstr "" msgid "PSPP Output" msgstr "" -#: src/output/html.c:168 +#: src/output/html.c:170 #, c-format msgid "unknown configuration parameter `%s' for HTML device driver" msgstr "" -#: src/output/html.c:184 +#: src/output/html.c:186 msgid "`chart-files' value must contain `#'" msgstr "" -#: src/output/html.c:382 +#: src/output/html.c:384 #, c-format msgid "creating \"%s\"" msgstr "" @@ -4222,12 +4227,12 @@ msgstr "" msgid "invalid numeric format" msgstr "" -#: src/output/table.c:231 +#: src/output/table.c:232 #, c-format msgid "bad vline: x=%d+%d=%d y=(%d+%d=%d,%d+%d=%d) in table size (%d,%d)\n" msgstr "" -#: src/output/table.c:302 +#: src/output/table.c:303 #, c-format msgid "" "bad box: (%d+%d=%d,%d+%d=%d)-(%d+%d=%d,%d+%d=%d) in table size (%d,%d)\n" diff --git a/src/data/ChangeLog b/src/data/ChangeLog index fb3632a9..4e15a8de 100644 --- a/src/data/ChangeLog +++ b/src/data/ChangeLog @@ -1,3 +1,8 @@ +Thu Oct 19 22:59:56 WST 2006 John Darrington + + * procedure.c procedure.h: Encapsulated the static data into a single + struct. + Sat Oct 14 16:56:44 2006 Ben Pfaff * casefile.c (casereader_read_xfer): Always initialize the case, diff --git a/src/data/dictionary.c b/src/data/dictionary.c index a7ba0274..6fe08f17 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -435,7 +435,7 @@ compare_var_ptrs (const void *a_, const void *b_, void *aux UNUSED) /* Deletes variable V from dictionary D and frees V. This is a very bad idea if there might be any pointers to V - from outside D. In general, no variable in default_dict + from outside D. In general, no variable in current_dataset->dict should be deleted when any transformations are active, because those transformations might reference the deleted variable. The safest time to delete a variable is just after a procedure diff --git a/src/data/procedure.c b/src/data/procedure.c index 1843852a..5341de46 100644 --- a/src/data/procedure.c +++ b/src/data/procedure.c @@ -43,74 +43,82 @@ struct write_case_data { /* Function to call for each case. */ - bool (*case_func) (const struct ccase *, void *); + case_func_t case_func; void *aux; + struct dataset *dataset; /* The dataset concerned */ struct ccase trns_case; /* Case used for transformations. */ struct ccase sink_case; /* Case written to sink, if compacting is necessary. */ size_t cases_written; /* Cases output so far. */ }; -/* Cases are read from proc_source, - pass through permanent_trns_chain (which transforms them into - the format described by permanent_dict), - are written to proc_sink, - pass through temporary_trns_chain (which transforms them into - the format described by default_dict), - and are finally passed to the procedure. */ -static struct case_source *proc_source; -static struct trns_chain *permanent_trns_chain; -static struct dictionary *permanent_dict; -static struct case_sink *proc_sink; -static struct trns_chain *temporary_trns_chain; -struct dictionary *default_dict; - -/* The transformation chain that the next transformation will be - added to. */ -static struct trns_chain *cur_trns_chain; - -/* The compactor used to compact a case, if necessary; - otherwise a null pointer. */ -static struct dict_compactor *compactor; - -/* Time at which proc was last invoked. */ -static time_t last_proc_invocation; - -/* Lag queue. */ -int n_lag; /* Number of cases to lag. */ -static int lag_count; /* Number of cases in lag_queue so far. */ -static int lag_head; /* Index where next case will be added. */ -static struct ccase *lag_queue; /* Array of n_lag ccase * elements. */ - -static void add_case_limit_trns (void); -static void add_filter_trns (void); - -static bool internal_procedure (bool (*case_func) (const struct ccase *, - void *), +struct dataset { + /* Cases are read from proc_source, + pass through permanent_trns_chain (which transforms them into + the format described by permanent_dict), + are written to proc_sink, + pass through temporary_trns_chain (which transforms them into + the format described by dict), + and are finally passed to the procedure. */ + struct case_source *proc_source; + struct trns_chain *permanent_trns_chain; + struct dictionary *permanent_dict; + struct case_sink *proc_sink; + struct trns_chain *temporary_trns_chain; + struct dictionary *dict; + + /* The transformation chain that the next transformation will be + added to. */ + struct trns_chain *cur_trns_chain; + + /* The compactor used to compact a case, if necessary; + otherwise a null pointer. */ + struct dict_compactor *compactor; + + /* Time at which proc was last invoked. */ + time_t last_proc_invocation; + + /* Lag queue. */ + int n_lag; /* Number of cases to lag. */ + int lag_count; /* Number of cases in lag_queue so far. */ + int lag_head; /* Index where next case will be added. */ + struct ccase *lag_queue; /* Array of n_lag ccase * elements. */ + +}; /* struct dataset */ + + +struct dataset *current_dataset; + +static void add_case_limit_trns (struct dataset *ds); +static void add_filter_trns (struct dataset *ds); + +static bool internal_procedure (struct dataset *ds, case_func_t, bool (*end_func) (void *), void *aux); -static void update_last_proc_invocation (void); +static void update_last_proc_invocation (struct dataset *ds); static void create_trns_case (struct ccase *, struct dictionary *); -static void open_active_file (void); +static void open_active_file (struct dataset *ds); static bool write_case (struct write_case_data *wc_data); -static void lag_case (const struct ccase *c); -static void clear_case (struct ccase *c); -static bool close_active_file (void); +static void lag_case (struct dataset *ds, const struct ccase *c); +static void clear_case (const struct dataset *ds, struct ccase *c); +static bool close_active_file (struct dataset *ds); /* Public functions. */ /* Returns the last time the data was read. */ time_t -time_of_last_procedure (void) +time_of_last_procedure (struct dataset *ds) { - if (last_proc_invocation == 0) - update_last_proc_invocation (); - return last_proc_invocation; + if (ds->last_proc_invocation == 0) + update_last_proc_invocation (ds); + return ds->last_proc_invocation; } /* Regular procedure. */ + + /* Reads the data from the input program and writes it to a new active file. For each case we read from the input program, we do the following: @@ -127,9 +135,9 @@ time_of_last_procedure (void) Returns true if successful, false if an I/O error occurred. */ bool -procedure (bool (*proc_func) (const struct ccase *, void *), void *aux) +procedure (struct dataset *ds, case_func_t cf, void *aux) { - return internal_procedure (proc_func, NULL, aux); + return internal_procedure (ds, cf, NULL, aux); } /* Multipass procedure. */ @@ -163,17 +171,16 @@ multipass_end_func (void *aux_data_) The entire active file is passed to PROC_FUNC, with the given AUX as auxiliary data, as a unit. */ bool -multipass_procedure (bool (*proc_func) (const struct casefile *, void *aux), - void *aux) +multipass_procedure (struct dataset *ds, casefile_func_t proc_func, void *aux) { struct multipass_aux_data aux_data; bool ok; - aux_data.casefile = fastfile_create (dict_get_next_value_idx (default_dict)); + aux_data.casefile = fastfile_create (dict_get_next_value_idx (ds->dict)); aux_data.proc_func = proc_func; aux_data.aux = aux; - ok = internal_procedure (multipass_case_func, multipass_end_func, &aux_data); + ok = internal_procedure (ds, multipass_case_func, multipass_end_func, &aux_data); ok = !casefile_error (aux_data.casefile) && ok; casefile_destroy (aux_data.casefile); @@ -183,48 +190,50 @@ multipass_procedure (bool (*proc_func) (const struct casefile *, void *aux), /* Procedure implementation. */ + /* Executes a procedure. Passes each case to CASE_FUNC. Calls END_FUNC after the last case. Returns true if successful, false if an I/O error occurred (or if CASE_FUNC or END_FUNC ever returned false). */ static bool -internal_procedure (bool (*case_func) (const struct ccase *, void *), +internal_procedure (struct dataset *ds, case_func_t case_func, bool (*end_func) (void *), void *aux) { struct write_case_data wc_data; bool ok = true; - assert (proc_source != NULL); + assert (ds->proc_source != NULL); - update_last_proc_invocation (); + update_last_proc_invocation (ds); /* Optimize the trivial case where we're not going to do anything with the data, by not reading the data at all. */ if (case_func == NULL && end_func == NULL - && case_source_is_class (proc_source, &storage_source_class) - && proc_sink == NULL - && (temporary_trns_chain == NULL - || trns_chain_is_empty (temporary_trns_chain)) - && trns_chain_is_empty (permanent_trns_chain)) + && case_source_is_class (ds->proc_source, &storage_source_class) + && ds->proc_sink == NULL + && (ds->temporary_trns_chain == NULL + || trns_chain_is_empty (ds->temporary_trns_chain)) + && trns_chain_is_empty (ds->permanent_trns_chain)) { - n_lag = 0; - dict_set_case_limit (default_dict, 0); - dict_clear_vectors (default_dict); + ds->n_lag = 0; + dict_set_case_limit (ds->dict, 0); + dict_clear_vectors (ds->dict); return true; } - open_active_file (); + open_active_file (ds); wc_data.case_func = case_func; wc_data.aux = aux; - create_trns_case (&wc_data.trns_case, default_dict); + wc_data.dataset = ds; + create_trns_case (&wc_data.trns_case, ds->dict); case_create (&wc_data.sink_case, - dict_get_compacted_value_cnt (default_dict)); + dict_get_compacted_value_cnt (ds->dict)); wc_data.cases_written = 0; - ok = proc_source->class->read (proc_source, + ok = ds->proc_source->class->read (ds->proc_source, &wc_data.trns_case, write_case, &wc_data) && ok; if (end_func != NULL) @@ -233,16 +242,16 @@ internal_procedure (bool (*case_func) (const struct ccase *, void *), case_destroy (&wc_data.sink_case); case_destroy (&wc_data.trns_case); - ok = close_active_file () && ok; + ok = close_active_file (ds) && ok; return ok; } /* Updates last_proc_invocation. */ static void -update_last_proc_invocation (void) +update_last_proc_invocation (struct dataset *ds) { - last_proc_invocation = time (NULL); + ds->last_proc_invocation = time (NULL); } /* Creates and returns a case, initializing it from the vectors @@ -270,40 +279,41 @@ create_trns_case (struct ccase *trns_case, struct dictionary *dict) /* Makes all preparations for reading from the data source and writing to the data sink. */ static void -open_active_file (void) +open_active_file (struct dataset *ds) { - add_case_limit_trns (); - add_filter_trns (); + add_case_limit_trns (ds); + add_filter_trns (ds); /* Finalize transformations. */ - trns_chain_finalize (cur_trns_chain); + trns_chain_finalize (ds->cur_trns_chain); /* Make permanent_dict refer to the dictionary right before data reaches the sink. */ - if (permanent_dict == NULL) - permanent_dict = default_dict; + if (ds->permanent_dict == NULL) + ds->permanent_dict = ds->dict; /* Figure out whether to compact. */ - compactor = (dict_compacting_would_shrink (permanent_dict) - ? dict_make_compactor (permanent_dict) - : NULL); + ds->compactor = + (dict_compacting_would_shrink (ds->permanent_dict) + ? dict_make_compactor (ds->permanent_dict) + : NULL); /* Prepare sink. */ - if (proc_sink == NULL) - proc_sink = create_case_sink (&storage_sink_class, permanent_dict, NULL); - if (proc_sink->class->open != NULL) - proc_sink->class->open (proc_sink); + if (ds->proc_sink == NULL) + ds->proc_sink = create_case_sink (&storage_sink_class, ds->permanent_dict, NULL); + if (ds->proc_sink->class->open != NULL) + ds->proc_sink->class->open (ds->proc_sink); /* Allocate memory for lag queue. */ - if (n_lag > 0) + if (ds->n_lag > 0) { int i; - lag_count = 0; - lag_head = 0; - lag_queue = xnmalloc (n_lag, sizeof *lag_queue); - for (i = 0; i < n_lag; i++) - case_nullify (&lag_queue[i]); + ds->lag_count = 0; + ds->lag_head = 0; + ds->lag_queue = xnmalloc (ds->n_lag, sizeof *ds->lag_queue); + for (i = 0; i < ds->n_lag; i++) + case_nullify (&ds->lag_queue[i]); } } @@ -316,36 +326,38 @@ write_case (struct write_case_data *wc_data) { enum trns_result retval; size_t case_nr; + + struct dataset *ds = wc_data->dataset; /* Execute permanent transformations. */ case_nr = wc_data->cases_written + 1; - retval = trns_chain_execute (permanent_trns_chain, + retval = trns_chain_execute (ds->permanent_trns_chain, &wc_data->trns_case, &case_nr); if (retval != TRNS_CONTINUE) goto done; /* Write case to LAG queue. */ - if (n_lag) - lag_case (&wc_data->trns_case); + if (ds->n_lag) + lag_case (ds, &wc_data->trns_case); /* Write case to replacement active file. */ wc_data->cases_written++; - if (proc_sink->class->write != NULL) + if (ds->proc_sink->class->write != NULL) { - if (compactor != NULL) + if (ds->compactor != NULL) { - dict_compactor_compact (compactor, &wc_data->sink_case, + dict_compactor_compact (ds->compactor, &wc_data->sink_case, &wc_data->trns_case); - proc_sink->class->write (proc_sink, &wc_data->sink_case); + ds->proc_sink->class->write (ds->proc_sink, &wc_data->sink_case); } else - proc_sink->class->write (proc_sink, &wc_data->trns_case); + ds->proc_sink->class->write (ds->proc_sink, &wc_data->trns_case); } /* Execute temporary transformations. */ - if (temporary_trns_chain != NULL) + if (ds->temporary_trns_chain != NULL) { - retval = trns_chain_execute (temporary_trns_chain, + retval = trns_chain_execute (ds->temporary_trns_chain, &wc_data->trns_case, &wc_data->cases_written); if (retval != TRNS_CONTINUE) @@ -358,33 +370,33 @@ write_case (struct write_case_data *wc_data) retval = TRNS_ERROR; done: - clear_case (&wc_data->trns_case); + clear_case (ds, &wc_data->trns_case); return retval != TRNS_ERROR; } /* Add C to the lag queue. */ static void -lag_case (const struct ccase *c) +lag_case (struct dataset *ds, const struct ccase *c) { - if (lag_count < n_lag) - lag_count++; - case_destroy (&lag_queue[lag_head]); - case_clone (&lag_queue[lag_head], c); - if (++lag_head >= n_lag) - lag_head = 0; + if (ds->lag_count < ds->n_lag) + ds->lag_count++; + case_destroy (&ds->lag_queue[ds->lag_head]); + case_clone (&ds->lag_queue[ds->lag_head], c); + if (++ds->lag_head >= ds->n_lag) + ds->lag_head = 0; } /* Clears the variables in C that need to be cleared between processing cases. */ static void -clear_case (struct ccase *c) +clear_case (const struct dataset *ds, struct ccase *c) { - size_t var_cnt = dict_get_var_cnt (default_dict); + size_t var_cnt = dict_get_var_cnt (ds->dict); size_t i; for (i = 0; i < var_cnt; i++) { - struct variable *v = dict_get_var (default_dict, i); + struct variable *v = dict_get_var (ds->dict, i); if (!v->leave) { if (v->type == NUMERIC) @@ -397,59 +409,59 @@ clear_case (struct ccase *c) /* Closes the active file. */ static bool -close_active_file (void) +close_active_file (struct dataset *ds) { /* Free memory for lag queue, and turn off lagging. */ - if (n_lag > 0) + if (ds->n_lag > 0) { int i; - for (i = 0; i < n_lag; i++) - case_destroy (&lag_queue[i]); - free (lag_queue); - n_lag = 0; + for (i = 0; i < ds->n_lag; i++) + case_destroy (&ds->lag_queue[i]); + free (ds->lag_queue); + ds->n_lag = 0; } /* Dictionary from before TEMPORARY becomes permanent. */ - proc_cancel_temporary_transformations (); + proc_cancel_temporary_transformations (ds); /* Finish compacting. */ - if (compactor != NULL) + if (ds->compactor != NULL) { - dict_compactor_destroy (compactor); - dict_compact_values (default_dict); - compactor = NULL; + dict_compactor_destroy (ds->compactor); + dict_compact_values (ds->dict); + ds->compactor = NULL; } /* Free data source. */ - free_case_source (proc_source); - proc_source = NULL; + free_case_source (ds->proc_source); + ds->proc_source = NULL; /* Old data sink becomes new data source. */ - if (proc_sink->class->make_source != NULL) - proc_source = proc_sink->class->make_source (proc_sink); - free_case_sink (proc_sink); - proc_sink = NULL; + if (ds->proc_sink->class->make_source != NULL) + ds->proc_source = ds->proc_sink->class->make_source (ds->proc_sink); + free_case_sink (ds->proc_sink); + ds->proc_sink = NULL; - dict_clear_vectors (default_dict); - permanent_dict = NULL; - return proc_cancel_all_transformations (); + dict_clear_vectors (ds->dict); + ds->permanent_dict = NULL; + return proc_cancel_all_transformations (ds); } /* Returns a pointer to the lagged case from N_BEFORE cases before the current one, or NULL if there haven't been that many cases yet. */ struct ccase * -lagged_case (int n_before) +lagged_case (const struct dataset *ds, int n_before) { assert (n_before >= 1 ); - assert (n_before <= n_lag); + assert (n_before <= ds->n_lag); - if (n_before <= lag_count) + if (n_before <= ds->lag_count) { - int index = lag_head - n_before; + int index = ds->lag_head - n_before; if (index < 0) - index += n_lag; - return &lag_queue[index]; + index += ds->n_lag; + return &ds->lag_queue[index]; } else return NULL; @@ -460,16 +472,17 @@ lagged_case (int n_before) /* Represents auxiliary data for handling SPLIT FILE. */ struct split_aux_data { + struct dataset *dataset; /* The dataset */ struct ccase prev_case; /* Data in previous case. */ /* Callback functions. */ - void (*begin_func) (const struct ccase *, void *); - bool (*proc_func) (const struct ccase *, void *); + begin_func_t begin_func ; + case_func_t proc_func ; void (*end_func) (void *); void *func_aux; }; -static int equal_splits (const struct ccase *, const struct ccase *); +static int equal_splits (const struct ccase *, const struct ccase *, const struct dataset *ds); static bool split_procedure_case_func (const struct ccase *c, void *); static bool split_procedure_end_func (void *); @@ -491,8 +504,9 @@ static bool split_procedure_end_func (void *); Returns true if successful, false if an I/O error occurred. */ bool -procedure_with_splits (void (*begin_func) (const struct ccase *, void *aux), - bool (*proc_func) (const struct ccase *, void *aux), +procedure_with_splits (struct dataset *ds, + begin_func_t begin_func, + case_func_t proc_func, void (*end_func) (void *aux), void *func_aux) { @@ -504,8 +518,9 @@ procedure_with_splits (void (*begin_func) (const struct ccase *, void *aux), split_aux.proc_func = proc_func; split_aux.end_func = end_func; split_aux.func_aux = func_aux; + split_aux.dataset = ds; - ok = internal_procedure (split_procedure_case_func, + ok = internal_procedure (ds, split_procedure_case_func, split_procedure_end_func, &split_aux); case_destroy (&split_aux.prev_case); @@ -521,7 +536,7 @@ split_procedure_case_func (const struct ccase *c, void *split_aux_) /* Start a new series if needed. */ if (case_is_null (&split_aux->prev_case) - || !equal_splits (c, &split_aux->prev_case)) + || !equal_splits (c, &split_aux->prev_case, split_aux->dataset)) { if (!case_is_null (&split_aux->prev_case) && split_aux->end_func != NULL) split_aux->end_func (split_aux->func_aux); @@ -531,6 +546,7 @@ split_procedure_case_func (const struct ccase *c, void *split_aux_) if (split_aux->begin_func != NULL) split_aux->begin_func (&split_aux->prev_case, split_aux->func_aux); + } return (split_aux->proc_func == NULL @@ -551,11 +567,12 @@ split_procedure_end_func (void *split_aux_) /* Compares the SPLIT FILE variables in cases A and B and returns nonzero only if they differ. */ static int -equal_splits (const struct ccase *a, const struct ccase *b) +equal_splits (const struct ccase *a, const struct ccase *b, + const struct dataset *ds) { return case_compare (a, b, - dict_get_split_vars (default_dict), - dict_get_split_cnt (default_dict)) == 0; + dict_get_split_vars (ds->dict), + dict_get_split_cnt (ds->dict)) == 0; } /* Multipass procedure that separates the data into SPLIT FILE @@ -565,6 +582,7 @@ equal_splits (const struct ccase *a, const struct ccase *b) multipass procedure. */ struct multipass_split_aux_data { + struct dataset *dataset; /* The dataset of the split */ struct ccase prev_case; /* Data in previous case. */ struct casefile *casefile; /* Accumulates data for a split. */ @@ -580,7 +598,8 @@ static bool multipass_split_output (struct multipass_split_aux_data *); /* Returns true if successful, false if an I/O error occurred. */ bool -multipass_procedure_with_splits (bool (*split_func) (const struct ccase *first, +multipass_procedure_with_splits (struct dataset *ds, + bool (*split_func) (const struct ccase *first, const struct casefile *, void *aux), void *func_aux) @@ -592,8 +611,9 @@ multipass_procedure_with_splits (bool (*split_func) (const struct ccase *first, aux.casefile = NULL; aux.split_func = split_func; aux.func_aux = func_aux; + aux.dataset = ds; - ok = internal_procedure (multipass_split_case_func, + ok = internal_procedure (ds, multipass_split_case_func, multipass_split_end_func, &aux); case_destroy (&aux.prev_case); @@ -605,10 +625,11 @@ static bool multipass_split_case_func (const struct ccase *c, void *aux_) { struct multipass_split_aux_data *aux = aux_; + struct dataset *ds = aux->dataset; bool ok = true; /* Start a new series if needed. */ - if (aux->casefile == NULL || !equal_splits (c, &aux->prev_case)) + if (aux->casefile == NULL || ! equal_splits (c, &aux->prev_case, ds)) { /* Record split values. */ case_destroy (&aux->prev_case); @@ -619,7 +640,8 @@ multipass_split_case_func (const struct ccase *c, void *aux_) ok = multipass_split_output (aux); /* Start a new casefile. */ - aux->casefile = fastfile_create (dict_get_next_value_idx (default_dict)); + aux->casefile = + fastfile_create (dict_get_next_value_idx (ds->dict)); } return casefile_append (aux->casefile, c) && ok; @@ -649,30 +671,30 @@ multipass_split_output (struct multipass_split_aux_data *aux) /* Discards all the current state in preparation for a data-input command like DATA LIST or GET. */ void -discard_variables (void) +discard_variables (struct dataset *ds) { - dict_clear (default_dict); + dict_clear (ds->dict); fh_set_default_handle (NULL); - n_lag = 0; + ds->n_lag = 0; - free_case_source (proc_source); - proc_source = NULL; + free_case_source (ds->proc_source); + ds->proc_source = NULL; - proc_cancel_all_transformations (); + proc_cancel_all_transformations (ds); } /* Returns the current set of permanent transformations, and clears the permanent transformations. For use by INPUT PROGRAM. */ struct trns_chain * -proc_capture_transformations (void) +proc_capture_transformations (struct dataset *ds) { struct trns_chain *chain; - assert (temporary_trns_chain == NULL); - chain = permanent_trns_chain; - cur_trns_chain = permanent_trns_chain = trns_chain_create (); + assert (ds->temporary_trns_chain == NULL); + chain = ds->permanent_trns_chain; + ds->cur_trns_chain = ds->permanent_trns_chain = trns_chain_create (); return chain; } @@ -680,9 +702,9 @@ proc_capture_transformations (void) frees itself with FREE to the current set of transformations. The functions are passed AUX as auxiliary data. */ void -add_transformation (trns_proc_func *proc, trns_free_func *free, void *aux) +add_transformation (struct dataset *ds, trns_proc_func *proc, trns_free_func *free, void *aux) { - trns_chain_append (cur_trns_chain, NULL, proc, free, aux); + trns_chain_append (ds->cur_trns_chain, NULL, proc, free, aux); } /* Adds a transformation that processes a case with PROC and @@ -691,44 +713,45 @@ add_transformation (trns_proc_func *proc, trns_free_func *free, void *aux) FINALIZE will be called. The functions are passed AUX as auxiliary data. */ void -add_transformation_with_finalizer (trns_finalize_func *finalize, +add_transformation_with_finalizer (struct dataset *ds, + trns_finalize_func *finalize, trns_proc_func *proc, trns_free_func *free, void *aux) { - trns_chain_append (cur_trns_chain, finalize, proc, free, aux); + trns_chain_append (ds->cur_trns_chain, finalize, proc, free, aux); } /* Returns the index of the next transformation. This value can be returned by a transformation procedure function to indicate a "jump" to that transformation. */ size_t -next_transformation (void) +next_transformation (const struct dataset *ds) { - return trns_chain_next (cur_trns_chain); + return trns_chain_next (ds->cur_trns_chain); } /* Returns true if the next call to add_transformation() will add a temporary transformation, false if it will add a permanent transformation. */ bool -proc_in_temporary_transformations (void) +proc_in_temporary_transformations (const struct dataset *ds) { - return temporary_trns_chain != NULL; + return ds->temporary_trns_chain != NULL; } /* Marks the start of temporary transformations. Further calls to add_transformation() will add temporary transformations. */ void -proc_start_temporary_transformations (void) +proc_start_temporary_transformations (struct dataset *ds) { - if (!proc_in_temporary_transformations ()) + if (!proc_in_temporary_transformations (ds)) { - add_case_limit_trns (); + add_case_limit_trns (ds); - permanent_dict = dict_clone (default_dict); - trns_chain_finalize (permanent_trns_chain); - temporary_trns_chain = cur_trns_chain = trns_chain_create (); + ds->permanent_dict = dict_clone (ds->dict); + trns_chain_finalize (ds->permanent_trns_chain); + ds->temporary_trns_chain = ds->cur_trns_chain = trns_chain_create (); } } @@ -737,16 +760,16 @@ proc_start_temporary_transformations (void) permanent. Returns true if anything changed, false otherwise. */ bool -proc_make_temporary_transformations_permanent (void) +proc_make_temporary_transformations_permanent (struct dataset *ds) { - if (proc_in_temporary_transformations ()) + if (proc_in_temporary_transformations (ds)) { - trns_chain_finalize (temporary_trns_chain); - trns_chain_splice (permanent_trns_chain, temporary_trns_chain); - temporary_trns_chain = NULL; + trns_chain_finalize (ds->temporary_trns_chain); + trns_chain_splice (ds->permanent_trns_chain, ds->temporary_trns_chain); + ds->temporary_trns_chain = NULL; - dict_destroy (permanent_dict); - permanent_dict = NULL; + dict_destroy (ds->permanent_dict); + ds->permanent_dict = NULL; return true; } @@ -758,16 +781,16 @@ proc_make_temporary_transformations_permanent (void) transformations will be permanent. Returns true if anything changed, false otherwise. */ bool -proc_cancel_temporary_transformations (void) +proc_cancel_temporary_transformations (struct dataset *ds) { - if (proc_in_temporary_transformations ()) + if (proc_in_temporary_transformations (ds)) { - dict_destroy (default_dict); - default_dict = permanent_dict; - permanent_dict = NULL; + dict_destroy (ds->dict); + ds->dict = ds->permanent_dict; + ds->permanent_dict = NULL; - trns_chain_destroy (temporary_trns_chain); - temporary_trns_chain = NULL; + trns_chain_destroy (ds->temporary_trns_chain); + ds->temporary_trns_chain = NULL; return true; } @@ -778,56 +801,59 @@ proc_cancel_temporary_transformations (void) /* Cancels all transformations, if any. Returns true if successful, false on I/O error. */ bool -proc_cancel_all_transformations (void) +proc_cancel_all_transformations (struct dataset *ds) { bool ok; - ok = trns_chain_destroy (permanent_trns_chain); - ok = trns_chain_destroy (temporary_trns_chain) && ok; - permanent_trns_chain = cur_trns_chain = trns_chain_create (); - temporary_trns_chain = NULL; + ok = trns_chain_destroy (ds->permanent_trns_chain); + ok = trns_chain_destroy (ds->temporary_trns_chain) && ok; + ds->permanent_trns_chain = ds->cur_trns_chain = trns_chain_create (); + ds->temporary_trns_chain = NULL; return ok; } /* Initializes procedure handling. */ -void -proc_init (void) +struct dataset * +create_dataset (void) { - default_dict = dict_create (); - proc_cancel_all_transformations (); + struct dataset *ds = xzalloc (sizeof(*ds)); + ds->dict = dict_create (); + proc_cancel_all_transformations (ds); + return ds; } /* Finishes up procedure handling. */ void -proc_done (void) +destroy_dataset (struct dataset *ds) { - discard_variables (); - dict_destroy (default_dict); + discard_variables (ds); + dict_destroy (ds->dict); + free (ds); } /* Sets SINK as the destination for procedure output from the next procedure. */ void -proc_set_sink (struct case_sink *sink) +proc_set_sink (struct dataset *ds, struct case_sink *sink) { - assert (proc_sink == NULL); - proc_sink = sink; + assert (ds->proc_sink == NULL); + ds->proc_sink = sink; } /* Sets SOURCE as the source for procedure input for the next procedure. */ void -proc_set_source (struct case_source *source) +proc_set_source (struct dataset *ds, struct case_source *source) { - assert (proc_source == NULL); - proc_source = source; + assert (ds->proc_source == NULL); + ds->proc_source = source; } /* Returns true if a source for the next procedure has been configured, false otherwise. */ bool -proc_has_source (void) +proc_has_source (const struct dataset *ds) { - return proc_source != NULL; + return ds->proc_source != NULL; } /* Returns the output from the previous procedure. @@ -835,19 +861,19 @@ proc_has_source (void) The returned casefile is owned by the caller; it will not be automatically used for the next procedure's input. */ struct casefile * -proc_capture_output (void) +proc_capture_output (struct dataset *ds) { struct casefile *casefile; /* Try to make sure that this function is called immediately after procedure() or a similar function. */ - assert (proc_source != NULL); - assert (case_source_is_class (proc_source, &storage_source_class)); - assert (trns_chain_is_empty (permanent_trns_chain)); - assert (!proc_in_temporary_transformations ()); + assert (ds->proc_source != NULL); + assert (case_source_is_class (ds->proc_source, &storage_source_class)); + assert (trns_chain_is_empty (ds->permanent_trns_chain)); + assert (!proc_in_temporary_transformations (ds)); - casefile = storage_source_decapsulate (proc_source); - proc_source = NULL; + casefile = storage_source_decapsulate (ds->proc_source); + ds->proc_source = NULL; return casefile; } @@ -856,18 +882,18 @@ static trns_proc_func case_limit_trns_proc; static trns_free_func case_limit_trns_free; /* Adds a transformation that limits the number of cases that may - pass through, if default_dict has a case limit. */ + pass through, if DS->DICT has a case limit. */ static void -add_case_limit_trns (void) +add_case_limit_trns (struct dataset *ds) { - size_t case_limit = dict_get_case_limit (default_dict); + size_t case_limit = dict_get_case_limit (ds->dict); if (case_limit != 0) { size_t *cases_remaining = xmalloc (sizeof *cases_remaining); *cases_remaining = case_limit; - add_transformation (case_limit_trns_proc, case_limit_trns_free, + add_transformation (ds, case_limit_trns_proc, case_limit_trns_free, cases_remaining); - dict_set_case_limit (default_dict, 0); + dict_set_case_limit (ds->dict, 0); } } @@ -901,13 +927,13 @@ static trns_proc_func filter_trns_proc; /* Adds a temporary transformation to filter data according to the variable specified on FILTER, if any. */ static void -add_filter_trns (void) +add_filter_trns (struct dataset *ds) { - struct variable *filter_var = dict_get_filter (default_dict); + struct variable *filter_var = dict_get_filter (ds->dict); if (filter_var != NULL) { - proc_start_temporary_transformations (); - add_transformation (filter_trns_proc, NULL, filter_var); + proc_start_temporary_transformations (ds); + add_transformation (ds, filter_trns_proc, NULL, filter_var); } } @@ -923,3 +949,30 @@ filter_trns_proc (void *filter_var_, ? TRNS_CONTINUE : TRNS_DROP_CASE); } + +struct dictionary * +dataset_dict (const struct dataset *ds) +{ + return ds->dict; +} + + +void +dataset_set_dict (struct dataset *ds, struct dictionary *dict) +{ + ds->dict = dict; +} + +int +dataset_n_lag (const struct dataset *ds) +{ + return ds->n_lag; +} + +void +dataset_set_n_lag (struct dataset *ds, int n_lag) +{ + ds->n_lag = n_lag; +} + + diff --git a/src/data/procedure.h b/src/data/procedure.h index 35678ce6..60e1e77f 100644 --- a/src/data/procedure.h +++ b/src/data/procedure.h @@ -31,60 +31,80 @@ struct casefile; struct case_sink; struct case_source; -/* Dictionary produced by permanent and temporary transformations - on data from the source. */ -extern struct dictionary *default_dict; +struct dataset; + /* Transformations. */ -void add_transformation (trns_proc_func *, trns_free_func *, void *); -void add_transformation_with_finalizer (trns_finalize_func *, +void add_transformation (struct dataset *ds, + trns_proc_func *, trns_free_func *, void *); +void add_transformation_with_finalizer (struct dataset *ds, + trns_finalize_func *, trns_proc_func *, trns_free_func *, void *); -size_t next_transformation (void); +size_t next_transformation (const struct dataset *ds); + +void discard_variables (struct dataset *ds); -void discard_variables (void); -bool proc_cancel_all_transformations (void); -struct trns_chain *proc_capture_transformations (void); -void proc_start_temporary_transformations (void); -bool proc_in_temporary_transformations (void); -bool proc_make_temporary_transformations_permanent (void); -bool proc_cancel_temporary_transformations (void); +bool proc_cancel_all_transformations (struct dataset *ds); +struct trns_chain *proc_capture_transformations (struct dataset *ds); + +void proc_start_temporary_transformations (struct dataset *ds); +bool proc_in_temporary_transformations (const struct dataset *ds); +bool proc_make_temporary_transformations_permanent (struct dataset *ds); +bool proc_cancel_temporary_transformations (struct dataset *ds); /* Procedures. */ -void proc_init (void); -void proc_done (void); -void proc_set_source (struct case_source *); -bool proc_has_source (void); +struct dataset *create_dataset (void); +void destroy_dataset (struct dataset *); -void proc_set_sink (struct case_sink *); -struct casefile *proc_capture_output (void); +void proc_set_source (struct dataset *ds, struct case_source *); +bool proc_has_source (const struct dataset *ds); -bool procedure (bool (*proc_func) (const struct ccase *, void *), - void *aux) - WARN_UNUSED_RESULT; -bool procedure_with_splits (void (*begin_func) (const struct ccase *, void *), - bool (*proc_func) (const struct ccase *, void *), +void proc_set_sink (struct dataset *ds, struct case_sink *); +struct casefile *proc_capture_output (struct dataset *ds); + +typedef bool (*casefile_func_t) (const struct casefile *, void *); +typedef bool (*case_func_t) (const struct ccase *, void *); +typedef void (*begin_func_t) (const struct ccase *, void *); + + + +bool procedure (struct dataset *ds, case_func_t, void *aux) WARN_UNUSED_RESULT; + +bool procedure_with_splits (struct dataset *ds, + begin_func_t begin_func, + case_func_t proc_func, void (*end_func) (void *), void *aux) WARN_UNUSED_RESULT; -bool multipass_procedure (bool (*proc_func) (const struct casefile *, void *), - void *aux) +bool multipass_procedure (struct dataset *ds, casefile_func_t, void *aux) WARN_UNUSED_RESULT; -bool multipass_procedure_with_splits (bool (*) (const struct ccase *, - const struct casefile *, - void *), - void *aux) +bool multipass_procedure_with_splits (struct dataset *ds, + bool (*) (const struct ccase *, + const struct casefile *, + void *), + void *aux) WARN_UNUSED_RESULT; -time_t time_of_last_procedure (void); + + + +time_t time_of_last_procedure (struct dataset *ds); -/* Number of cases to lag. */ -extern int n_lag; -struct ccase *lagged_case (int n_before); +struct ccase *lagged_case (const struct dataset *ds, int n_before); + +extern struct dataset *current_dataset; + +inline struct dictionary *dataset_dict (const struct dataset *ds); +inline void dataset_set_dict ( struct dataset *ds, struct dictionary *dict); + +inline int dataset_n_lag (const struct dataset *ds); +inline void dataset_set_n_lag (struct dataset *ds, int n_lag); + #endif /* procedure.h */ diff --git a/src/language/command.c b/src/language/command.c index ae16d9bb..4ca3da9a 100644 --- a/src/language/command.c +++ b/src/language/command.c @@ -148,7 +148,7 @@ cmd_parse (enum cmd_state state) lex_discard_rest_of_command (); unset_cmd_algorithm (); - dict_clear_aux (default_dict); + dict_clear_aux (dataset_dict (current_dataset)); return result; } @@ -666,7 +666,7 @@ cmd_n_of_cases (void) x = lex_integer (); lex_get (); if (!lex_match_id ("ESTIMATED")) - dict_set_case_limit (default_dict, x); + dict_set_case_limit (dataset_dict (current_dataset), x); return lex_end_of_command (); } @@ -675,7 +675,7 @@ cmd_n_of_cases (void) int cmd_execute (void) { - if (!procedure (NULL, NULL)) + if (!procedure (current_dataset,NULL, NULL)) return CMD_CASCADING_FAILURE; return lex_end_of_command (); } @@ -850,7 +850,7 @@ cmd_host (void) int cmd_new_file (void) { - discard_variables (); + discard_variables (current_dataset); return lex_end_of_command (); } diff --git a/src/language/control/do-if.c b/src/language/control/do-if.c index a0bbf793..b39f67e5 100644 --- a/src/language/control/do-if.c +++ b/src/language/control/do-if.c @@ -104,7 +104,7 @@ cmd_do_if (void) do_if->clause_cnt = 0; ctl_stack_push (&do_if_class, do_if); - add_transformation_with_finalizer (do_if_finalize_func, + add_transformation_with_finalizer (current_dataset, do_if_finalize_func, do_if_trns_proc, do_if_trns_free, do_if); return parse_clause (do_if); @@ -153,7 +153,7 @@ close_do_if (void *do_if_) if (!has_else (do_if)) add_else (do_if); - do_if->past_END_IF_index = next_transformation (); + do_if->past_END_IF_index = next_transformation (current_dataset); } /* Adds an ELSE clause to DO_IF pointing to the next @@ -162,7 +162,7 @@ static void add_else (struct do_if_trns *do_if) { assert (!has_else (do_if)); - add_clause (do_if, NULL, next_transformation ()); + add_clause (do_if, NULL, next_transformation (current_dataset)); } /* Returns true if DO_IF does not yet have an ELSE clause. @@ -196,11 +196,11 @@ parse_clause (struct do_if_trns *do_if) { struct expression *condition; - condition = expr_parse (default_dict, EXPR_BOOLEAN); + condition = expr_parse (dataset_dict (current_dataset), EXPR_BOOLEAN); if (condition == NULL) return CMD_CASCADING_FAILURE; - add_clause (do_if, condition, next_transformation ()); + add_clause (do_if, condition, next_transformation (current_dataset)); return lex_end_of_command (); } @@ -214,7 +214,7 @@ add_clause (struct do_if_trns *do_if, struct clause *clause; if (do_if->clause_cnt > 0) - add_transformation (break_trns_proc, NULL, do_if); + add_transformation (current_dataset, break_trns_proc, NULL, do_if); do_if->clauses = xnrealloc (do_if->clauses, do_if->clause_cnt + 1, sizeof *do_if->clauses); diff --git a/src/language/control/loop.c b/src/language/control/loop.c index 242c936a..1bb044e6 100644 --- a/src/language/control/loop.c +++ b/src/language/control/loop.c @@ -112,9 +112,9 @@ cmd_loop (void) /* Find index variable and create if necessary. */ if (ok && index_var_name[0] != '\0') { - loop->index_var = dict_lookup_var (default_dict, index_var_name); + loop->index_var = dict_lookup_var (dataset_dict (current_dataset), index_var_name); if (loop->index_var == NULL) - loop->index_var = dict_create_var (default_dict, index_var_name, 0); + loop->index_var = dict_create_var (dataset_dict (current_dataset), index_var_name, 0); } if (!ok) @@ -155,7 +155,7 @@ cmd_break (void) if (loop == NULL) return CMD_CASCADING_FAILURE; - add_transformation (break_trns_proc, NULL, loop); + add_transformation (current_dataset, break_trns_proc, NULL, loop); return lex_end_of_command (); } @@ -167,8 +167,8 @@ close_loop (void *loop_) { struct loop_trns *loop = loop_; - add_transformation (end_loop_trns_proc, NULL, loop); - loop->past_END_LOOP_index = next_transformation (); + add_transformation (current_dataset, end_loop_trns_proc, NULL, loop); + loop->past_END_LOOP_index = next_transformation (current_dataset); /* If there's nothing else limiting the number of loops, use MXLOOPS as a limit. */ @@ -185,7 +185,7 @@ close_loop (void *loop_) static bool parse_if_clause (struct loop_trns *loop, struct expression **condition) { - *condition = expr_parse_pool (loop->pool, default_dict, EXPR_BOOLEAN); + *condition = expr_parse_pool (loop->pool, dataset_dict (current_dataset), EXPR_BOOLEAN); return *condition != NULL; } @@ -206,7 +206,7 @@ parse_index_clause (struct loop_trns *loop, char index_var_name[]) if (!lex_force_match ('=')) return false; - loop->first_expr = expr_parse_pool (loop->pool, default_dict, EXPR_NUMBER); + loop->first_expr = expr_parse_pool (loop->pool, dataset_dict (current_dataset), EXPR_NUMBER); if (loop->first_expr == NULL) return false; @@ -225,7 +225,7 @@ parse_index_clause (struct loop_trns *loop, char index_var_name[]) lex_sbc_only_once (e == &loop->last_expr ? "TO" : "BY"); return false; } - *e = expr_parse_pool (loop->pool, default_dict, EXPR_NUMBER); + *e = expr_parse_pool (loop->pool, dataset_dict (current_dataset), EXPR_NUMBER); if (*e == NULL) return false; } @@ -251,9 +251,9 @@ create_loop_trns (void) loop->first_expr = loop->by_expr = loop->last_expr = NULL; loop->loop_condition = loop->end_loop_condition = NULL; - add_transformation_with_finalizer (loop_trns_finalize, + add_transformation_with_finalizer (current_dataset, loop_trns_finalize, loop_trns_proc, loop_trns_free, loop); - loop->past_LOOP_index = next_transformation (); + loop->past_LOOP_index = next_transformation (current_dataset); ctl_stack_push (&loop_class, loop); diff --git a/src/language/control/repeat.c b/src/language/control/repeat.c index 42481dfa..0b4607ff 100644 --- a/src/language/control/repeat.c +++ b/src/language/control/repeat.c @@ -137,7 +137,7 @@ parse_specification (struct repeat_block *block) /* Get a stand-in variable name and make sure it's unique. */ if (!lex_force_id ()) return false; - if (dict_lookup_var (default_dict, tokid)) + if (dict_lookup_var (dataset_dict (current_dataset), tokid)) msg (SW, _("Dummy variable name \"%s\" hides dictionary " "variable \"%s\"."), tokid, tokid); @@ -331,7 +331,7 @@ create_vars (struct repeat_block *block) { /* Ignore return value: if the variable already exists there is no harm done. */ - dict_create_var (default_dict, iter->replacement[i], 0); + dict_create_var (dataset_dict (current_dataset), iter->replacement[i], 0); } } } diff --git a/src/language/control/temporary.c b/src/language/control/temporary.c index 6cfd48ec..810ed519 100644 --- a/src/language/control/temporary.c +++ b/src/language/control/temporary.c @@ -43,8 +43,8 @@ int cmd_temporary (void) { - if (!proc_in_temporary_transformations ()) - proc_start_temporary_transformations (); + if (!proc_in_temporary_transformations (current_dataset)) + proc_start_temporary_transformations (current_dataset); else msg (SE, _("This command may only appear once between " "procedures and procedure-like commands.")); diff --git a/src/language/data-io/data-list.c b/src/language/data-io/data-list.c index 39bd743e..8012d888 100644 --- a/src/language/data-io/data-list.c +++ b/src/language/data-io/data-list.c @@ -123,7 +123,7 @@ cmd_data_list (void) bool ok; if (!in_input_program ()) - discard_variables (); + discard_variables (current_dataset); dls = pool_create_container (struct data_list_pgm, pool); ll_init (&dls->specs); @@ -166,9 +166,9 @@ cmd_data_list (void) lex_match ('='); if (!lex_force_id ()) goto error; - dls->end = dict_lookup_var (default_dict, tokid); + dls->end = dict_lookup_var (dataset_dict (current_dataset), tokid); if (!dls->end) - dls->end = dict_create_var_assert (default_dict, tokid, 0); + dls->end = dict_create_var_assert (dataset_dict (current_dataset), tokid, 0); lex_get (); } else if (token == T_ID) @@ -262,9 +262,10 @@ cmd_data_list (void) goto error; if (in_input_program ()) - add_transformation (data_list_trns_proc, data_list_trns_free, dls); + add_transformation (current_dataset, data_list_trns_proc, data_list_trns_free, dls); else - proc_set_source (create_case_source (&data_list_source_class, dls)); + proc_set_source (current_dataset, + create_case_source (&data_list_source_class, dls)); pool_destroy (tmp_pool); @@ -315,7 +316,7 @@ parse_fixed (struct pool *tmp_pool, struct data_list_pgm *dls) /* Create variable. */ width = get_format_var_width (f); - v = dict_create_var (default_dict, name, width); + v = dict_create_var (dataset_dict (current_dataset), name, width); if (v != NULL) { /* Success. */ @@ -337,7 +338,7 @@ parse_fixed (struct pool *tmp_pool, struct data_list_pgm *dls) return false; } - v = dict_lookup_var_assert (default_dict, name); + v = dict_lookup_var_assert (dataset_dict (current_dataset), name); if ((width != 0) != (v->width != 0)) { msg (SE, _("There is already a variable %s of a " @@ -464,7 +465,7 @@ parse_free (struct pool *tmp_pool, struct data_list_pgm *dls) struct dls_var_spec *spec; struct variable *v; - v = dict_create_var (default_dict, name[i], + v = dict_create_var (dataset_dict (current_dataset), name[i], get_format_var_width (&input)); if (v == NULL) { diff --git a/src/language/data-io/data-reader.c b/src/language/data-io/data-reader.c index 1899acfb..31932af9 100644 --- a/src/language/data-io/data-reader.c +++ b/src/language/data-io/data-reader.c @@ -441,7 +441,7 @@ cmd_begin_data (void) /* Input procedure reads from inline file. */ getl_set_prompt_style (GETL_PROMPT_DATA); - ok = procedure (NULL, NULL); + ok = procedure (current_dataset,NULL, NULL); dfm_close_reader (r); diff --git a/src/language/data-io/get.c b/src/language/data-io/get.c index 2bb46311..663d2fc1 100644 --- a/src/language/data-io/get.c +++ b/src/language/data-io/get.c @@ -127,7 +127,7 @@ parse_read_command (enum reader_command type) goto error; } - discard_variables (); + discard_variables (current_dataset); pgm = xmalloc (sizeof *pgm); pgm->reader = any_reader_open (fh, &dict); @@ -149,10 +149,11 @@ parse_read_command (enum reader_command type) pgm->map = finish_case_map (dict); - dict_destroy (default_dict); - default_dict = dict; + dict_destroy (dataset_dict (current_dataset)); + dataset_set_dict (current_dataset, dict); - proc_set_source (create_case_source (&case_reader_source_class, pgm)); + proc_set_source (current_dataset, + create_case_source (&case_reader_source_class, pgm)); return CMD_SUCCESS; @@ -312,7 +313,7 @@ parse_write_command (enum writer_type writer_type, *retain_unselected = true; handle = NULL; - dict = dict_clone (default_dict); + dict = dict_clone (dataset_dict (current_dataset)); aw = xmalloc (sizeof *aw); aw->writer = NULL; aw->map = NULL; @@ -483,11 +484,11 @@ parse_output_proc (enum writer_type writer_type) if (aw == NULL) return CMD_CASCADING_FAILURE; - saved_filter_variable = dict_get_filter (default_dict); + saved_filter_variable = dict_get_filter (dataset_dict (current_dataset)); if (retain_unselected) - dict_set_filter (default_dict, NULL); - ok = procedure (output_proc, aw); - dict_set_filter (default_dict, saved_filter_variable); + dict_set_filter (dataset_dict (current_dataset), NULL); + ok = procedure (current_dataset,output_proc, aw); + dict_set_filter (dataset_dict (current_dataset), saved_filter_variable); case_writer_destroy (aw); return ok ? CMD_SUCCESS : CMD_CASCADING_FAILURE; @@ -536,7 +537,7 @@ parse_output_trns (enum writer_type writer_type) return CMD_CASCADING_FAILURE; } - add_transformation (output_trns_proc, output_trns_free, t); + add_transformation (current_dataset, output_trns_proc, output_trns_free, t); return CMD_SUCCESS; } @@ -829,7 +830,7 @@ cmd_match_files (void) case_nullify (&mtf.mtf_case); mtf.seq_num = 0; mtf.seq_nums = NULL; - dict_set_case_limit (mtf.dict, dict_get_case_limit (default_dict)); + dict_set_case_limit (mtf.dict, dict_get_case_limit (dataset_dict (current_dataset))); lex_match ('/'); while (token == T_ID @@ -894,20 +895,20 @@ cmd_match_files (void) } used_active_file = true; - if (!proc_has_source ()) + if (!proc_has_source (current_dataset)) { msg (SE, _("Cannot specify the active file since no active " "file has been defined.")); goto error; } - if (proc_make_temporary_transformations_permanent ()) + if (proc_make_temporary_transformations_permanent (current_dataset)) msg (SE, _("MATCH FILES may not be used after TEMPORARY when " "the active file is an input source. " "Temporary transformations will be made permanent.")); - file->dict = default_dict; + file->dict = dataset_dict (current_dataset); } else { @@ -1124,7 +1125,7 @@ cmd_match_files (void) values. */ if (!used_active_file) - discard_variables (); + discard_variables (current_dataset); dict_compact_values (mtf.dict); mtf.output = fastfile_create (dict_get_next_value_idx (mtf.dict)); @@ -1136,18 +1137,20 @@ cmd_match_files (void) if (used_active_file) { - proc_set_sink (create_case_sink (&null_sink_class, default_dict, NULL)); - ok = procedure (mtf_processing, &mtf) && mtf_processing_finish (&mtf); + proc_set_sink (current_dataset, + create_case_sink (&null_sink_class, + dataset_dict (current_dataset), NULL)); + ok = procedure (current_dataset,mtf_processing, &mtf) && mtf_processing_finish (&mtf); } else ok = mtf_processing_finish (&mtf); - discard_variables (); + discard_variables (current_dataset); - dict_destroy (default_dict); - default_dict = mtf.dict; + dict_destroy (dataset_dict (current_dataset)); + dataset_set_dict (current_dataset, mtf.dict); mtf.dict = NULL; - proc_set_source (storage_source_create (mtf.output)); + proc_set_source (current_dataset, storage_source_create (mtf.output)); mtf.output = NULL; if (!mtf_free (&mtf)) diff --git a/src/language/data-io/inpt-pgm.c b/src/language/data-io/inpt-pgm.c index 11b63319..668ede87 100644 --- a/src/language/data-io/inpt-pgm.c +++ b/src/language/data-io/inpt-pgm.c @@ -99,7 +99,7 @@ in_input_program (void) static void emit_END_CASE (struct input_program_pgm *inp) { - add_transformation (end_case_trns_proc, NULL, inp); + add_transformation (current_dataset, end_case_trns_proc, NULL, inp); } int @@ -109,7 +109,7 @@ cmd_input_program (void) size_t i; bool saw_END_CASE = false; - discard_variables (); + discard_variables (current_dataset); if (token != '.') return lex_end_of_command (); @@ -133,7 +133,7 @@ cmd_input_program (void) if (result == CMD_EOF) msg (SE, _("Unexpected end-of-file within INPUT PROGRAM.")); inside_input_program = false; - discard_variables (); + discard_variables (current_dataset); destroy_input_program (inp); return result; } @@ -142,25 +142,25 @@ cmd_input_program (void) emit_END_CASE (inp); inside_input_program = false; - if (dict_get_next_value_idx (default_dict) == 0) + if (dict_get_next_value_idx (dataset_dict (current_dataset)) == 0) { msg (SE, _("Input program did not create any variables.")); - discard_variables (); + discard_variables (current_dataset); destroy_input_program (inp); return CMD_FAILURE; } - inp->trns_chain = proc_capture_transformations (); + inp->trns_chain = proc_capture_transformations (current_dataset); trns_chain_finalize (inp->trns_chain); /* Figure out how to initialize each input case. */ - inp->init_cnt = dict_get_next_value_idx (default_dict); + inp->init_cnt = dict_get_next_value_idx (dataset_dict (current_dataset)); inp->init = xnmalloc (inp->init_cnt, sizeof *inp->init); for (i = 0; i < inp->init_cnt; i++) inp->init[i] = -1; - for (i = 0; i < dict_get_var_cnt (default_dict); i++) + for (i = 0; i < dict_get_var_cnt (dataset_dict (current_dataset)); i++) { - struct variable *var = dict_get_var (default_dict, i); + struct variable *var = dict_get_var (dataset_dict (current_dataset), i); enum value_init_type value_init; size_t j; @@ -172,9 +172,10 @@ cmd_input_program (void) } for (i = 0; i < inp->init_cnt; i++) assert (inp->init[i] != -1); - inp->case_size = dict_get_case_size (default_dict); + inp->case_size = dict_get_case_size (dataset_dict (current_dataset)); - proc_set_source (create_case_source (&input_program_source_class, inp)); + proc_set_source (current_dataset, + create_case_source (&input_program_source_class, inp)); return CMD_SUCCESS; } @@ -339,7 +340,7 @@ cmd_reread (void) return CMD_CASCADING_FAILURE; } - e = expr_parse (default_dict, EXPR_NUMBER); + e = expr_parse (dataset_dict (current_dataset), EXPR_NUMBER); if (!e) return CMD_CASCADING_FAILURE; } @@ -363,7 +364,7 @@ cmd_reread (void) t = xmalloc (sizeof *t); t->reader = dfm_open_reader (fh); t->column = e; - add_transformation (reread_trns_proc, reread_trns_free, t); + add_transformation (current_dataset, reread_trns_proc, reread_trns_free, t); return CMD_SUCCESS; } @@ -408,7 +409,7 @@ cmd_end_file (void) { assert (in_input_program ()); - add_transformation (end_file_trns_proc, NULL, NULL); + add_transformation (current_dataset, end_file_trns_proc, NULL, NULL); return lex_end_of_command (); } diff --git a/src/language/data-io/list.q b/src/language/data-io/list.q index 51623aac..54b09c34 100644 --- a/src/language/data-io/list.q +++ b/src/language/data-io/list.q @@ -145,7 +145,7 @@ cmd_list (void) if (cmd.last == NOT_LONG) cmd.last = LONG_MAX; if (!cmd.sbc_variables) - dict_get_vars (default_dict, &cmd.v_variables, &cmd.n_variables, + dict_get_vars (dataset_dict (current_dataset), &cmd.v_variables, &cmd.n_variables, (1u << DC_SYSTEM) | (1u << DC_SCRATCH)); if (cmd.n_variables == 0) { @@ -185,12 +185,12 @@ cmd_list (void) /* Weighting variable. */ if (cmd.weight == LST_WEIGHT) { - if (dict_get_weight (default_dict) != NULL) + if (dict_get_weight (dataset_dict (current_dataset)) != NULL) { size_t i; for (i = 0; i < cmd.n_variables; i++) - if (cmd.v_variables[i] == dict_get_weight (default_dict)) + if (cmd.v_variables[i] == dict_get_weight (dataset_dict (current_dataset))) break; if (i >= cmd.n_variables) { @@ -199,7 +199,7 @@ cmd_list (void) cmd.v_variables = xnrealloc (cmd.v_variables, cmd.n_variables, sizeof *cmd.v_variables); cmd.v_variables[cmd.n_variables - 1] - = dict_get_weight (default_dict); + = dict_get_weight (dataset_dict (current_dataset)); } } else @@ -229,7 +229,7 @@ cmd_list (void) determine_layout (); case_idx = 0; - ok = procedure_with_splits (write_all_headers, list_cases, NULL, NULL); + ok = procedure_with_splits (current_dataset, write_all_headers, list_cases, NULL, NULL); ds_destroy(&line_buffer); clean_up (); diff --git a/src/language/data-io/matrix-data.c b/src/language/data-io/matrix-data.c index 401360de..99664fc6 100644 --- a/src/language/data-io/matrix-data.c +++ b/src/language/data-io/matrix-data.c @@ -152,7 +152,7 @@ struct matrix_data_pgm /* Continuous variables. */ int n_continuous; /* Number of continuous variables. */ - int first_continuous; /* Index into default_dict.var of + int first_continuous; /* Index into dataset_dict (current_dataset).var of first continuous variable. */ }; @@ -183,7 +183,7 @@ cmd_matrix_data (void) unsigned seen = 0; - discard_variables (); + discard_variables (current_dataset); pool = pool_create (); mx = pool_alloc (pool, sizeof *mx); @@ -248,7 +248,7 @@ cmd_matrix_data (void) if (strcasecmp (v[i], "ROWTYPE_")) { - new_var = dict_create_var_assert (default_dict, v[i], 0); + new_var = dict_create_var_assert (dataset_dict (current_dataset), v[i], 0); attach_mxd_aux (new_var, MXD_CONTINUOUS, i); } else @@ -258,7 +258,7 @@ cmd_matrix_data (void) free (v); } - mx->rowtype_ = dict_create_var_assert (default_dict, + mx->rowtype_ = dict_create_var_assert (dataset_dict (current_dataset), "ROWTYPE_", 8); attach_mxd_aux (mx->rowtype_, MXD_ROWTYPE, 0); } @@ -313,7 +313,7 @@ cmd_matrix_data (void) goto lossage; } - if (dict_lookup_var (default_dict, tokid) == NULL + if (dict_lookup_var (dataset_dict (current_dataset), tokid) == NULL && (lex_look_ahead () == '.' || lex_look_ahead () == '/')) { if (!strcasecmp (tokid, "ROWTYPE_") @@ -324,27 +324,27 @@ cmd_matrix_data (void) goto lossage; } - mx->single_split = dict_create_var_assert (default_dict, + mx->single_split = dict_create_var_assert (dataset_dict (current_dataset), tokid, 0); attach_mxd_aux (mx->single_split, MXD_CONTINUOUS, 0); lex_get (); - dict_set_split_vars (default_dict, &mx->single_split, 1); + dict_set_split_vars (dataset_dict (current_dataset), &mx->single_split, 1); } else { struct variable **split; size_t n; - if (!parse_variables (default_dict, &split, &n, PV_NO_DUPLICATE)) + if (!parse_variables (dataset_dict (current_dataset), &split, &n, PV_NO_DUPLICATE)) goto lossage; - dict_set_split_vars (default_dict, split, n); + dict_set_split_vars (dataset_dict (current_dataset), split, n); } { - struct variable *const *split = dict_get_split_vars (default_dict); - size_t split_cnt = dict_get_split_cnt (default_dict); + struct variable *const *split = dict_get_split_vars (dataset_dict (current_dataset)); + size_t split_cnt = dict_get_split_cnt (dataset_dict (current_dataset)); int i; for (i = 0; i < split_cnt; i++) @@ -373,7 +373,7 @@ cmd_matrix_data (void) } seen |= 4; - if (!parse_variables (default_dict, &mx->factors, &mx->n_factors, + if (!parse_variables (dataset_dict (current_dataset), &mx->factors, &mx->n_factors, PV_NONE)) goto lossage; @@ -572,7 +572,7 @@ cmd_matrix_data (void) } /* Create VARNAME_. */ - mx->varname_ = dict_create_var_assert (default_dict, "VARNAME_", 8); + mx->varname_ = dict_create_var_assert (dataset_dict (current_dataset), "VARNAME_", 8); attach_mxd_aux (mx->varname_, MXD_VARNAME, 0); /* Sort the dictionary variables into the desired order for the @@ -581,9 +581,9 @@ cmd_matrix_data (void) struct variable **v; size_t nv; - dict_get_vars (default_dict, &v, &nv, 0); + dict_get_vars (dataset_dict (current_dataset), &v, &nv, 0); qsort (v, nv, sizeof *v, compare_variables_by_mxd_var_type); - dict_reorder_vars (default_dict, v, nv); + dict_reorder_vars (dataset_dict (current_dataset), v, nv); free (v); } @@ -601,9 +601,9 @@ cmd_matrix_data (void) int i; mx->first_continuous = -1; - for (i = 0; i < dict_get_var_cnt (default_dict); i++) + for (i = 0; i < dict_get_var_cnt (dataset_dict (current_dataset)); i++) { - struct variable *v = dict_get_var (default_dict, i); + struct variable *v = dict_get_var (dataset_dict (current_dataset), i); struct mxd_var *mv = v->aux; int type = mv->var_type; @@ -639,7 +639,7 @@ cmd_matrix_data (void) return ok ? CMD_SUCCESS : CMD_CASCADING_FAILURE; lossage: - discard_variables (); + discard_variables (current_dataset); free (mx->factors); pool_destroy (mx->container); return CMD_CASCADING_FAILURE; @@ -945,13 +945,13 @@ read_matrices_without_rowtype (struct matrix_data_pgm *mx) nr.factor_values = xnmalloc (mx->n_factors * mx->cells, sizeof *nr.factor_values); nr.max_cell_idx = 0; - nr.split_values = xnmalloc (dict_get_split_cnt (default_dict), + nr.split_values = xnmalloc (dict_get_split_cnt (dataset_dict (current_dataset)), sizeof *nr.split_values); - proc_set_source (create_case_source ( + proc_set_source (current_dataset, create_case_source ( &matrix_data_without_rowtype_source_class, &nr)); - ok = procedure (NULL, NULL); + ok = procedure (current_dataset,NULL, NULL); free (nr.split_values); free (nr.factor_values); @@ -1089,7 +1089,7 @@ nr_read_data_lines (struct nr_aux_data *nr, if (token.type != MNUM) { msg (SE, _("expecting value for %s %s"), - dict_get_var (default_dict, j)->name, + dict_get_var (dataset_dict (current_dataset), j)->name, context (mx->reader)); return 0; } @@ -1206,7 +1206,7 @@ matrix_data_read_without_rowtype (struct case_source *source, if (!nr_output_data (nr, c, write_case, wc_data)) return false; - if (dict_get_split_cnt (default_dict) == 0 + if (dict_get_split_cnt (dataset_dict (current_dataset)) == 0 || !another_token (mx->reader)) return true; } @@ -1229,14 +1229,14 @@ nr_read_splits (struct nr_aux_data *nr, int compare) return true; } - if (dict_get_split_vars (default_dict) == NULL) + if (dict_get_split_vars (dataset_dict (current_dataset)) == NULL) return true; if (mx->single_split) { if (!compare) { - struct mxd_var *mv = dict_get_split_vars (default_dict)[0]->aux; + struct mxd_var *mv = dict_get_split_vars (dataset_dict (current_dataset))[0]->aux; nr->split_values[0] = ++mv->sub_type; } return true; @@ -1245,7 +1245,7 @@ nr_read_splits (struct nr_aux_data *nr, int compare) if (!compare) just_read = 1; - split_cnt = dict_get_split_cnt (default_dict); + split_cnt = dict_get_split_cnt (dataset_dict (current_dataset)); for (i = 0; i < split_cnt; i++) { struct matrix_token token; @@ -1264,7 +1264,7 @@ nr_read_splits (struct nr_aux_data *nr, int compare) { msg (SE, _("Expecting value %g for %s."), nr->split_values[i], - dict_get_split_vars (default_dict)[i]->name); + dict_get_split_vars (dataset_dict (current_dataset))[i]->name); return false; } } @@ -1351,13 +1351,13 @@ dump_cell_content (struct matrix_data_pgm *mx, int content, double *cp, for (j = 0; j < mx->n_continuous; j++) { - int fv = dict_get_var (default_dict, mx->first_continuous + j)->fv; + int fv = dict_get_var (dataset_dict (current_dataset), mx->first_continuous + j)->fv; case_data_rw (c, fv)->f = *cp; cp++; } if (type == 1) buf_copy_str_rpad (case_data_rw (c, mx->varname_->fv)->s, 8, - dict_get_var (default_dict, + dict_get_var (dataset_dict (current_dataset), mx->first_continuous + i)->name); if (!write_case (wc_data)) return false; @@ -1378,8 +1378,8 @@ nr_output_data (struct nr_aux_data *nr, struct ccase *c, size_t split_cnt; size_t i; - split_cnt = dict_get_split_cnt (default_dict); - split = dict_get_split_vars (default_dict); + split_cnt = dict_get_split_cnt (dataset_dict (current_dataset)); + split = dict_get_split_vars (dataset_dict (current_dataset)); for (i = 0; i < split_cnt; i++) case_data_rw (c, split[i]->fv)->f = nr->split_values[i]; } @@ -1487,9 +1487,10 @@ read_matrices_with_rowtype (struct matrix_data_pgm *mx) wr.current = NULL; mx->cells = 0; - proc_set_source (create_case_source (&matrix_data_with_rowtype_source_class, + proc_set_source (current_dataset, + create_case_source (&matrix_data_with_rowtype_source_class, &wr)); - ok = procedure (NULL, NULL); + ok = procedure (current_dataset,NULL, NULL); free (wr.split_values); return ok; @@ -1533,7 +1534,7 @@ wr_read_splits (struct wr_aux_data *wr, bool compare; size_t split_cnt; - split_cnt = dict_get_split_cnt (default_dict); + split_cnt = dict_get_split_cnt (dataset_dict (current_dataset)); if (split_cnt == 0) return true; @@ -1627,8 +1628,8 @@ wr_output_data (struct wr_aux_data *wr, size_t split_cnt; size_t i; - split_cnt = dict_get_split_cnt (default_dict); - split = dict_get_split_vars (default_dict); + split_cnt = dict_get_split_cnt (dataset_dict (current_dataset)); + split = dict_get_split_vars (dataset_dict (current_dataset)); for (i = 0; i < split_cnt; i++) case_data_rw (c, split[i]->fv)->f = wr->split_values[i]; } @@ -1955,7 +1956,7 @@ wr_read_indeps (struct wr_aux_data *wr) if (token.type != MNUM) { msg (SE, _("Syntax error expecting value for %s %s."), - dict_get_var (default_dict, mx->first_continuous + j)->name, + dict_get_var (dataset_dict (current_dataset), mx->first_continuous + j)->name, context (mx->reader)); return false; } diff --git a/src/language/data-io/print-space.c b/src/language/data-io/print-space.c index 7eddf99d..86d94cbc 100644 --- a/src/language/data-io/print-space.c +++ b/src/language/data-io/print-space.c @@ -69,7 +69,7 @@ cmd_print_space (void) if (token != '.') { - expr = expr_parse (default_dict, EXPR_NUMBER); + expr = expr_parse (dataset_dict (current_dataset), EXPR_NUMBER); if (token != '.') { expr_free (expr); @@ -96,7 +96,8 @@ cmd_print_space (void) trns->writer = writer; trns->expr = expr; - add_transformation (print_space_trns_proc, print_space_trns_free, trns); + add_transformation (current_dataset, + print_space_trns_proc, print_space_trns_free, trns); return CMD_SUCCESS; } diff --git a/src/language/data-io/print.c b/src/language/data-io/print.c index 87f20675..474404b6 100644 --- a/src/language/data-io/print.c +++ b/src/language/data-io/print.c @@ -198,7 +198,7 @@ internal_cmd_print (enum which_formats which_formats, bool eject) dump_table (trns, fh); /* Put the transformation in the queue. */ - add_transformation (print_trns_proc, print_trns_free, trns); + add_transformation (current_dataset, print_trns_proc, print_trns_free, trns); pool_destroy (tmp_pool); @@ -299,7 +299,7 @@ parse_variable_argument (struct print_trns *trns, struct pool *tmp_pool, bool add_space; if (!parse_variables_pool (tmp_pool, - default_dict, &vars, &var_cnt, PV_DUPLICATE)) + dataset_dict (current_dataset), &vars, &var_cnt, PV_DUPLICATE)) return false; if (lex_is_number () || token == '(') diff --git a/src/language/dictionary/apply-dictionary.c b/src/language/dictionary/apply-dictionary.c index e3a77e5d..fc3c54b0 100644 --- a/src/language/dictionary/apply-dictionary.c +++ b/src/language/dictionary/apply-dictionary.c @@ -63,7 +63,7 @@ cmd_apply_dictionary (void) for (i = 0; i < dict_get_var_cnt (dict); i++) { struct variable *s = dict_get_var (dict, i); - struct variable *t = dict_lookup_var (default_dict, s->name); + struct variable *t = dict_lookup_var (dataset_dict (current_dataset), s->name); if (t == NULL) continue; @@ -128,10 +128,10 @@ cmd_apply_dictionary (void) if (dict_get_weight (dict) != NULL) { struct variable *new_weight - = dict_lookup_var (default_dict, dict_get_weight (dict)->name); + = dict_lookup_var (dataset_dict (current_dataset), dict_get_weight (dict)->name); if (new_weight != NULL) - dict_set_weight (default_dict, new_weight); + dict_set_weight (dataset_dict (current_dataset), new_weight); } any_reader_close (reader); diff --git a/src/language/dictionary/formats.c b/src/language/dictionary/formats.c index 4bc6e3f4..5e1bd7d4 100644 --- a/src/language/dictionary/formats.c +++ b/src/language/dictionary/formats.c @@ -83,7 +83,7 @@ internal_cmd_formats (int which) if (token == '.') break; - if (!parse_variables (default_dict, &v, &cv, PV_NUMERIC)) + if (!parse_variables (dataset_dict (current_dataset), &v, &cv, PV_NUMERIC)) return CMD_FAILURE; type = v[0]->type; diff --git a/src/language/dictionary/missing-values.c b/src/language/dictionary/missing-values.c index 21a5b639..db7d1e67 100644 --- a/src/language/dictionary/missing-values.c +++ b/src/language/dictionary/missing-values.c @@ -49,7 +49,7 @@ cmd_missing_values (void) { size_t i; - if (!parse_variables (default_dict, &v, &nv, PV_NONE)) + if (!parse_variables (dataset_dict (current_dataset), &v, &nv, PV_NONE)) goto done; if (!lex_match ('(')) diff --git a/src/language/dictionary/modify-variables.c b/src/language/dictionary/modify-variables.c index 333f7704..3bbf844f 100644 --- a/src/language/dictionary/modify-variables.c +++ b/src/language/dictionary/modify-variables.c @@ -92,7 +92,7 @@ cmd_modify_vars (void) size_t i; - if (proc_make_temporary_transformations_permanent ()) + if (proc_make_temporary_transformations_permanent (current_dataset)) msg (SE, _("MODIFY VARS may not be used after TEMPORARY. " "Temporary transformations will be made permanent.")); @@ -142,7 +142,7 @@ cmd_modify_vars (void) "of variables.")); goto done; } - dict_get_vars (default_dict, &v, &nv, 1u << DC_SYSTEM); + dict_get_vars (dataset_dict (current_dataset), &v, &nv, 1u << DC_SYSTEM); } else { @@ -152,7 +152,7 @@ cmd_modify_vars (void) free (v); goto done; } - if (!parse_variables (default_dict, &v, &nv, + if (!parse_variables (dataset_dict (current_dataset), &v, &nv, PV_APPEND | PV_NO_DUPLICATE)) { free (v); @@ -194,7 +194,7 @@ cmd_modify_vars (void) msg (SE, _("`(' expected on RENAME subcommand.")); goto done; } - if (!parse_variables (default_dict, &vm.rename_vars, &vm.rename_cnt, + if (!parse_variables (dataset_dict (current_dataset), &vm.rename_vars, &vm.rename_cnt, PV_APPEND | PV_NO_DUPLICATE)) goto done; if (!lex_match ('=')) @@ -239,7 +239,7 @@ cmd_modify_vars (void) already_encountered |= 4; lex_match ('='); - if (!parse_variables (default_dict, &keep_vars, &keep_cnt, PV_NONE)) + if (!parse_variables (dataset_dict (current_dataset), &keep_vars, &keep_cnt, PV_NONE)) goto done; /* Transform the list of variables to keep into a list of @@ -248,7 +248,7 @@ cmd_modify_vars (void) sort (keep_vars, keep_cnt, sizeof *keep_vars, compare_variables_given_ordering, &forward_positional_ordering); - dict_get_vars (default_dict, &all_vars, &all_cnt, 0); + dict_get_vars (dataset_dict (current_dataset), &all_vars, &all_cnt, 0); assert (all_cnt >= keep_cnt); drop_cnt = all_cnt - keep_cnt; @@ -283,14 +283,14 @@ cmd_modify_vars (void) already_encountered |= 4; lex_match ('='); - if (!parse_variables (default_dict, &drop_vars, &drop_cnt, PV_NONE)) + if (!parse_variables (dataset_dict (current_dataset), &drop_vars, &drop_cnt, PV_NONE)) goto done; vm.drop_vars = drop_vars; vm.drop_cnt = drop_cnt; } else if (lex_match_id ("MAP")) { - struct dictionary *temp = dict_clone (default_dict); + struct dictionary *temp = dict_clone (dataset_dict (current_dataset)); int success = rearrange_dict (temp, &vm); if (success) { @@ -320,11 +320,11 @@ cmd_modify_vars (void) if (already_encountered & (1 | 4)) { /* Read the data. */ - if (!procedure (NULL, NULL)) + if (!procedure (current_dataset,NULL, NULL)) goto done; } - if (!rearrange_dict (default_dict, &vm)) + if (!rearrange_dict (dataset_dict (current_dataset), &vm)) goto done; ret_code = CMD_SUCCESS; diff --git a/src/language/dictionary/numeric.c b/src/language/dictionary/numeric.c index 71de3d87..e1358a53 100644 --- a/src/language/dictionary/numeric.c +++ b/src/language/dictionary/numeric.c @@ -78,7 +78,7 @@ cmd_numeric (void) /* Create each variable. */ for (i = 0; i < nv; i++) { - struct variable *new_var = dict_create_var (default_dict, v[i], 0); + struct variable *new_var = dict_create_var (dataset_dict (current_dataset), v[i], 0); if (!new_var) msg (SE, _("There is already a variable named %s."), v[i]); else @@ -157,7 +157,7 @@ cmd_string (void) /* Create each variable. */ for (i = 0; i < nv; i++) { - struct variable *new_var = dict_create_var (default_dict, v[i], + struct variable *new_var = dict_create_var (dataset_dict (current_dataset), v[i], width); if (!new_var) msg (SE, _("There is already a variable named %s."), v[i]); @@ -192,7 +192,7 @@ cmd_leave (void) size_t i; - if (!parse_variables (default_dict, &v, &nv, PV_NONE)) + if (!parse_variables (dataset_dict (current_dataset), &v, &nv, PV_NONE)) return CMD_CASCADING_FAILURE; for (i = 0; i < nv; i++) v[i]->leave = true; diff --git a/src/language/dictionary/rename-variables.c b/src/language/dictionary/rename-variables.c index b2bd3d76..89827c93 100644 --- a/src/language/dictionary/rename-variables.c +++ b/src/language/dictionary/rename-variables.c @@ -47,7 +47,7 @@ cmd_rename_variables (void) int status = CMD_CASCADING_FAILURE; - if (proc_make_temporary_transformations_permanent ()) + if (proc_make_temporary_transformations_permanent (current_dataset)) msg (SE, _("RENAME VARS may not be used after TEMPORARY. " "Temporary transformations will be made permanent.")); @@ -61,7 +61,7 @@ cmd_rename_variables (void) msg (SE, _("`(' expected.")); goto lossage; } - if (!parse_variables (default_dict, &rename_vars, &rename_cnt, + if (!parse_variables (dataset_dict (current_dataset), &rename_vars, &rename_cnt, PV_APPEND | PV_NO_DUPLICATE)) goto lossage; if (!lex_match ('=')) @@ -93,7 +93,7 @@ cmd_rename_variables (void) } while (token != '.'); - if (!dict_rename_vars (default_dict, + if (!dict_rename_vars (dataset_dict (current_dataset), rename_vars, rename_new_names, rename_cnt, &err_name)) { diff --git a/src/language/dictionary/split-file.c b/src/language/dictionary/split-file.c index 78769ca1..625f34c5 100644 --- a/src/language/dictionary/split-file.c +++ b/src/language/dictionary/split-file.c @@ -44,7 +44,7 @@ int cmd_split_file (void) { if (lex_match_id ("OFF")) - dict_set_split_vars (default_dict, NULL, 0); + dict_set_split_vars (dataset_dict (current_dataset), NULL, 0); else { struct variable **v; @@ -54,10 +54,10 @@ cmd_split_file (void) (void) ( lex_match_id ("SEPARATE") || lex_match_id ("LAYERED") ); lex_match (T_BY); - if (!parse_variables (default_dict, &v, &n, PV_NO_DUPLICATE)) + if (!parse_variables (dataset_dict (current_dataset), &v, &n, PV_NO_DUPLICATE)) return CMD_CASCADING_FAILURE; - dict_set_split_vars (default_dict, v, n); + dict_set_split_vars (dataset_dict (current_dataset), v, n); free (v); } @@ -73,7 +73,7 @@ output_split_file_values (const struct ccase *c) size_t split_cnt; int i; - split_cnt = dict_get_split_cnt (default_dict); + split_cnt = dict_get_split_cnt (dataset_dict (current_dataset)); if (split_cnt == 0) return; @@ -84,7 +84,7 @@ output_split_file_values (const struct ccase *c) tab_text (t, 0, 0, TAB_NONE, _("Variable")); tab_text (t, 1, 0, TAB_LEFT, _("Value")); tab_text (t, 2, 0, TAB_LEFT, _("Label")); - split = dict_get_split_vars (default_dict); + split = dict_get_split_vars (dataset_dict (current_dataset)); for (i = 0; i < split_cnt; i++) { struct variable *v = split[i]; diff --git a/src/language/dictionary/sys-file-info.c b/src/language/dictionary/sys-file-info.c index 3f77b1de..c28723b0 100644 --- a/src/language/dictionary/sys-file-info.c +++ b/src/language/dictionary/sys-file-info.c @@ -199,13 +199,13 @@ cmd_display (void) som_blank_line (); if (!lex_force_match_id ("LABEL")) return CMD_FAILURE; - if (dict_get_label (default_dict) == NULL) + if (dict_get_label (dataset_dict (current_dataset)) == NULL) tab_output_text (TAB_LEFT, _("The active file does not have a file label.")); else { tab_output_text (TAB_LEFT | TAT_TITLE, _("File label:")); - tab_output_text (TAB_LEFT | TAB_FIX, dict_get_label (default_dict)); + tab_output_text (TAB_LEFT | TAB_FIX, dict_get_label (dataset_dict (current_dataset))); } } else @@ -241,7 +241,7 @@ cmd_display (void) if (token != '.') { - if (!parse_variables (default_dict, &vl, &n, PV_NONE)) + if (!parse_variables (dataset_dict (current_dataset), &vl, &n, PV_NONE)) { free (vl); return CMD_FAILURE; @@ -249,7 +249,7 @@ cmd_display (void) as = AS_DICTIONARY; } else - dict_get_vars (default_dict, &vl, &n, 0); + dict_get_vars (dataset_dict (current_dataset), &vl, &n, 0); if (as == AS_SCRATCH) { @@ -291,7 +291,7 @@ display_macros (void) static void display_documents (void) { - const char *documents = dict_get_documents (default_dict); + const char *documents = dict_get_documents (dataset_dict (current_dataset)); som_blank_line (); if (documents == NULL) @@ -574,7 +574,7 @@ display_vectors (int sorted) struct tab_table *t; size_t nvec; - nvec = dict_get_vector_cnt (default_dict); + nvec = dict_get_vector_cnt (dataset_dict (current_dataset)); if (nvec == 0) { msg (SW, _("No vectors defined.")); @@ -583,7 +583,7 @@ display_vectors (int sorted) vl = xnmalloc (nvec, sizeof *vl); for (i = 0; i < nvec; i++) - vl[i] = dict_get_vector (default_dict, i); + vl[i] = dict_get_vector (dataset_dict (current_dataset), i); if (sorted) qsort (vl, nvec, sizeof *vl, compare_vectors_by_name); diff --git a/src/language/dictionary/value-labels.c b/src/language/dictionary/value-labels.c index a1310227..e9c9b3f9 100644 --- a/src/language/dictionary/value-labels.c +++ b/src/language/dictionary/value-labels.c @@ -70,7 +70,7 @@ do_value_labels (int erase) while (token != '.') { - parse_err = !parse_variables (default_dict, &vars, &var_cnt, + parse_err = !parse_variables (dataset_dict (current_dataset), &vars, &var_cnt, PV_SAME_TYPE) ; if (var_cnt < 1) { diff --git a/src/language/dictionary/variable-display.c b/src/language/dictionary/variable-display.c index 4d13514e..6c2f24f5 100644 --- a/src/language/dictionary/variable-display.c +++ b/src/language/dictionary/variable-display.c @@ -46,7 +46,7 @@ cmd_variable_alignment (void) size_t i; enum alignment align; - if (!parse_variables (default_dict, &v, &nv, PV_NONE)) + if (!parse_variables (dataset_dict (current_dataset), &v, &nv, PV_NONE)) return CMD_FAILURE; if ( lex_force_match('(') ) @@ -97,7 +97,7 @@ cmd_variable_width (void) size_t nv; size_t i; - if (!parse_variables (default_dict, &v, &nv, PV_NONE)) + if (!parse_variables (dataset_dict (current_dataset), &v, &nv, PV_NONE)) return CMD_FAILURE; if ( lex_force_match('(') ) @@ -132,7 +132,7 @@ cmd_variable_level (void) enum measure level; size_t i; - if (!parse_variables (default_dict, &v, &nv, PV_NONE)) + if (!parse_variables (dataset_dict (current_dataset), &v, &nv, PV_NONE)) return CMD_FAILURE; if ( lex_force_match('(') ) diff --git a/src/language/dictionary/variable-label.c b/src/language/dictionary/variable-label.c index 17f88112..63d64ef5 100644 --- a/src/language/dictionary/variable-label.c +++ b/src/language/dictionary/variable-label.c @@ -44,7 +44,7 @@ cmd_variable_labels (void) size_t i; - if (!parse_variables (default_dict, &v, &nv, PV_NONE)) + if (!parse_variables (dataset_dict (current_dataset), &v, &nv, PV_NONE)) return CMD_FAILURE; if (token != T_STRING) diff --git a/src/language/dictionary/vector.c b/src/language/dictionary/vector.c index 17cbb1a6..050886d9 100644 --- a/src/language/dictionary/vector.c +++ b/src/language/dictionary/vector.c @@ -75,7 +75,7 @@ cmd_vector (void) goto fail; } - if (dict_lookup_vector (default_dict, tokid)) + if (dict_lookup_vector (dataset_dict (current_dataset), tokid)) { msg (SE, _("There is already a vector with name %s."), tokid); goto fail; @@ -104,11 +104,11 @@ cmd_vector (void) goto fail; } - if (!parse_variables (default_dict, &v, &nv, + if (!parse_variables (dataset_dict (current_dataset), &v, &nv, PV_SAME_TYPE | PV_DUPLICATE)) goto fail; - dict_create_vector (default_dict, vecnames, v, nv); + dict_create_vector (dataset_dict (current_dataset), vecnames, v, nv); free (v); } else if (lex_match ('(')) @@ -158,7 +158,7 @@ cmd_vector (void) for (i = 0; i < nv; i++) { sprintf (name, "%s%d", cp, i + 1); - if (dict_lookup_var (default_dict, name)) + if (dict_lookup_var (dataset_dict (current_dataset), name)) { msg (SE, _("There is already a variable named %s."), name); @@ -175,9 +175,9 @@ cmd_vector (void) for (i = 0; i < nv; i++) { sprintf (name, "%s%d", cp, i + 1); - v[i] = dict_create_var_assert (default_dict, name, 0); + v[i] = dict_create_var_assert (dataset_dict (current_dataset), name, 0); } - if (!dict_create_vector (default_dict, cp, v, nv)) + if (!dict_create_vector (dataset_dict (current_dataset), cp, v, nv)) NOT_REACHED (); cp += strlen (cp) + 1; } diff --git a/src/language/dictionary/weight.c b/src/language/dictionary/weight.c index 58ed524d..fb0972f9 100644 --- a/src/language/dictionary/weight.c +++ b/src/language/dictionary/weight.c @@ -37,7 +37,7 @@ int cmd_weight (void) { if (lex_match_id ("OFF")) - dict_set_weight (default_dict, NULL); + dict_set_weight (dataset_dict (current_dataset), NULL); else { struct variable *v; @@ -57,7 +57,7 @@ cmd_weight (void) return CMD_CASCADING_FAILURE; } - dict_set_weight (default_dict, v); + dict_set_weight (dataset_dict (current_dataset), v); } return lex_end_of_command (); diff --git a/src/language/expressions/operations.def b/src/language/expressions/operations.def index fe3bc5de..dbd5ce2b 100644 --- a/src/language/expressions/operations.def +++ b/src/language/expressions/operations.def @@ -958,7 +958,7 @@ no_opt string operator STR_VAR () no_opt perm_only function LAG (num_var v, pos_int n_before) { - struct ccase *c = lagged_case (n_before); + struct ccase *c = lagged_case (current_dataset, n_before); if (c != NULL) { double x = case_num (c, v->fv); @@ -970,7 +970,7 @@ no_opt perm_only function LAG (num_var v, pos_int n_before) no_opt perm_only function LAG (num_var v) { - struct ccase *c = lagged_case (1); + struct ccase *c = lagged_case (current_dataset, 1); if (c != NULL) { double x = case_num (c, v->fv); @@ -983,7 +983,7 @@ no_opt perm_only function LAG (num_var v) no_opt perm_only string function LAG (str_var v, pos_int n_before) expression e; { - struct ccase *c = lagged_case (n_before); + struct ccase *c = lagged_case (current_dataset, n_before); if (c != NULL) return copy_string (e, case_str (c, v->fv), v->width); else @@ -993,7 +993,7 @@ no_opt perm_only string function LAG (str_var v, pos_int n_before) no_opt perm_only string function LAG (str_var v) expression e; { - struct ccase *c = lagged_case (1); + struct ccase *c = lagged_case (current_dataset, 1); if (c != NULL) return copy_string (e, case_str (c, v->fv), v->width); else diff --git a/src/language/expressions/parse.c b/src/language/expressions/parse.c index 66d31d59..979e756a 100644 --- a/src/language/expressions/parse.c +++ b/src/language/expressions/parse.c @@ -733,7 +733,7 @@ parse_sysvar (struct expression *e) "JUL", "AUG", "SEP", "OCT", "NOV", "DEC", }; - time_t last_proc_time = time_of_last_procedure (); + time_t last_proc_time = time_of_last_procedure (current_dataset); struct tm *time; char temp_buf[10]; @@ -751,7 +751,7 @@ parse_sysvar (struct expression *e) return expr_allocate_number (e, SYSMIS); else if (lex_match_id ("$JDATE")) { - time_t time = time_of_last_procedure (); + time_t time = time_of_last_procedure (current_dataset); struct tm *tm = localtime (&time); return expr_allocate_number (e, expr_ymd_to_ofs (tm->tm_year + 1900, tm->tm_mon + 1, @@ -759,7 +759,7 @@ parse_sysvar (struct expression *e) } else if (lex_match_id ("$TIME")) { - time_t time = time_of_last_procedure (); + time_t time = time_of_last_procedure (current_dataset); struct tm *tm = localtime (&time); return expr_allocate_number (e, expr_ymd_to_date (tm->tm_year + 1900, @@ -872,7 +872,7 @@ parse_vector_element (struct expression *e) /* Find vector, skip token. The caller must already have verified that the current token is the name of a vector. */ - vector = dict_lookup_vector (default_dict, tokid); + vector = dict_lookup_vector (dataset_dict (current_dataset), tokid); assert (vector != NULL); lex_get (); @@ -1185,7 +1185,7 @@ parse_function (struct expression *e) size_t var_cnt; size_t i; - if (!parse_variables (default_dict, &vars, &var_cnt, PV_SINGLE)) + if (!parse_variables (dataset_dict (current_dataset), &vars, &var_cnt, PV_SINGLE)) goto fail; for (i = 0; i < var_cnt; i++) add_arg (&args, &arg_cnt, &arg_cap, @@ -1230,7 +1230,8 @@ parse_function (struct expression *e) msg (SE, _("%s is not yet implemented."), f->prototype); goto fail; } - if ((f->flags & OPF_PERM_ONLY) && proc_in_temporary_transformations ()) + if ((f->flags & OPF_PERM_ONLY) && + proc_in_temporary_transformations (current_dataset)) { msg (SE, _("%s may not appear after TEMPORARY."), f->prototype); goto fail; @@ -1241,8 +1242,8 @@ parse_function (struct expression *e) if (n->type == OP_LAG_Vn || n->type == OP_LAG_Vs) { - if (n_lag < 1) - n_lag = 1; + if (dataset_n_lag (current_dataset) < 1) + dataset_set_n_lag (current_dataset, 1); } else if (n->type == OP_LAG_Vnn || n->type == OP_LAG_Vsn) { @@ -1250,8 +1251,8 @@ parse_function (struct expression *e) assert (n->composite.arg_cnt == 2); assert (n->composite.args[1]->type == OP_pos_int); n_before = n->composite.args[1]->integer.i; - if (n_lag < n_before) - n_lag = n_before; + if ( dataset_n_lag (current_dataset) < n_before) + dataset_set_n_lag (current_dataset, n_before); } free (args); diff --git a/src/language/lexer/q2c.c b/src/language/lexer/q2c.c index f503730f..11271270 100644 --- a/src/language/lexer/q2c.c +++ b/src/language/lexer/q2c.c @@ -1584,7 +1584,7 @@ dump_subcommand (const subcommand *sbc) } else if (sbc->type == SBC_VARLIST) { - dump (1, "if (!parse_variables (default_dict, &p->%sv_%s, &p->%sn_%s, " + dump (1, "if (!parse_variables (dataset_dict (current_dataset), &p->%sv_%s, &p->%sn_%s, " "PV_APPEND%s%s))", st_lower (sbc->prefix), st_lower (sbc->name), st_lower (sbc->prefix), st_lower (sbc->name), @@ -1740,18 +1740,18 @@ dump_parser (int persistent) { if (def->type == SBC_VARLIST) dump (1, "if (token == T_ID " - "&& dict_lookup_var (default_dict, tokid) != NULL " + "&& dict_lookup_var (dataset_dict (current_dataset), tokid) != NULL " "&& lex_look_ahead () != '=')"); else { dump (0, "if ((token == T_ID " - "&& dict_lookup_var (default_dict, tokid) " + "&& dict_lookup_var (dataset_dict (current_dataset), tokid) " "&& lex_look_ahead () != '=')"); dump (1, " || token == T_ALL)"); } dump (1, "{"); dump (0, "p->sbc_%s++;", st_lower (def->name)); - dump (1, "if (!parse_variables (default_dict, &p->%sv_%s, &p->%sn_%s, " + dump (1, "if (!parse_variables (dataset_dict (current_dataset), &p->%sv_%s, &p->%sn_%s, " "PV_APPEND))", st_lower (def->prefix), st_lower (def->name), st_lower (def->prefix), st_lower (def->name)); diff --git a/src/language/lexer/variable-parser.c b/src/language/lexer/variable-parser.c index a2068f02..54a4e85c 100644 --- a/src/language/lexer/variable-parser.c +++ b/src/language/lexer/variable-parser.c @@ -87,13 +87,13 @@ parse_dict_variable (const struct dictionary *d) return var; } -/* Parses a variable name in default_dict and returns the +/* Parses a variable name in dataset_dict (current_dataset) and returns the variable if successful. On failure emits an error message and returns a null pointer. */ struct variable * parse_variable (void) { - return parse_dict_variable (default_dict); + return parse_dict_variable (dataset_dict (current_dataset)); } @@ -548,12 +548,12 @@ parse_mixed_vars (char ***names, size_t *nnames, int pv_opts) } while (token == T_ID || token == T_ALL) { - if (token == T_ALL || dict_lookup_var (default_dict, tokid) != NULL) + if (token == T_ALL || dict_lookup_var (dataset_dict (current_dataset), tokid) != NULL) { struct variable **v; size_t nv; - if (!parse_variables (default_dict, &v, &nv, PV_NONE)) + if (!parse_variables (dataset_dict (current_dataset), &v, &nv, PV_NONE)) goto fail; *names = xnrealloc (*names, *nnames + nv, sizeof **names); for (i = 0; i < nv; i++) diff --git a/src/language/stats/aggregate.c b/src/language/stats/aggregate.c index 788b19b0..a388b2d9 100644 --- a/src/language/stats/aggregate.c +++ b/src/language/stats/aggregate.c @@ -185,8 +185,8 @@ cmd_aggregate (void) case_nullify (&agr.break_case); agr.dict = dict_create (); - dict_set_label (agr.dict, dict_get_label (default_dict)); - dict_set_documents (agr.dict, dict_get_documents (default_dict)); + dict_set_label (agr.dict, dict_get_label (dataset_dict (current_dataset))); + dict_set_documents (agr.dict, dict_get_documents (dataset_dict (current_dataset))); /* OUTFILE subcommand must be first. */ if (!lex_force_match_id ("OUTFILE")) @@ -223,7 +223,7 @@ cmd_aggregate (void) int i; lex_match ('='); - agr.sort = sort_parse_criteria (default_dict, + agr.sort = sort_parse_criteria (dataset_dict (current_dataset), &agr.break_vars, &agr.break_var_cnt, &saw_direction, NULL); if (agr.sort == NULL) @@ -268,7 +268,7 @@ cmd_aggregate (void) { /* The active file will be replaced by the aggregated data, so TEMPORARY is moot. */ - proc_cancel_temporary_transformations (); + proc_cancel_temporary_transformations (current_dataset); if (agr.sort != NULL && !presorted) { @@ -279,8 +279,10 @@ cmd_aggregate (void) agr.sink = create_case_sink (&storage_sink_class, agr.dict, NULL); if (agr.sink->class->open != NULL) agr.sink->class->open (agr.sink); - proc_set_sink (create_case_sink (&null_sink_class, default_dict, NULL)); - if (!procedure (agr_to_active_file, &agr)) + proc_set_sink (current_dataset, + create_case_sink (&null_sink_class, + dataset_dict (current_dataset), NULL)); + if (!procedure (current_dataset,agr_to_active_file, &agr)) goto error; if (agr.case_cnt > 0) { @@ -288,11 +290,12 @@ cmd_aggregate (void) if (!agr.sink->class->write (agr.sink, &agr.agr_case)) goto error; } - discard_variables (); - dict_destroy (default_dict); - default_dict = agr.dict; + discard_variables (current_dataset); + dict_destroy (dataset_dict (current_dataset)); + dataset_set_dict (current_dataset, agr.dict); agr.dict = NULL; - proc_set_source (agr.sink->class->make_source (agr.sink)); + proc_set_source (current_dataset, + agr.sink->class->make_source (agr.sink)); free_case_sink (agr.sink); } else @@ -329,7 +332,7 @@ cmd_aggregate (void) else { /* Active file is already sorted. */ - if (!procedure (presorted_agr_to_sysfile, &agr)) + if (!procedure (current_dataset,presorted_agr_to_sysfile, &agr)) goto error; } @@ -459,7 +462,7 @@ parse_aggregate_functions (struct agr_proc *agr) else if (function->n_args) pv_opts |= PV_SAME_TYPE; - if (!parse_variables (default_dict, &src, &n_src, pv_opts)) + if (!parse_variables (dataset_dict (current_dataset), &src, &n_src, pv_opts)) goto error; } @@ -577,7 +580,7 @@ parse_aggregate_functions (struct agr_proc *agr) if (destvar != NULL) { if ((func_index == N || func_index == NMISS) - && dict_get_weight (default_dict) != NULL) + && dict_get_weight (dataset_dict (current_dataset)) != NULL) destvar->print = destvar->write = f8_2; else destvar->print = destvar->write = function->format; @@ -587,7 +590,7 @@ parse_aggregate_functions (struct agr_proc *agr) v->src = NULL; destvar = dict_create_var (agr->dict, dest[i], 0); if (func_index == N_NO_VARS - && dict_get_weight (default_dict) != NULL) + && dict_get_weight (dataset_dict (current_dataset)) != NULL) destvar->print = destvar->write = f8_2; else destvar->print = destvar->write = function->format; @@ -745,7 +748,7 @@ accumulate_aggregate_info (struct agr_proc *agr, double weight; bool bad_warn = true; - weight = dict_get_case_weight (default_dict, input, &bad_warn); + weight = dict_get_case_weight (dataset_dict (current_dataset), input, &bad_warn); for (iter = agr->agr_vars; iter; iter = iter->next) if (iter->src) diff --git a/src/language/stats/autorecode.c b/src/language/stats/autorecode.c index f967dd3a..2b44705f 100644 --- a/src/language/stats/autorecode.c +++ b/src/language/stats/autorecode.c @@ -121,7 +121,7 @@ cmd_autorecode (void) lex_match_id ("VARIABLES"); lex_match ('='); - if (!parse_variables (default_dict, &arc.src_vars, &arc.var_cnt, + if (!parse_variables (dataset_dict (current_dataset), &arc.src_vars, &arc.var_cnt, PV_NO_DUPLICATE)) goto lossage; if (!lex_force_match_id ("INTO")) @@ -159,7 +159,7 @@ cmd_autorecode (void) { int j; - if (dict_lookup_var (default_dict, arc.dst_names[i]) != NULL) + if (dict_lookup_var (dataset_dict (current_dataset), arc.dst_names[i]) != NULL) { msg (SE, _("Target variable %s duplicates existing variable %s."), arc.dst_names[i], arc.dst_names[i]); @@ -185,10 +185,10 @@ cmd_autorecode (void) arc.src_values[i] = hsh_create (10, compare_numeric_value, hash_numeric_value, NULL, NULL); - ok = procedure (autorecode_proc_func, &arc); + ok = procedure (current_dataset,autorecode_proc_func, &arc); for (i = 0; i < arc.var_cnt; i++) - arc.dst_vars[i] = dict_create_var_assert (default_dict, + arc.dst_vars[i] = dict_create_var_assert (dataset_dict (current_dataset), arc.dst_names[i], 0); recode (&arc); @@ -267,7 +267,8 @@ recode (const struct autorecode_pgm *arc) hsh_force_insert (spec->items, item); } } - add_transformation (autorecode_trns_proc, autorecode_trns_free, trns); + add_transformation (current_dataset, + autorecode_trns_proc, autorecode_trns_free, trns); } /* Executes an AUTORECODE transformation. */ diff --git a/src/language/stats/correlations.q b/src/language/stats/correlations.q index 12d36459..b1126470 100644 --- a/src/language/stats/correlations.q +++ b/src/language/stats/correlations.q @@ -94,18 +94,18 @@ cor_custom_variables (struct cmd_correlations *cmd UNUSED, void *aux UNUSED) /* Ensure that this is a VARIABLES subcommand. */ if (!lex_match_id ("VARIABLES") - && (token != T_ID || dict_lookup_var (default_dict, tokid) != NULL) + && (token != T_ID || dict_lookup_var (dataset_dict (current_dataset), tokid) != NULL) && token != T_ALL) return 2; lex_match ('='); - if (!parse_variables (default_dict, &v1, &nv1, + if (!parse_variables (dataset_dict (current_dataset), &v1, &nv1, PV_NO_DUPLICATE | PV_NUMERIC)) return 0; if (lex_match (T_WITH)) { - if (!parse_variables (default_dict, &v2, &nv2, + if (!parse_variables (dataset_dict (current_dataset), &v2, &nv2, PV_NO_DUPLICATE | PV_NUMERIC)) { free (v1); diff --git a/src/language/stats/crosstabs.q b/src/language/stats/crosstabs.q index 4dca0b9b..405460de 100644 --- a/src/language/stats/crosstabs.q +++ b/src/language/stats/crosstabs.q @@ -293,7 +293,7 @@ internal_cmd_crosstabs (void) else write = CRS_WR_NONE; - ok = procedure_with_splits (precalc, + ok = procedure_with_splits (current_dataset, precalc, mode == GENERAL ? calc_general : calc_integer, postcalc, NULL); @@ -313,7 +313,7 @@ crs_custom_tables (struct cmd_crosstabs *cmd UNUSED, void *aux UNUSED) /* Ensure that this is a TABLES subcommand. */ if (!lex_match_id ("TABLES") - && (token != T_ID || dict_lookup_var (default_dict, tokid) == NULL) + && (token != T_ID || dict_lookup_var (dataset_dict (current_dataset), tokid) == NULL) && token != T_ALL) return 2; lex_match ('='); @@ -321,7 +321,7 @@ crs_custom_tables (struct cmd_crosstabs *cmd UNUSED, void *aux UNUSED) if (variables != NULL) var_set = var_set_create_from_array (variables, variables_cnt); else - var_set = var_set_create_from_dict (default_dict); + var_set = var_set_create_from_dict (dataset_dict (current_dataset)); assert (var_set != NULL); for (n_by = 0; ;) @@ -423,7 +423,7 @@ crs_custom_variables (struct cmd_crosstabs *cmd UNUSED, void *aux UNUSED) long min, max; - if (!parse_variables (default_dict, &variables, &variables_cnt, + if (!parse_variables (dataset_dict (current_dataset), &variables, &variables_cnt, (PV_APPEND | PV_NUMERIC | PV_NO_DUPLICATE | PV_NO_SCRATCH))) return 0; @@ -487,7 +487,7 @@ static int compare_table_entry (const void *, const void *, void *); static unsigned hash_table_entry (const void *, void *); /* Set up the crosstabulation tables for processing. */ -static void +static void precalc (const struct ccase *first, void *aux UNUSED) { output_split_file_values (first); @@ -558,6 +558,7 @@ precalc (const struct ccase *first, void *aux UNUSED) n_sorted_tab + 1, sizeof *sorted_tab); sorted_tab[n_sorted_tab] = NULL; } + } /* Form crosstabulations for general mode. */ @@ -567,7 +568,7 @@ calc_general (const struct ccase *c, void *aux UNUSED) bool bad_warn = true; /* Case weight. */ - double weight = dict_get_case_weight (default_dict, c, &bad_warn); + double weight = dict_get_case_weight (dataset_dict (current_dataset), c, &bad_warn); /* Flattened current table index. */ int t; @@ -641,7 +642,7 @@ calc_integer (const struct ccase *c, void *aux UNUSED) bool bad_warn = true; /* Case weight. */ - double weight = dict_get_case_weight (default_dict, c, &bad_warn); + double weight = dict_get_case_weight (dataset_dict (current_dataset), c, &bad_warn); /* Flattened current table index. */ int t; diff --git a/src/language/stats/descriptives.c b/src/language/stats/descriptives.c index 9813d388..858825da 100644 --- a/src/language/stats/descriptives.c +++ b/src/language/stats/descriptives.c @@ -314,7 +314,7 @@ cmd_descriptives (void) { int i; - if (!parse_variables (default_dict, &vars, &var_cnt, + if (!parse_variables (dataset_dict (current_dataset), &vars, &var_cnt, PV_APPEND | PV_NO_DUPLICATE | PV_NUMERIC)) goto error; @@ -410,7 +410,7 @@ cmd_descriptives (void) dsc->vars[i].moments = moments_create (dsc->max_moment); /* Data pass. */ - ok = multipass_procedure_with_splits (calc_descriptives, dsc); + ok = multipass_procedure_with_splits (current_dataset, calc_descriptives, dsc); /* Z-scoring! */ if (ok && z_cnt) @@ -473,7 +473,7 @@ try_name (struct dsc_proc *dsc, char *name) { size_t i; - if (dict_lookup_var (default_dict, name) != NULL) + if (dict_lookup_var (dataset_dict (current_dataset), name) != NULL) return false; for (i = 0; i < dsc->var_cnt; i++) if (!strcasecmp (dsc->vars[i].z_name, name)) @@ -667,7 +667,7 @@ setup_z_trns (struct dsc_proc *dsc) char *cp; struct variable *dst_var; - dst_var = dict_create_var_assert (default_dict, dv->z_name, 0); + dst_var = dict_create_var_assert (dataset_dict (current_dataset), dv->z_name, 0); if (dv->v->label) { dst_var->label = xmalloc (strlen (dv->v->label) + 12); @@ -690,7 +690,8 @@ setup_z_trns (struct dsc_proc *dsc) } } - add_transformation (descriptives_trns_proc, descriptives_trns_free, t); + add_transformation (current_dataset, + descriptives_trns_proc, descriptives_trns_free, t); } /* Statistical calculation. */ @@ -728,7 +729,7 @@ calc_descriptives (const struct ccase *first, casereader_read (reader, &c); case_destroy (&c)) { - double weight = dict_get_case_weight (default_dict, &c, &dsc->bad_warn); + double weight = dict_get_case_weight (dataset_dict (current_dataset), &c, &dsc->bad_warn); if (weight <= 0.0) continue; @@ -773,7 +774,7 @@ calc_descriptives (const struct ccase *first, casereader_read (reader, &c); case_destroy (&c)) { - double weight = dict_get_case_weight (default_dict, &c, + double weight = dict_get_case_weight (dataset_dict (current_dataset), &c, &dsc->bad_warn); if (weight <= 0.0) continue; diff --git a/src/language/stats/examine.q b/src/language/stats/examine.q index 443aaa17..6b748335 100644 --- a/src/language/stats/examine.q +++ b/src/language/stats/examine.q @@ -222,7 +222,7 @@ cmd_examine(void) subc_list_double_push(&percentile_list, 75); } - ok = multipass_procedure_with_splits (run_examine, &cmd); + ok = multipass_procedure_with_splits (current_dataset, run_examine, &cmd); if ( totals ) { @@ -510,13 +510,13 @@ xmn_custom_variables(struct cmd_examine *cmd, void *aux UNUSED) { lex_match('='); - if ((token != T_ID || dict_lookup_var (default_dict, tokid) == NULL) + if ((token != T_ID || dict_lookup_var (dataset_dict (current_dataset), tokid) == NULL) && token != T_ALL) { return 2; } - if (!parse_variables (default_dict, &dependent_vars, &n_dependent_vars, + if (!parse_variables (dataset_dict (current_dataset), &dependent_vars, &n_dependent_vars, PV_NO_DUPLICATE | PV_NUMERIC | PV_NO_SCRATCH) ) { free (dependent_vars); @@ -550,7 +550,7 @@ examine_parse_independent_vars(struct cmd_examine *cmd) int success; struct factor *sf = xmalloc (sizeof *sf); - if ((token != T_ID || dict_lookup_var (default_dict, tokid) == NULL) + if ((token != T_ID || dict_lookup_var (dataset_dict (current_dataset), tokid) == NULL) && token != T_ALL) { free ( sf ) ; @@ -566,7 +566,7 @@ examine_parse_independent_vars(struct cmd_examine *cmd) lex_match(T_BY); - if ((token != T_ID || dict_lookup_var (default_dict, tokid) == NULL) + if ((token != T_ID || dict_lookup_var (dataset_dict (current_dataset), tokid) == NULL) && token != T_ALL) { free ( sf ) ; @@ -717,7 +717,7 @@ run_examine(const struct ccase *first, const struct casefile *cf, void *cmd_ ) const int case_no = casereader_cnum(r); const double weight = - dict_get_case_weight(default_dict, &c, &bad_weight_warn); + dict_get_case_weight(dataset_dict (current_dataset), &c, &bad_weight_warn); if ( cmd->miss == XMN_LISTWISE ) { diff --git a/src/language/stats/flip.c b/src/language/stats/flip.c index 0b452cb7..f304fb0e 100644 --- a/src/language/stats/flip.c +++ b/src/language/stats/flip.c @@ -96,13 +96,13 @@ cmd_flip (void) struct case_sink *sink; bool ok; - if (proc_make_temporary_transformations_permanent ()) + if (proc_make_temporary_transformations_permanent (current_dataset)) msg (SW, _("FLIP ignores TEMPORARY. " "Temporary transformations will be made permanent.")); flip = pool_create_container (struct flip_pgm, pool); flip->var = NULL; - flip->idx_to_fv = dict_get_compacted_idx_to_fv (default_dict); + flip->idx_to_fv = dict_get_compacted_idx_to_fv (dataset_dict (current_dataset)); pool_register (flip->pool, free, flip->idx_to_fv); flip->var_cnt = 0; flip->case_cnt = 0; @@ -115,13 +115,13 @@ cmd_flip (void) if (lex_match_id ("VARIABLES")) { lex_match ('='); - if (!parse_variables (default_dict, &flip->var, &flip->var_cnt, + if (!parse_variables (dataset_dict (current_dataset), &flip->var, &flip->var_cnt, PV_NO_DUPLICATE)) goto error; lex_match ('/'); } else - dict_get_vars (default_dict, &flip->var, &flip->var_cnt, 1u << DC_SYSTEM); + dict_get_vars (dataset_dict (current_dataset), &flip->var, &flip->var_cnt, 1u << DC_SYSTEM); pool_register (flip->pool, free, flip->var); lex_match ('/'); @@ -133,7 +133,7 @@ cmd_flip (void) goto error; } else - flip->new_names = dict_lookup_var (default_dict, "CASE_LBL"); + flip->new_names = dict_lookup_var (dataset_dict (current_dataset), "CASE_LBL"); if (flip->new_names) { @@ -150,32 +150,32 @@ cmd_flip (void) /* Read the active file into a flip_sink. */ flip->case_cnt = 0; - proc_make_temporary_transformations_permanent (); + proc_make_temporary_transformations_permanent (current_dataset); sink = flip_sink_create (flip); if (sink == NULL) goto error; - proc_set_sink (sink); + proc_set_sink (current_dataset, sink); flip->new_names_tail = NULL; - ok = procedure (NULL, NULL); + ok = procedure (current_dataset,NULL, NULL); /* Flip the data we read. */ if (!flip_file (flip)) { - discard_variables (); + discard_variables (current_dataset); goto error; } /* Flip the dictionary. */ - dict_clear (default_dict); + dict_clear (dataset_dict (current_dataset)); if (!build_dictionary (flip)) { - discard_variables (); + discard_variables (current_dataset); goto error; } - flip->case_size = dict_get_case_size (default_dict); + flip->case_size = dict_get_case_size (dataset_dict (current_dataset)); /* Set up flipped data for reading. */ - proc_set_source (flip_source_create (flip)); + proc_set_source (current_dataset, flip_source_create (flip)); return ok ? lex_end_of_command () : CMD_CASCADING_FAILURE; @@ -219,7 +219,7 @@ make_new_var (char name[]) *cp = '\0'; str_uppercase (name); - if (dict_create_var (default_dict, name, 0)) + if (dict_create_var (dataset_dict (current_dataset), name, 0)) return 1; /* Add numeric extensions until acceptable. */ @@ -234,7 +234,7 @@ make_new_var (char name[]) memcpy (n, name, ofs); sprintf (&n[ofs], "%d", i); - if (dict_create_var (default_dict, n, 0)) + if (dict_create_var (dataset_dict (current_dataset), n, 0)) return 1; } } @@ -247,7 +247,7 @@ make_new_var (char name[]) static int build_dictionary (struct flip_pgm *flip) { - dict_create_var_assert (default_dict, "CASE_LBL", 8); + dict_create_var_assert (dataset_dict (current_dataset), "CASE_LBL", 8); if (flip->new_names_head == NULL) { @@ -265,7 +265,7 @@ build_dictionary (struct flip_pgm *flip) char s[SHORT_NAME_LEN + 1]; sprintf (s, "VAR%03d", i); - v = dict_create_var_assert (default_dict, s, 0); + v = dict_create_var_assert (dataset_dict (current_dataset), s, 0); } } else @@ -309,7 +309,7 @@ flip_sink_create (struct flip_pgm *flip) flip->case_cnt = 1; - return create_case_sink (&flip_sink_class, default_dict, flip); + return create_case_sink (&flip_sink_class, dataset_dict (current_dataset), flip); } /* Writes case C to the FLIP sink. diff --git a/src/language/stats/frequencies.q b/src/language/stats/frequencies.q index 5e9e1893..211498fc 100644 --- a/src/language/stats/frequencies.q +++ b/src/language/stats/frequencies.q @@ -391,7 +391,7 @@ internal_cmd_frequencies (void) /* Do it! */ - ok = procedure_with_splits (precalc, calc, postcalc, NULL); + ok = procedure_with_splits (current_dataset, precalc, calc, postcalc, NULL); free_frequencies(&cmd); @@ -511,7 +511,7 @@ calc (const struct ccase *c, void *aux UNUSED) size_t i; bool bad_warn = true; - weight = dict_get_case_weight (default_dict, c, &bad_warn); + weight = dict_get_case_weight (dataset_dict (current_dataset), c, &bad_warn); for (i = 0; i < n_variables; i++) { @@ -801,10 +801,10 @@ frq_custom_variables (struct cmd_frequencies *cmd UNUSED, void *aux UNUSED) lex_match ('='); if (token != T_ALL && (token != T_ID - || dict_lookup_var (default_dict, tokid) == NULL)) + || dict_lookup_var (dataset_dict (current_dataset), tokid) == NULL)) return 2; - if (!parse_variables (default_dict, &v_variables, &n_variables, + if (!parse_variables (dataset_dict (current_dataset), &v_variables, &n_variables, PV_APPEND | PV_NO_SCRATCH)) return 0; @@ -882,7 +882,7 @@ static int frq_custom_grouped (struct cmd_frequencies *cmd UNUSED, void *aux UNUSED) { lex_match ('='); - if ((token == T_ID && dict_lookup_var (default_dict, tokid) != NULL) + if ((token == T_ID && dict_lookup_var (dataset_dict (current_dataset), tokid) != NULL) || token == T_ID) for (;;) { @@ -896,7 +896,7 @@ frq_custom_grouped (struct cmd_frequencies *cmd UNUSED, void *aux UNUSED) size_t n; struct variable **v; - if (!parse_variables (default_dict, &v, &n, + if (!parse_variables (dataset_dict (current_dataset), &v, &n, PV_NO_DUPLICATE | PV_NUMERIC)) return 0; if (lex_match ('(')) @@ -949,7 +949,7 @@ frq_custom_grouped (struct cmd_frequencies *cmd UNUSED, void *aux UNUSED) free (v); if (!lex_match ('/')) break; - if ((token != T_ID || dict_lookup_var (default_dict, tokid) != NULL) + if ((token != T_ID || dict_lookup_var (dataset_dict (current_dataset), tokid) != NULL) && token != T_ALL) { lex_put_back ('/'); diff --git a/src/language/stats/means.q b/src/language/stats/means.q index 8405ff36..a8739bc2 100644 --- a/src/language/stats/means.q +++ b/src/language/stats/means.q @@ -128,7 +128,7 @@ mns_custom_tables (struct cmd_means *cmd, void *aux UNUSED) struct var_set *var_set; if (!lex_match_id ("TABLES") - && (token != T_ID || dict_lookup_var (default_dict, tokid) == NULL) + && (token != T_ID || dict_lookup_var (dataset_dict (current_dataset), tokid) == NULL) && token != T_ALL) return 2; lex_match ('='); @@ -140,7 +140,7 @@ mns_custom_tables (struct cmd_means *cmd, void *aux UNUSED) return 0; } - var_set = var_set_create_from_dict (default_dict); + var_set = var_set_create_from_dict (dataset_dict (current_dataset)); assert (var_set != NULL); do diff --git a/src/language/stats/oneway.q b/src/language/stats/oneway.q index bdf1ec90..0b75608a 100644 --- a/src/language/stats/oneway.q +++ b/src/language/stats/oneway.q @@ -149,7 +149,7 @@ cmd_oneway(void) } } - ok = multipass_procedure_with_splits (run_oneway, &cmd); + ok = multipass_procedure_with_splits (current_dataset, run_oneway, &cmd); free (vars); free_oneway (&cmd); @@ -228,12 +228,12 @@ oneway_custom_variables(struct cmd_oneway *cmd UNUSED, void *aux UNUSED) lex_match('='); - if ((token != T_ID || dict_lookup_var (default_dict, tokid) == NULL) + if ((token != T_ID || dict_lookup_var (dataset_dict (current_dataset), tokid) == NULL) && token != T_ALL) return 2; - if (!parse_variables (default_dict, &vars, &n_vars, + if (!parse_variables (dataset_dict (current_dataset), &vars, &n_vars, PV_DUPLICATE | PV_NUMERIC | PV_NO_SCRATCH) ) { @@ -917,7 +917,7 @@ run_oneway(const struct ccase *first, const struct casefile *cf, void *cmd_) size_t i; const double weight = - dict_get_case_weight (default_dict, &c, &bad_weight_warn); + dict_get_case_weight (dataset_dict (current_dataset), &c, &bad_weight_warn); const union value *indep_val = case_data (&c, indep_var->fv); diff --git a/src/language/stats/rank.q b/src/language/stats/rank.q index 491160b6..9441a19b 100644 --- a/src/language/stats/rank.q +++ b/src/language/stats/rank.q @@ -238,13 +238,13 @@ rank_cmd (const struct sort_criteria *sc, struct sort_criteria criteria; bool result = true; int i; - const int n_splits = dict_get_split_cnt (default_dict); + const int n_splits = dict_get_split_cnt (dataset_dict (current_dataset)); criteria.crit_cnt = n_splits + n_group_vars + 1; criteria.crits = xnmalloc (criteria.crit_cnt, sizeof *criteria.crits); for (i = 0; i < n_splits ; i++) { - struct variable *v = dict_get_split_vars (default_dict)[i]; + struct variable *v = dict_get_split_vars (dataset_dict (current_dataset))[i]; criteria.crits[i].fv = v->fv; criteria.crits[i].width = v->width; criteria.crits[i].dir = SRT_ASCEND; @@ -263,10 +263,10 @@ rank_cmd (const struct sort_criteria *sc, struct casefile *sorted_cf ; /* Obtain active file in CF. */ - if (!procedure (NULL, NULL)) + if (!procedure (current_dataset, NULL, NULL)) goto error; - cf = proc_capture_output (); + cf = proc_capture_output (current_dataset); /* Sort CF into SORTED_CF. */ reader = casefile_get_destructive_reader (cf) ; @@ -284,7 +284,7 @@ rank_cmd (const struct sort_criteria *sc, continue ; } - proc_set_source (storage_source_create (out)); + proc_set_source (current_dataset, storage_source_create (out)); } free (criteria.crits); @@ -516,7 +516,7 @@ rank_cases (struct casereader *cr, break; this_value = case_data (&this_case, fv); - c = dict_get_case_weight (default_dict, &this_case, &warn); + c = dict_get_case_weight (dataset_dict (current_dataset), &this_case, &warn); lookahead = casereader_clone (cr); n = 0; @@ -535,7 +535,7 @@ rank_cases (struct casereader *cr, break; } - c += dict_get_case_weight (default_dict, &lookahead_case, &warn); + c += dict_get_case_weight (dataset_dict (current_dataset), &lookahead_case, &warn); case_destroy (&lookahead_case); n++; } @@ -610,13 +610,13 @@ rank_sorted_casefile (struct casefile *cf, this_value = case_data( &group_case, ultimate_crit->fv); if ( !value_is_missing(mv, this_value) ) - w = dict_get_case_weight (default_dict, &group_case, &warn); + w = dict_get_case_weight (dataset_dict (current_dataset), &group_case, &warn); while (casereader_read (lookahead, &this_case)) { const union value *this_value = case_data(&this_case, ultimate_crit->fv); - double c = dict_get_case_weight (default_dict, &this_case, &warn); + double c = dict_get_case_weight (dataset_dict (current_dataset), &this_case, &warn); if (!same_group (&group_case, &this_case, crit)) { rank_cases (pos, casereader_cnum (lookahead) - 1, @@ -676,14 +676,14 @@ create_rank_variable (enum RANK_FUNC f, char name[SHORT_NAME_LEN + 1]; if ( vname ) - var = dict_create_var(default_dict, vname, 0); + var = dict_create_var(dataset_dict (current_dataset), vname, 0); if ( NULL == var ) { snprintf(name, SHORT_NAME_LEN + 1, "%c%s", function_name[f][0], src_var->name); - var = dict_create_var(default_dict, name, 0); + var = dict_create_var(dataset_dict (current_dataset), name, 0); } i = 1; @@ -694,7 +694,7 @@ create_rank_variable (enum RANK_FUNC f, snprintf(name, SHORT_NAME_LEN + 1, "%s%03d", func_abb, i); - var = dict_create_var(default_dict, name, 0); + var = dict_create_var(dataset_dict (current_dataset), name, 0); if (i++ >= 999) break; } @@ -708,7 +708,7 @@ create_rank_variable (enum RANK_FUNC f, snprintf(name, SHORT_NAME_LEN + 1, "RNK%s%02d", func_abb, i); - var = dict_create_var(default_dict, name, 0); + var = dict_create_var(dataset_dict (current_dataset), name, 0); if ( i++ >= 99 ) break; } @@ -891,9 +891,9 @@ cmd_rank(void) /* Add a variable which we can sort by to get back the original order */ - order = dict_create_var_assert (default_dict, "$ORDER_", 0); + order = dict_create_var_assert (dataset_dict (current_dataset), "$ORDER_", 0); - add_transformation (create_resort_key, 0, order); + add_transformation (current_dataset, create_resort_key, 0, order); /* Do the ranking */ result = rank_cmd (sc, rank_specs, n_rank_specs); @@ -913,7 +913,7 @@ cmd_rank(void) } /* ... and we don't need our sort key anymore. So delete it */ - dict_delete_var (default_dict, order); + dict_delete_var (dataset_dict (current_dataset), order); rank_cleanup(); @@ -930,21 +930,21 @@ rank_custom_variables(struct cmd_rank *cmd UNUSED, void *aux UNUSED) lex_match('='); - if ((token != T_ID || dict_lookup_var (default_dict, tokid) == NULL) + if ((token != T_ID || dict_lookup_var (dataset_dict (current_dataset), tokid) == NULL) && token != T_ALL) return 2; - sc = sort_parse_criteria (default_dict, + sc = sort_parse_criteria (dataset_dict (current_dataset), &src_vars, &n_src_vars, 0, terminators); if ( lex_match(T_BY) ) { - if ((token != T_ID || dict_lookup_var (default_dict, tokid) == NULL)) + if ((token != T_ID || dict_lookup_var (dataset_dict (current_dataset), tokid) == NULL)) { return 2; } - if (!parse_variables (default_dict, &group_vars, &n_group_vars, + if (!parse_variables (dataset_dict (current_dataset), &group_vars, &n_group_vars, PV_NO_DUPLICATE | PV_NUMERIC | PV_NO_SCRATCH) ) { free (group_vars); @@ -977,7 +977,7 @@ parse_rank_function(struct cmd_rank *cmd UNUSED, enum RANK_FUNC f) while( token == T_ID ) { - if ( dict_lookup_var (default_dict, tokid) != NULL ) + if ( dict_lookup_var (dataset_dict (current_dataset), tokid) != NULL ) { msg(SE, _("Variable %s already exists."), tokid); return 0; diff --git a/src/language/stats/regression.q b/src/language/stats/regression.q index 7b0e56ed..1690abc0 100644 --- a/src/language/stats/regression.q +++ b/src/language/stats/regression.q @@ -626,7 +626,7 @@ regression_trns_resid_proc (void *t_, struct ccase *c, static int try_name (char *name) { - if (dict_lookup_var (default_dict, name) != NULL) + if (dict_lookup_var (dataset_dict (current_dataset), name) != NULL) return 0; return 1; @@ -657,10 +657,10 @@ reg_save_var (const char *prefix, trns_proc_func * f, t->n_trns = n_trns; t->c = c; reg_get_name (name, prefix); - new_var = dict_create_var (default_dict, name, 0); + new_var = dict_create_var (dataset_dict (current_dataset), name, 0); assert (new_var != NULL); *v = new_var; - add_transformation (f, regression_trns_free, t); + add_transformation (current_dataset, f, regression_trns_free, t); trns_index++; } static void @@ -938,7 +938,7 @@ cmd_regression (void) return CMD_FAILURE; models = xnmalloc (cmd.n_dependent, sizeof *models); - if (!multipass_procedure_with_splits (run_regression, &cmd)) + if (!multipass_procedure_with_splits (current_dataset, run_regression, &cmd)) return CMD_CASCADING_FAILURE; subcommand_save (cmd.sbc_save, models); free (v_variables); @@ -1004,12 +1004,12 @@ regression_custom_variables (struct cmd_regression *cmd UNUSED, lex_match ('='); - if ((token != T_ID || dict_lookup_var (default_dict, tokid) == NULL) + if ((token != T_ID || dict_lookup_var (dataset_dict (current_dataset), tokid) == NULL) && token != T_ALL) return 2; - if (!parse_variables (default_dict, &v_variables, &n_variables, PV_NONE)) + if (!parse_variables (dataset_dict (current_dataset), &v_variables, &n_variables, PV_NONE)) { free (v_variables); return 0; @@ -1118,7 +1118,7 @@ run_regression (const struct ccase *first, if (!v_variables) { - dict_get_vars (default_dict, &v_variables, &n_variables, + dict_get_vars (dataset_dict (current_dataset), &v_variables, &n_variables, 1u << DC_SYSTEM); } diff --git a/src/language/stats/sort-cases.c b/src/language/stats/sort-cases.c index f50b67fe..8ebf4b28 100644 --- a/src/language/stats/sort-cases.c +++ b/src/language/stats/sort-cases.c @@ -47,7 +47,7 @@ cmd_sort_cases (void) lex_match (T_BY); - criteria = sort_parse_criteria (default_dict, NULL, NULL, NULL, NULL); + criteria = sort_parse_criteria (dataset_dict (current_dataset), NULL, NULL, NULL, NULL); if (criteria == NULL) return CMD_CASCADING_FAILURE; diff --git a/src/language/stats/t-test.q b/src/language/stats/t-test.q index 1f182ec8..492820cd 100644 --- a/src/language/stats/t-test.q +++ b/src/language/stats/t-test.q @@ -345,7 +345,7 @@ cmd_t_test(void) bad_weight_warn = true; - ok = multipass_procedure_with_splits (calculate, &cmd); + ok = multipass_procedure_with_splits (current_dataset, calculate, &cmd); n_pairs=0; free(pairs); @@ -459,7 +459,7 @@ tts_custom_pairs (struct cmd_t_test *cmd UNUSED, void *aux UNUSED) lex_match('='); n_vars=0; - if (!parse_variables (default_dict, &vars, &n_vars, + if (!parse_variables (dataset_dict (current_dataset), &vars, &n_vars, PV_DUPLICATE | PV_NUMERIC | PV_NO_SCRATCH)) { free (vars); @@ -471,7 +471,7 @@ tts_custom_pairs (struct cmd_t_test *cmd UNUSED, void *aux UNUSED) if (lex_match (T_WITH)) { n_before_WITH = n_vars; - if (!parse_variables (default_dict, &vars, &n_vars, + if (!parse_variables (dataset_dict (current_dataset), &vars, &n_vars, PV_DUPLICATE | PV_APPEND | PV_NUMERIC | PV_NO_SCRATCH)) { @@ -1416,7 +1416,7 @@ common_calc (const struct ccase *c, void *_cmd) int i; struct cmd_t_test *cmd = (struct cmd_t_test *)_cmd; - double weight = dict_get_case_weight (default_dict, c, &bad_weight_warn); + double weight = dict_get_case_weight (dataset_dict (current_dataset), c, &bad_weight_warn); /* Skip the entire case if /MISSING=LISTWISE is set */ @@ -1516,7 +1516,7 @@ one_sample_calc (const struct ccase *c, void *cmd_) struct cmd_t_test *cmd = (struct cmd_t_test *)cmd_; - double weight = dict_get_case_weight (default_dict, c, &bad_weight_warn); + double weight = dict_get_case_weight (dataset_dict (current_dataset), c, &bad_weight_warn); /* Skip the entire case if /MISSING=LISTWISE is set */ if ( cmd->miss == TTS_LISTWISE ) @@ -1606,7 +1606,7 @@ paired_calc (const struct ccase *c, void *cmd_) struct cmd_t_test *cmd = (struct cmd_t_test *) cmd_; - double weight = dict_get_case_weight (default_dict, c, &bad_weight_warn); + double weight = dict_get_case_weight (dataset_dict (current_dataset), c, &bad_weight_warn); /* Skip the entire case if /MISSING=LISTWISE is set , AND one member of a pair is missing */ @@ -1752,7 +1752,7 @@ group_calc (const struct ccase *c, struct cmd_t_test *cmd) const union value *gv = case_data (c, indep_var->fv); const double weight = - dict_get_case_weight (default_dict, c, &bad_weight_warn); + dict_get_case_weight (dataset_dict (current_dataset), c, &bad_weight_warn); if ( value_is_missing(&indep_var->miss, gv) ) { diff --git a/src/language/utilities/set.q b/src/language/utilities/set.q index f44a7a93..685b3152 100644 --- a/src/language/utilities/set.q +++ b/src/language/utilities/set.q @@ -603,7 +603,7 @@ show_undefined (void) static void show_weight (void) { - struct variable *var = dict_get_weight (default_dict); + struct variable *var = dict_get_weight (dataset_dict (current_dataset)); if (var == NULL) msg (SN, _("WEIGHT is off.")); else diff --git a/src/language/utilities/title.c b/src/language/utilities/title.c index 18e4bb27..ffb2a48e 100644 --- a/src/language/utilities/title.c +++ b/src/language/utilities/title.c @@ -97,13 +97,13 @@ cmd_file_label (void) while (isspace ((unsigned char) *label)) label++; - dict_set_label (default_dict, label); + dict_set_label (dataset_dict (current_dataset), label); token = '.'; return CMD_SUCCESS; } -/* Add LINE as a line of document information to default_dict, +/* Add LINE as a line of document information to dataset_dict (current_dataset), indented by INDENT spaces. */ static void add_document_line (const char *line, int indent) @@ -112,7 +112,7 @@ add_document_line (const char *line, int indent) size_t old_len; char *new_documents; - old_documents = dict_get_documents (default_dict); + old_documents = dict_get_documents (dataset_dict (current_dataset)); old_len = old_documents != NULL ? strlen (old_documents) : 0; new_documents = xmalloc (old_len + 81); @@ -121,7 +121,7 @@ add_document_line (const char *line, int indent) buf_copy_str_rpad (new_documents + old_len + indent, 80 - indent, line); new_documents[old_len + 80] = '\0'; - dict_set_documents (default_dict, new_documents); + dict_set_documents (dataset_dict (current_dataset), new_documents); free (new_documents); } @@ -134,7 +134,7 @@ cmd_document (void) { char buf[256]; - if (dict_get_documents (default_dict) != NULL) + if (dict_get_documents (dataset_dict (current_dataset)) != NULL) add_document_line ("", 0); sprintf (buf, _("Document entered %s by %s:"), get_start_date (), version); @@ -173,7 +173,7 @@ cmd_document (void) int cmd_drop_documents (void) { - dict_set_documents (default_dict, NULL); + dict_set_documents (dataset_dict (current_dataset), NULL); return lex_end_of_command (); } diff --git a/src/language/xforms/compute.c b/src/language/xforms/compute.c index f24ecac5..c4ea4c5a 100644 --- a/src/language/xforms/compute.c +++ b/src/language/xforms/compute.c @@ -94,7 +94,8 @@ cmd_compute (void) if (compute->rvalue == NULL) goto fail; - add_transformation (get_proc_func (lvalue), compute_trns_free, compute); + add_transformation (current_dataset, + get_proc_func (lvalue), compute_trns_free, compute); lvalue_finalize (lvalue, compute); @@ -219,7 +220,7 @@ cmd_if (void) compute = compute_trns_create (); /* Test expression. */ - compute->test = expr_parse (default_dict, EXPR_BOOLEAN); + compute->test = expr_parse (dataset_dict (current_dataset), EXPR_BOOLEAN); if (compute->test == NULL) goto fail; @@ -235,7 +236,8 @@ cmd_if (void) if (compute->rvalue == NULL) goto fail; - add_transformation (get_proc_func (lvalue), compute_trns_free, compute); + add_transformation (current_dataset, + get_proc_func (lvalue), compute_trns_free, compute); lvalue_finalize (lvalue, compute); @@ -267,7 +269,7 @@ parse_rvalue (const struct lvalue *lvalue) { bool is_numeric = lvalue_get_type (lvalue) == NUMERIC; - return expr_parse (default_dict, is_numeric ? EXPR_NUMBER : EXPR_STRING); + return expr_parse (dataset_dict (current_dataset), is_numeric ? EXPR_NUMBER : EXPR_STRING); } /* Returns a new struct compute_trns after initializing its fields. */ @@ -325,7 +327,7 @@ lvalue_parse (void) if (lex_look_ahead () == '(') { /* Vector. */ - lvalue->vector = dict_lookup_vector (default_dict, tokid); + lvalue->vector = dict_lookup_vector (dataset_dict (current_dataset), tokid); if (lvalue->vector == NULL) { msg (SE, _("There is no vector named %s."), tokid); @@ -336,7 +338,7 @@ lvalue_parse (void) lex_get (); if (!lex_force_match ('(')) goto lossage; - lvalue->element = expr_parse (default_dict, EXPR_NUMBER); + lvalue->element = expr_parse (dataset_dict (current_dataset), EXPR_NUMBER); if (lvalue->element == NULL) goto lossage; if (!lex_force_match (')')) @@ -362,7 +364,7 @@ lvalue_get_type (const struct lvalue *lvalue) { if (lvalue->vector == NULL) { - struct variable *var = dict_lookup_var (default_dict, lvalue->var_name); + struct variable *var = dict_lookup_var (dataset_dict (current_dataset), lvalue->var_name); if (var == NULL) return NUMERIC; else @@ -386,9 +388,9 @@ lvalue_finalize (struct lvalue *lvalue, struct compute_trns *compute) { if (lvalue->vector == NULL) { - compute->variable = dict_lookup_var (default_dict, lvalue->var_name); + compute->variable = dict_lookup_var (dataset_dict (current_dataset), lvalue->var_name); if (compute->variable == NULL) - compute->variable = dict_create_var_assert (default_dict, + compute->variable = dict_create_var_assert (dataset_dict (current_dataset), lvalue->var_name, 0); compute->fv = compute->variable->fv; diff --git a/src/language/xforms/count.c b/src/language/xforms/count.c index 8f6c8f62..716c5d39 100644 --- a/src/language/xforms/count.c +++ b/src/language/xforms/count.c @@ -117,7 +117,7 @@ cmd_count (void) /* Get destination variable, or at least its name. */ if (!lex_force_id ()) goto fail; - dv->var = dict_lookup_var (default_dict, tokid); + dv->var = dict_lookup_var (dataset_dict (current_dataset), tokid); if (dv->var != NULL) { if (dv->var->type == ALPHA) @@ -140,7 +140,7 @@ cmd_count (void) crit->next = NULL; crit->vars = NULL; - if (!parse_variables (default_dict, &crit->vars, &crit->var_cnt, + if (!parse_variables (dataset_dict (current_dataset), &crit->vars, &crit->var_cnt, PV_DUPLICATE | PV_SAME_TYPE)) goto fail; pool_register (trns->pool, free, crit->vars); @@ -176,13 +176,13 @@ cmd_count (void) { /* It's valid, though motivationally questionable, to count to the same dest var more than once. */ - dv->var = dict_lookup_var (default_dict, dv->name); + dv->var = dict_lookup_var (dataset_dict (current_dataset), dv->name); if (dv->var == NULL) - dv->var = dict_create_var_assert (default_dict, dv->name, 0); + dv->var = dict_create_var_assert (dataset_dict (current_dataset), dv->name, 0); } - add_transformation (count_trns_proc, count_trns_free, trns); + add_transformation (current_dataset, count_trns_proc, count_trns_free, trns); return CMD_SUCCESS; fail: diff --git a/src/language/xforms/fail.c b/src/language/xforms/fail.c index 153ff42e..ebc30e9c 100644 --- a/src/language/xforms/fail.c +++ b/src/language/xforms/fail.c @@ -45,7 +45,7 @@ int cmd_debug_xform_fail (void) { - add_transformation (trns_fail, NULL, NULL); + add_transformation (current_dataset, trns_fail, NULL, NULL); return lex_end_of_command (); } diff --git a/src/language/xforms/recode.c b/src/language/xforms/recode.c index 05cd3d1c..69443961 100644 --- a/src/language/xforms/recode.c +++ b/src/language/xforms/recode.c @@ -167,7 +167,8 @@ cmd_recode (void) create_dst_vars (trns); /* Done. */ - add_transformation (recode_trns_proc, recode_trns_free, trns); + add_transformation (current_dataset, + recode_trns_proc, recode_trns_free, trns); } while (lex_match ('/')); @@ -180,7 +181,7 @@ cmd_recode (void) static bool parse_src_vars (struct recode_trns *trns) { - if (!parse_variables (default_dict, &trns->src_vars, &trns->var_cnt, + if (!parse_variables (dataset_dict (current_dataset), &trns->src_vars, &trns->var_cnt, PV_SAME_TYPE)) return false; pool_register (trns->pool, free, trns->src_vars); @@ -441,7 +442,7 @@ parse_dst_vars (struct recode_trns *trns) for (i = 0; i < trns->var_cnt; i++) { struct variable *v; - v = trns->dst_vars[i] = dict_lookup_var (default_dict, + v = trns->dst_vars[i] = dict_lookup_var (dataset_dict (current_dataset), trns->dst_names[i]); if (v == NULL && trns->dst_type == ALPHA) { @@ -524,9 +525,9 @@ create_dst_vars (struct recode_trns *trns) struct variable **var = &trns->dst_vars[i]; const char *name = trns->dst_names[i]; - *var = dict_lookup_var (default_dict, name); + *var = dict_lookup_var (dataset_dict (current_dataset), name); if (*var == NULL) - *var = dict_create_var_assert (default_dict, name, 0); + *var = dict_create_var_assert (dataset_dict (current_dataset), name, 0); assert ((*var)->type == trns->dst_type); } } diff --git a/src/language/xforms/sample.c b/src/language/xforms/sample.c index 8b0650d5..9daa69e2 100644 --- a/src/language/xforms/sample.c +++ b/src/language/xforms/sample.c @@ -111,7 +111,7 @@ cmd_sample (void) trns->N = b; trns->m = trns->t = 0; trns->frac = frac; - add_transformation (sample_trns_proc, sample_trns_free, trns); + add_transformation (current_dataset, sample_trns_proc, sample_trns_free, trns); return lex_end_of_command (); } diff --git a/src/language/xforms/select-if.c b/src/language/xforms/select-if.c index 7acb3ec0..8e4c0e91 100644 --- a/src/language/xforms/select-if.c +++ b/src/language/xforms/select-if.c @@ -52,7 +52,7 @@ cmd_select_if (void) struct expression *e; struct select_if_trns *t; - e = expr_parse (default_dict, EXPR_BOOLEAN); + e = expr_parse (dataset_dict (current_dataset), EXPR_BOOLEAN); if (!e) return CMD_CASCADING_FAILURE; @@ -65,7 +65,7 @@ cmd_select_if (void) t = xmalloc (sizeof *t); t->e = e; - add_transformation (select_if_proc, select_if_free, t); + add_transformation (current_dataset, select_if_proc, select_if_free, t); return CMD_SUCCESS; } @@ -95,12 +95,12 @@ int cmd_filter (void) { if (lex_match_id ("OFF")) - dict_set_filter (default_dict, NULL); + dict_set_filter (dataset_dict (current_dataset), NULL); else if (token == '.') { msg (SW, _("Syntax error expecting OFF or BY. " "Turning off case filtering.")); - dict_set_filter (default_dict, NULL); + dict_set_filter (dataset_dict (current_dataset), NULL); } else { @@ -123,7 +123,7 @@ cmd_filter (void) return CMD_FAILURE; } - dict_set_filter (default_dict, v); + dict_set_filter (dataset_dict (current_dataset), v); } return lex_end_of_command (); diff --git a/src/math/levene.c b/src/math/levene.c index 92044010..f30d51df 100644 --- a/src/math/levene.c +++ b/src/math/levene.c @@ -191,7 +191,7 @@ levene_calc (const struct ccase *c, void *_l) struct levene_info *l = (struct levene_info *) _l; const union value *gv = case_data (c, l->v_indep->fv); struct group_statistics key; - double weight = dict_get_case_weight (default_dict, c, &warn); + double weight = dict_get_case_weight (dataset_dict (current_dataset), c, &warn); /* Skip the entire case if /MISSING=LISTWISE is set */ if ( l->missing == LEV_LISTWISE ) @@ -295,7 +295,7 @@ levene2_calc (const struct ccase *c, void *_l) struct levene_info *l = (struct levene_info *) _l; - double weight = dict_get_case_weight (default_dict, c, &warn); + double weight = dict_get_case_weight (dataset_dict (current_dataset), c, &warn); const union value *gv = case_data (c, l->v_indep->fv); struct group_statistics key; diff --git a/src/math/sort.c b/src/math/sort.c index 90bbdf64..3f42c23d 100644 --- a/src/math/sort.c +++ b/src/math/sort.c @@ -63,7 +63,7 @@ static struct casefile *do_external_sort (struct casereader *, static void prepare_to_sort_active_file (void) { - proc_cancel_temporary_transformations (); + proc_cancel_temporary_transformations (current_dataset); } /* Sorts the active file in-place according to CRITERIA. @@ -74,15 +74,15 @@ sort_active_file_in_place (const struct sort_criteria *criteria) struct casefile *in, *out; prepare_to_sort_active_file (); - if (!procedure (NULL, NULL)) + if (!procedure (current_dataset,NULL, NULL)) return false; - in = proc_capture_output (); + in = proc_capture_output (current_dataset); out = sort_execute (casefile_get_destructive_reader (in), criteria); if (out == NULL) return false; - proc_set_source (storage_source_create (out)); + proc_set_source (current_dataset, storage_source_create (out)); return true; } @@ -114,7 +114,7 @@ sort_active_file_to_casefile (const struct sort_criteria *criteria) cb_data.criteria = criteria; cb_data.output = NULL; - if (!multipass_procedure (sort_to_casefile_callback, &cb_data)) + if (!multipass_procedure (current_dataset,sort_to_casefile_callback, &cb_data)) { casefile_destroy (cb_data.output); return NULL; diff --git a/src/ui/terminal/main.c b/src/ui/terminal/main.c index edc59edd..3450ac9d 100644 --- a/src/ui/terminal/main.c +++ b/src/ui/terminal/main.c @@ -93,7 +93,7 @@ main (int argc, char **argv) readln_initialize (); settings_init (); random_init (); - proc_init (); + current_dataset = create_dataset (); if (parse_command_line (argc, argv)) { @@ -102,7 +102,7 @@ main (int argc, char **argv) for (;;) { - int result = cmd_parse (proc_has_source () + int result = cmd_parse (proc_has_source (current_dataset) ? CMD_STATE_DATA : CMD_STATE_INITIAL); if (result == CMD_EOF || result == CMD_FINISH) break; @@ -178,7 +178,7 @@ terminate (bool success) { terminating = true; - proc_done (); + destroy_dataset (current_dataset); random_done (); settings_done ();