+ fwrite (field.string, field.length, 1, csv->file);
+}
+
+static void
+csv_output_field (struct csv_driver *csv, const char *field)
+{
+ csv_output_field__ (csv, ss_cstr (field));
+}
+
+static void
+csv_put_separator (struct csv_driver *csv)
+{
+ if (csv->n_items++ > 0)
+ putc ('\n', csv->file);
+}
+
+static void
+csv_output_lines (struct csv_driver *csv, const char *text_)
+{
+ struct substring text = ss_cstr (text_);
+ struct substring line;
+ size_t save_idx = 0;
+ while (ss_separate (text, ss_cstr ("\n"), &save_idx, &line))
+ {
+ csv_output_field__ (csv, line);
+ putc ('\n', csv->file);
+ }