Added the ECHO command.
[pspp] / src / casefile.c
index fdf033cbae672c7ae29135dd7d2cb62c8f0031a2..689e2b1302cb3ed8b540e94f8ebe3a6b6809a1b1 100644 (file)
@@ -30,6 +30,7 @@
 #include "case.h"
 #include "error.h"
 #include "misc.h"
+#include "mkfile.h"
 #include "settings.h"
 #include "var.h"
 
@@ -534,7 +535,8 @@ casereader_get_casefile (const struct casereader *reader)
 }
 
 /* Reads a copy of the next case from READER into C.
-   Caller is responsible for destroying C. */
+   Caller is responsible for destroying C.
+   Returns true if successful, false at end of file. */
 int
 casereader_read (struct casereader *reader, struct ccase *c) 
 {
@@ -571,7 +573,8 @@ casereader_read (struct casereader *reader, struct ccase *c)
 }
 
 /* Reads the next case from READER into C and transfers ownership
-   to the caller.  Caller is responsible for destroying C. */
+   to the caller.  Caller is responsible for destroying C.
+   Returns true if successful, false at end of file. */
 int
 casereader_read_xfer (struct casereader *reader, struct ccase *c)
 {
@@ -593,6 +596,16 @@ casereader_read_xfer (struct casereader *reader, struct ccase *c)
     }
 }
 
+/* Reads the next case from READER into C and transfers ownership
+   to the caller.  Caller is responsible for destroying C.
+   Assert-fails at end of file. */
+void
+casereader_read_xfer_assert (struct casereader *reader, struct ccase *c) 
+{
+  bool success = casereader_read_xfer (reader, c);
+  assert (success);
+}
+
 /* Destroys READER. */
 void
 casereader_destroy (struct casereader *reader)