/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2007, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static void ascii_flush (struct outp_driver *);
static int get_default_box_char (size_t idx);
static bool update_page_size (struct outp_driver *, bool issue_error);
-static bool handle_option (struct outp_driver *this, const char *key,
+static bool handle_option (void *this, const char *key,
const struct string *val);
static bool
-ascii_open_driver (struct outp_driver *this, struct substring options)
+ascii_open_driver (const char *name, int types, struct substring options)
{
+ struct outp_driver *this;
struct ascii_driver_ext *x;
int i;
+ this = outp_allocate_driver (&ascii_class, name, types);
this->width = 79;
this->font_height = 1;
this->prop_em_width = 1;
x->line_cap = 0;
x->chart_cnt = 0;
- if (!outp_parse_options (options, handle_option, this))
+ if (!outp_parse_options (this->name, options, handle_option, this))
goto error;
if (!update_page_size (this, true))
x->box[i] = pool_strdup (x->pool, s);
}
+ outp_register_driver (this);
+
return true;
error:
pool_destroy (x->pool);
+ outp_free_driver (this);
return false;
}
};
static bool
-handle_option (struct outp_driver *this, const char *key,
+handle_option (void *this_, const char *key,
const struct string *val)
{
+ struct outp_driver *this = this_;
struct ascii_driver_ext *x = this->ext;
int subcat;
const char *value;