/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
return source;
}
-/* Destroys case source SOURCE. It is the caller's responsible to
- call the source's destroy function, if any. */
-void
+/* Destroys case source SOURCE.
+ Returns true if successful,
+ false if the source encountered an I/O error during
+ destruction or reading cases. */
+bool
free_case_source (struct case_source *source)
{
+ bool ok = true;
if (source != NULL)
{
if (source->class->destroy != NULL)
- source->class->destroy (source);
+ ok = source->class->destroy (source);
free (source);
}
+ return ok;
}
-/* Returns nonzero if CLASS is the class of SOURCE. */
-int
+/* Returns true if CLASS is the class of SOURCE. */
+bool
case_source_is_class (const struct case_source *source,
const struct case_source_class *class)
{