X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flanguage%2Fstats%2Fflip.c;h=283a2266a4568a5c57a8fe2354620cf51d51bf31;hb=4010cd95ae15efa542a324c4c2081b19ab10b902;hp=534efb4919c05c64bbb31d1c0f9d50cd3f3f7635;hpb=81579d9e9f994fb2908f50af41c3eb033d216e58;p=pspp-builds.git
diff --git a/src/language/stats/flip.c b/src/language/stats/flip.c
index 534efb49..283a2266 100644
--- a/src/language/stats/flip.c
+++ b/src/language/stats/flip.c
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
-#include "config.h"
+#include
#include
#include
@@ -25,8 +25,8 @@
#include "data/case.h"
#include "data/casereader.h"
#include "data/casereader-provider.h"
+#include "data/dataset.h"
#include "data/dictionary.h"
-#include "data/procedure.h"
#include "data/settings.h"
#include "data/short-names.h"
#include "data/value.h"
@@ -158,7 +158,7 @@ cmd_flip (struct lexer *lexer, struct dataset *ds)
var_names_add (flip->pool, &flip->old_names,
pool_strdup (flip->pool, var_get_name (vars[i])));
- /* Read the active file into a flip_sink. */
+ /* Read the active dataset into a flip_sink. */
proc_discard_output (ds);
input = proc_open (ds);
@@ -198,7 +198,7 @@ cmd_flip (struct lexer *lexer, struct dataset *ds)
/* Flip the data we read. */
if (!ok || !flip_file (flip))
{
- proc_discard_active_file (ds);
+ dataset_clear (ds);
goto error;
}
@@ -219,8 +219,8 @@ cmd_flip (struct lexer *lexer, struct dataset *ds)
reader = casereader_create_sequential (NULL, dict_get_proto (dict),
flip->n_vars,
&flip_casereader_class, flip);
- proc_set_active_file_data (ds, reader);
- return lex_end_of_command (lexer);
+ dataset_set_source (ds, reader);
+ return CMD_SUCCESS;
error:
destroy_flip_pgm (flip);
@@ -249,7 +249,7 @@ make_new_var (struct dictionary *dict, const char *name_)
*--cp = '\0';
/* Fix invalid characters. */
- for (cp = name; *cp && cp < name + VAR_NAME_LEN; cp++)
+ for (cp = name; *cp && cp < name + ID_MAX_LEN; cp++)
if (cp == name)
{
if (!lex_is_id1 (*cp) || *cp == '$')
@@ -270,8 +270,8 @@ make_new_var (struct dictionary *dict, const char *name_)
int i;
for (i = 1; ; i++)
{
- char n[VAR_NAME_LEN + 1];
- int ofs = MIN (VAR_NAME_LEN - 1 - intlog10 (i), len);
+ char n[ID_MAX_LEN + 1];
+ int ofs = MIN (ID_MAX_LEN - 1 - intlog10 (i), len);
strncpy (n, name, ofs);
sprintf (&n[ofs], "%d", i);