/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011, 2012, 2013, 2016 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
add_transformation (ds, data_list_trns_proc, data_list_trns_free, trns);
}
else
- data_parser_make_active_file (parser, ds, reader, dict);
+ data_parser_make_active_file (parser, dataset_session (ds), reader, dict);
fh_unref (fh);
free (encoding);
#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 *
#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. */
/* 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 dataset *,
+void data_parser_make_active_file (struct data_parser *, struct session *,
struct dfm_reader *, struct dictionary *);
#endif /* language/data-io/data-parser.h */