- struct pfm_var *v = &w->vars[i];
-
- if (v->width == 0)
- write_float (w, case_num (c, v->fv));
- else
- {
- write_int (w, v->width);
- buf_write (w, case_str (c, v->fv), v->width);
- }
+ dict_get_document_line (dict, i, &line);
+ write_string (w, ds_cstr (&line));
+ }
+ ds_destroy (&line);
+}
+
+/* Writes case C to the portable file represented by WRITER. */
+static void
+por_file_casewriter_write (struct casewriter *writer, void *w_,
+ struct ccase *c)
+{
+ struct pfm_writer *w = w_;
+ int i;
+
+ if (!ferror (w->file))
+ {
+ for (i = 0; i < w->var_cnt; i++)
+ {
+ struct pfm_var *v = &w->vars[i];
+
+ if (v->width == 0)
+ write_float (w, case_num_idx (c, v->fv));
+ else
+ {
+ write_int (w, v->width);
+ buf_write (w, case_str_idx (c, v->fv), v->width);
+ }
+ }