X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fodt.c;h=ab38cd0411c91d779a860f86c7380896d6e425de;hb=f51ecb48027e6b1eb46840ae25888a25b429f012;hp=f02ae3defd559fbf54fb3504b78490d07b9182aa;hpb=cfbbebdd6b3085f4094c073e4ebd139ac1d37737;p=pspp-builds.git diff --git a/src/output/odt.c b/src/output/odt.c index f02ae3de..ab38cd04 100644 --- a/src/output/odt.c +++ b/src/output/odt.c @@ -66,10 +66,12 @@ struct odt_driver int table_num; }; +static const struct output_driver_class odt_driver_class; + static struct odt_driver * odt_driver_cast (struct output_driver *driver) { - assert (driver->class == &odt_class); + assert (driver->class == &odt_driver_class); return UP_CAST (driver, struct odt_driver, driver); } @@ -293,7 +295,7 @@ opt (struct output_driver *d, struct string_map *options, const char *key, } static struct output_driver * -odt_create (const char *name, enum output_device_type device_type, +odt_create (const char *file_name, enum settings_output_devices device_type, struct string_map *o) { struct output_driver *d; @@ -301,9 +303,9 @@ odt_create (const char *name, enum output_device_type device_type, odt = xzalloc (sizeof *odt); d = &odt->driver; - output_driver_init (d, &odt_class, name, device_type); + output_driver_init (d, &odt_driver_class, file_name, device_type); - odt->file_name = parse_string (opt (d, o, "output-file", "pspp.odt")); + odt->file_name = xstrdup (file_name); odt->debug = parse_boolean (opt (d, o, "debug", "false")); odt->dirname = xstrdup ("odt-XXXXXX"); @@ -521,11 +523,11 @@ odt_submit (struct output_driver *driver, } } -/* ODT driver class. */ -const struct output_driver_class odt_class = +struct output_driver_factory odt_driver_factory = { "odt", odt_create }; + +static const struct output_driver_class odt_driver_class = { "odf", - odt_create, odt_destroy, odt_submit, NULL,