-/* Create the "mimetype" file needed by ODF */
-static bool
-create_mimetype (const char *dirname)
-{
- FILE *fp;
- struct string filename;
- ds_init_cstr (&filename, dirname);
- ds_put_cstr (&filename, "/mimetype");
- fp = fopen (ds_cstr (&filename), "w");
-
- if (fp == NULL)
- {
- error (0, errno, _("failed to create output file %s"),
- ds_cstr (&filename));
- ds_destroy (&filename);
- return false;
- }
- ds_destroy (&filename);
-
- fprintf (fp, "application/vnd.oasis.opendocument.text");
- fclose (fp);
-
- return true;
-}
-
-/* Create a new XML file called FILENAME in the temp directory, and return a writer for it */
-static xmlTextWriterPtr
-create_writer (const struct odt_driver *driver, const char *filename)
+/* Creates a new temporary file and stores it in *FILE, then creates an XML
+ writer for it and stores it in *W. */
+static void
+create_writer (FILE **file, xmlTextWriterPtr *w)