projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Issue an error if no valid data are found
[pspp-builds.git]
/
src
/
language
/
data-io
/
data-list.c
diff --git
a/src/language/data-io/data-list.c
b/src/language/data-io/data-list.c
index 00cbb0c92c9413f64e557cfe303800c1a2e4b334..9594ead0759b888427a184e5c75322e55cac1eb7 100644
(file)
--- a/
src/language/data-io/data-list.c
+++ b/
src/language/data-io/data-list.c
@@
-806,13
+806,11
@@
data_list_trns_proc (void *dls_, struct ccase *c, casenumber case_num UNUSED)
return retval;
}
\f
return retval;
}
\f
-/* Reads
all the records from the data file and passes them to
- write_case().
-
Returns true if successful, false if an
I/O error occurred. */
+/* Reads
one case into OUTPUT_CASE.
+ Returns true if successful, false at end of file or if an
+ I/O error occurred. */
static bool
static bool
-data_list_source_read (struct case_source *source,
- struct ccase *c,
- write_case_func *write_case, write_case_data wc_data)
+data_list_source_read (struct case_source *source, struct ccase *c)
{
struct data_list_pgm *dls = source->aux;
{
struct data_list_pgm *dls = source->aux;
@@
-826,26
+824,19
@@
data_list_source_read (struct case_source *source,
dls->skip_records--;
}
dls->skip_records--;
}
- for (;;)
- {
- bool ok;
-
- if (!read_from_data_list (dls, c))
- return !dfm_reader_error (dls->reader);
-
- dfm_push (dls->reader);
- ok = write_case (wc_data);
- dfm_pop (dls->reader);
- if (!ok)
- return false;
- }
+ return read_from_data_list (dls, c);
}
}
-/* Destroys the source's internal data. */
-static void
+/* Destroys the source.
+ Returns true if successful read, false if an I/O occurred
+ during destruction or previously. */
+static bool
data_list_source_destroy (struct case_source *source)
{
data_list_source_destroy (struct case_source *source)
{
- data_list_trns_free (source->aux);
+ struct data_list_pgm *dls = source->aux;
+ bool ok = !dfm_reader_error (dls->reader);
+ data_list_trns_free (dls);
+ return ok;
}
static const struct case_source_class data_list_source_class =
}
static const struct case_source_class data_list_source_class =