- tab_dim (t, tab_natural_dimensions);
- for (nspec = recno = 0, spec = prt.spec; spec; spec = spec->next)
- switch (spec->type)
- {
- case PRT_NEWLINE:
- recno++;
- break;
- case PRT_CONST:
- {
- int len = strlen (spec->u.c);
- nspec++;
- tab_text (t, 0, nspec, TAB_LEFT | TAB_FIX | TAT_PRINTF,
- "\"%s\"", spec->u.c);
- tab_text (t, 1, nspec, TAT_PRINTF, "%d", recno + 1);
- tab_text (t, 2, nspec, TAT_PRINTF, "%3d-%3d",
- spec->fc + 1, spec->fc + len);
- tab_text (t, 3, nspec, TAB_LEFT | TAB_FIX | TAT_PRINTF,
- "A%d", len);
- break;
- }
- case PRT_VAR:
- {
- nspec++;
- tab_text (t, 0, nspec, TAB_LEFT, spec->u.v.v->name);
- tab_text (t, 1, nspec, TAT_PRINTF, "%d", recno + 1);
- tab_text (t, 2, nspec, TAT_PRINTF, "%3d-%3d",
- spec->fc + 1, spec->fc + spec->u.v.f.w);
- tab_text (t, 3, nspec, TAB_LEFT | TAB_FIX,
- fmt_to_string (&spec->u.v.f));
- break;
- }
- case PRT_SPACE:
- break;
- case PRT_ERROR:
- NOT_REACHED ();
- }
-
- if (fh != NULL)
- tab_title (t, ngettext ("Writing %d record to %s.",
- "Writing %d records to %s.", recno),
- recno, fh_get_name (fh));
- else
- tab_title (t, ngettext ("Writing %d record.",
- "Writing %d records.", recno), recno);
- tab_submit (t);
-}
-
-/* Calculates the maximum possible line width and allocates a buffer
- big enough to contain it */
-static void
-alloc_line (void)
-{
- /* Cumulative maximum line width (excluding null terminator) so far. */
- int w = 0;
-
- /* Width required by current this prt_out_spec. */
- int pot_w; /* Potential w. */
-
- /* Iterator. */
- struct prt_out_spec *i;
-
- for (i = prt.spec; i; i = i->next)