Move code around
diff --git a/util/options.cc b/util/options.cc
index 4e75827..ff596d0 100644
--- a/util/options.cc
+++ b/util/options.cc
@@ -121,9 +121,10 @@
GError *parse_error = NULL;
if (!g_option_context_parse (context, argc, argv, &parse_error))
{
- if (parse_error != NULL)
+ if (parse_error != NULL) {
fail (TRUE, "%s", parse_error->message);
- else
+ //g_error_free (parse_error);
+ } else
fail (TRUE, "Option parse error");
}
}
@@ -543,3 +544,25 @@
*len = ret_len;
return ret;
}
+
+
+FILE *
+output_options_t::get_file_handle (void)
+{
+ if (fp)
+ return fp;
+
+ if (output_file)
+ fp = fopen (output_file, "wb");
+ else {
+#if HAVE_IO_H
+ _setmode (fileno (stdout), O_BINARY);
+#endif
+ fp = stdout;
+ }
+ if (!fp)
+ fail (FALSE, "Cannot open output file `%s': %s",
+ g_filename_display_name (output_file), strerror (errno));
+
+ return fp;
+}
diff --git a/util/options.hh b/util/options.hh
index 623e25a..c521e75 100644
--- a/util/options.hh
+++ b/util/options.hh
@@ -237,25 +237,7 @@
output_file = NULL; /* STDOUT */
}
- FILE *get_file_handle (void)
- {
- if (fp)
- return fp;
-
- if (output_file)
- fp = fopen (output_file, "wb");
- else {
-#if HAVE_IO_H
- _setmode (fileno (stdout), O_BINARY);
-#endif
- fp = stdout;
- }
- if (!fp)
- fail (FALSE, "Cannot open output file `%s': %s",
- g_filename_display_name (output_file), strerror (errno));
-
- return fp;
- }
+ FILE *get_file_handle (void);
virtual void init (const font_options_t *font_opts) = 0;
virtual void consume_line (hb_buffer_t *buffer,