Initial attempt at an ODF driver
[pspp-builds.git] / src / output / output.c
index 6082d2490c0e6091477cebd67f1e26f0d8219709..a556ad81e8e7b1f49584261829459988b83b732b 100644 (file)
@@ -230,6 +230,7 @@ outp_init (void)
 #ifdef HAVE_CAIRO
   add_class (&cairo_class);
 #endif
+  add_class (&odt_class);
 
   add_name (def, &def[strlen (def)], OUTP_S_INIT_FILE);
 }
@@ -594,10 +595,9 @@ get_option_token (struct substring *s, const char *driver_name,
 }
 
 bool
-outp_parse_options (struct substring options,
-                    bool (*callback) (struct outp_driver *, const char *key,
-                                      const struct string *value),
-                    struct outp_driver *driver)
+outp_parse_options (const char *driver_name, struct substring options,
+                    bool (*callback) (void *aux, const char *key,
+                                      const struct string *value), void *aux)
 {
   struct string key = DS_EMPTY_INITIALIZER;
   struct string value = DS_EMPTY_INITIALIZER;
@@ -610,7 +610,7 @@ outp_parse_options (struct substring options,
       if (ss_is_empty (left))
         break;
 
-      if (!get_option_token (&left, driver->name, &key))
+      if (!get_option_token (&left, driver_name, &key))
         break;
 
       ss_ltrim (&left, ss_cstr (CC_SPACES));
@@ -618,15 +618,15 @@ outp_parse_options (struct substring options,
        {
          error (0, 0, _("syntax error expecting `=' "
                          "parsing options for driver \"%s\""),
-                 driver->name);
+                 driver_name);
          break;
        }
 
       ss_ltrim (&left, ss_cstr (CC_SPACES));
-      if (!get_option_token (&left, driver->name, &value))
+      if (!get_option_token (&left, driver_name, &value))
         break;
 
-      ok = callback (driver, ds_cstr (&key), &value);
+      ok = callback (aux, ds_cstr (&key), &value);
     }
   while (ok);
 
@@ -707,7 +707,6 @@ outp_allocate_driver (const struct outp_class *class,
   d->device = types;
   d->cp_x = d->cp_y = 0;
   d->ext = NULL;
-  d->prc = NULL;
   return d;
 }