Revert "work on datasets"
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 29 Feb 2016 01:58:59 +0000 (17:58 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 13 Mar 2016 17:24:33 +0000 (10:24 -0700)
This reverts commit 010daea9171954c6e003ff96b29b67c027e56ced.

src/language/data-io/data-list.c
src/language/data-io/data-parser.c
src/language/data-io/data-parser.h
src/language/data-io/get-data.c

index 31856b795401b5979339bb6ded1e6eb042f3e9b1..90d060eaab66721a8462fcb81baa351494177441 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011, 2012, 2013, 2016 Free Software Foundation, Inc.
+   Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -293,7 +293,7 @@ cmd_data_list (struct lexer *lexer, struct dataset *ds)
       add_transformation (ds, data_list_trns_proc, data_list_trns_free, trns);
     }
   else
-    data_parser_make_active_file (parser, dataset_session (ds), reader, dict);
+    data_parser_make_active_file (parser, ds, reader, dict);
 
   fh_unref (fh);
   free (encoding);
index f7657e2c8e7bf34b38c202ceaaceb4aa62199a3f..960505a5ce25f322931f1e8050161f72f0698ede 100644 (file)
@@ -27,7 +27,6 @@
 #include "data/dictionary.h"
 #include "data/format.h"
 #include "data/file-handle-def.h"
-#include "data/session.h"
 #include "data/settings.h"
 #include "language/data-io/data-reader.h"
 #include "libpspp/message.h"
@@ -734,13 +733,13 @@ struct data_parser_casereader
 
 static const struct casereader_class data_parser_casereader_class;
 
-/* Creates a new unnamed dataset in SESSION.  The new dataset has an input
-   program that reads data from READER according to the rules in PARSER, using
-   DICT as the underlying dictionary.  Transfers ownership of PARSER and READER
-   is to the input program, and ownership of DICT to the dataset. */
+/* Replaces DS's active dataset by an input program that reads data
+   from READER according to the rules in PARSER, using DICT as
+   the underlying dictionary.  Ownership of PARSER and READER is
+   transferred to the input program, and ownership of DICT is
+   transferred to the dataset. */
 void
-data_parser_make_active_file (struct data_parser *parser,
-                              struct session *session,
+data_parser_make_active_file (struct data_parser *parser, struct dataset *ds,
                               struct dfm_reader *reader,
                               struct dictionary *dict)
 {
@@ -754,11 +753,8 @@ data_parser_make_active_file (struct data_parser *parser,
   casereader = casereader_create_sequential (NULL, r->proto,
                                              CASENUMBER_MAX,
                                              &data_parser_casereader_class, r);
-
-  struct dataset *ds = dataset_create (session, "");
   dataset_set_dict (ds, dict);
   dataset_set_source (ds, casereader);
-  session_set_active_dataset (session, ds);
 }
 
 static struct ccase *
index 023538abc6b95b694ad364b7f9ec2880a0bec346..560eed30a22ec4e384e6f244199f80d3e01f8f41 100644 (file)
 #include "data/case.h"
 #include "libpspp/str.h"
 
+struct dataset;
 struct dfm_reader;
 struct dictionary;
 struct file_handle;
 struct fmt_spec;
-struct session;
 struct substring;
 
 /* Type of data read by a data parser. */
@@ -76,7 +76,7 @@ bool data_parser_parse (struct data_parser *,
 /* Uses for a configured parser. */
 void data_parser_output_description (struct data_parser *,
                                      const struct file_handle *);
-void data_parser_make_active_file (struct data_parser *, struct session *,
+void data_parser_make_active_file (struct data_parser *, struct dataset *,
                                    struct dfm_reader *, struct dictionary *);
 
 #endif /* language/data-io/data-parser.h */
index 3b6dd56984be64d32dcc7aa9636b9cc16683bc38..f2c294264ce951c5e66597d5a66cd0cfd55f8e69 100644 (file)
@@ -681,7 +681,7 @@ parse_get_txt (struct lexer *lexer, struct dataset *ds)
   if (reader == NULL)
     goto error;
 
-  data_parser_make_active_file (parser, dataset_session (ds), reader, dict);
+  data_parser_make_active_file (parser, ds, reader, dict);
   fh_unref (fh);
   free (encoding);
   return CMD_SUCCESS;