Add datasheet.
[pspp-builds.git] / src / data / case-source.c
index 21413fe2a5a0bed7bc79b3f65bd0d152790576e5..542f3008f8f5f234538694bd59d2f39a04514d1e 100644 (file)
@@ -1,6 +1,5 @@
 /* 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
@@ -37,21 +36,25 @@ create_case_source (const struct case_source_class *class,
   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) 
 {