#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"
static const struct casereader_class data_parser_casereader_class;
-/* 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. */
+/* 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. */
void
-data_parser_make_active_file (struct data_parser *parser, struct dataset *ds,
+data_parser_make_active_file (struct data_parser *parser,
+ struct session *session,
struct dfm_reader *reader,
struct dictionary *dict)
{
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 *