-static int
-ascii_postopen_driver (struct outp_driver *this)
-{
- struct ascii_driver_ext *x = this->ext;
-
- assert (this->driver_open == 0);
-
- if (NULL == x->file.filename)
- x->file.filename = xstrdup ("pspp.list");
-
- x->w = x->page_width - x->left_margin - x->right_margin;
- x->l = (x->page_length - (x->headers ? 3 : 0) - x->top_margin
- - x->bottom_margin - 1);
- if (x->w < 59 || x->l < 15)
- {
- msg (SE, _("ascii driver: Area of page excluding margins and headers "
- "must be at least 59 characters wide by 15 lines long. Page as "
- "configured is only %d characters by %d lines."), x->w, x->l);
- return 0;
- }
-
- this->res = x->lpi * x->cpi;
- this->horiz = x->lpi;
- this->vert = x->cpi;
- this->width = x->w * this->horiz;
- this->length = x->l * this->vert;
-
- if (ls_null_p (&x->ops[OPS_FORMFEED]))
- ls_create (&x->ops[OPS_FORMFEED], "\f");
- if (ls_null_p (&x->ops[OPS_NEWLINE])
- || !strcmp (ls_c_str (&x->ops[OPS_NEWLINE]), "default"))
- {
- ls_create (&x->ops[OPS_NEWLINE], "\n");
- x->file.mode = "wt";
- }
-
- {
- int i;
-
- for (i = 0; i < LNS_COUNT; i++)
- {
- char c[2];
- c[1] = 0;
- if (!ls_null_p (&x->box[i]))
- continue;
- switch (i)
- {
- case TAYSTE2BYTE (0, 0, 0, 0):
- c[0] = ' ';
- break;
-
- case TAYSTE2BYTE (0, 1, 0, 0):
- case TAYSTE2BYTE (0, 1, 0, 1):
- case TAYSTE2BYTE (0, 0, 0, 1):
- c[0] = '-';
- break;
-
- case TAYSTE2BYTE (1, 0, 0, 0):
- case TAYSTE2BYTE (1, 0, 1, 0):
- case TAYSTE2BYTE (0, 0, 1, 0):
- c[0] = '|';
- break;
-
- case TAYSTE2BYTE (0, 3, 0, 0):
- case TAYSTE2BYTE (0, 3, 0, 3):
- case TAYSTE2BYTE (0, 0, 0, 3):
- case TAYSTE2BYTE (0, 2, 0, 0):
- case TAYSTE2BYTE (0, 2, 0, 2):
- case TAYSTE2BYTE (0, 0, 0, 2):
- c[0] = '=';
- break;
-
- case TAYSTE2BYTE (3, 0, 0, 0):
- case TAYSTE2BYTE (3, 0, 3, 0):
- case TAYSTE2BYTE (0, 0, 3, 0):
- case TAYSTE2BYTE (2, 0, 0, 0):
- case TAYSTE2BYTE (2, 0, 2, 0):
- case TAYSTE2BYTE (0, 0, 2, 0):
- c[0] = '#';
- break;
-
- default:
- if (BYTE2TAYSTE (i, LNS_LEFT) > 1
- || BYTE2TAYSTE (i, LNS_TOP) > 1
- || BYTE2TAYSTE (i, LNS_RIGHT) > 1
- || BYTE2TAYSTE (i, LNS_BOTTOM) > 1)
- c[0] = '#';
- else
- c[0] = '+';
- break;
- }
- ls_create (&x->box[i], c);
- }
- }
-
- {
- int i;
-
- this->cp_x = this->cp_y = 0;
- this->font_height = this->vert;
- this->prop_em_width = this->horiz;
- this->fixed_width = this->horiz;
-
- this->horiz_line_width[0] = 0;
- this->vert_line_width[0] = 0;
-
- for (i = 1; i < OUTP_L_COUNT; i++)
- {
- this->horiz_line_width[i] = this->vert;
- this->vert_line_width[i] = this->horiz;
- }
-
- for (i = 0; i < (1 << OUTP_L_COUNT); i++)
- {
- this->horiz_line_spacing[i] = (i & ~1) ? this->vert : 0;
- this->vert_line_spacing[i] = (i & ~1) ? this->horiz : 0;
- }
- }
-
- this->driver_open = 1;
- msg (VM (2), _("%s: Initialization complete."), this->name);
-
- return 1;
-}
+ a = xzalloc (sizeof *a);
+ d = &a->driver;
+ output_driver_init (&a->driver, &ascii_driver_class, file_name, device_type);
+ a->append = parse_boolean (opt (d, o, "append", "false"));
+ a->headers = parse_boolean (opt (d, o, "headers", "false"));
+ a->paginate = parse_boolean (opt (d, o, "paginate", "false"));
+ a->squeeze_blank_lines = parse_boolean (opt (d, o, "squeeze", "true"));
+ a->emphasis = parse_enum (opt (d, o, "emphasis", "none"),
+ "bold", EMPH_BOLD,
+ "underline", EMPH_UNDERLINE,
+ "none", EMPH_NONE,
+ (char *) NULL);