struct output_buffer_t
{
output_buffer_t (option_parser_t *parser)
- : options (parser,
- g_strjoinv ("/", (gchar**) hb_buffer_serialize_list_formats ())),
+ : options (parser, hb_buffer_serialize_list_formats ()),
format (parser),
gs (NULL),
line_no (0),
{
if (options.explicit_output_format)
fail (false, "Unknown output format `%s'; supported formats are: %s",
- options.output_format, options.supported_formats);
+ options.output_format,
+ g_strjoinv ("/", const_cast<char**> (options.supported_formats)));
else
/* Just default to TEXT if not explicitly requested and the
* file extension is not recognized. */
return CAIRO_STATUS_SUCCESS;
}
-const char helper_cairo_supported_formats[] =
- "ansi"
+const char *helper_cairo_supported_formats[] =
+{
+ "ansi",
#ifdef CAIRO_HAS_PNG_FUNCTIONS
- "/png"
+ "png",
#endif
#ifdef CAIRO_HAS_SVG_SURFACE
- "/svg"
+ "svg",
#endif
#ifdef CAIRO_HAS_PDF_SURFACE
- "/pdf"
+ "pdf",
#endif
#ifdef CAIRO_HAS_PS_SURFACE
- "/ps"
+ "ps",
#ifdef HAS_EPS
- "/eps"
+ "eps",
#endif
#endif
-;
+ NULL
+};
cairo_t *
helper_cairo_create_context (double w, double h,
surface = constructor2 (stdio_write_func, f, w, h, content);
else
fail (false, "Unknown output format `%s'; supported formats are: %s%s",
- extension, helper_cairo_supported_formats,
+ extension,
+ g_strjoinv ("/", const_cast<char**> (helper_cairo_supported_formats)),
out_opts->explicit_output_format ? "" :
"\nTry setting format using --output-format");
helper_cairo_create_scaled_font (const font_options_t *font_opts,
double font_size);
-extern const char helper_cairo_supported_formats[];
+extern const char *helper_cairo_supported_formats[];
cairo_t *
helper_cairo_create_context (double w, double h,
if (NULL == supported_formats)
text = "Set output format";
else
- text = text_free = g_strdup_printf ("Set output format\n\n Supported formats are: %s", supported_formats);
+ {
+ char *items = g_strjoinv ("/", const_cast<char **> (supported_formats));
+ text = text_free = g_strdup_printf ("Set output format\n\n Supported formats are: %s", items);
+ g_free (items);
+ }
GOptionEntry entries[] =
{
template <typename Type> static inline Type MAX (const Type &a, const Type &b) { return a > b ? a : b; }
-void fail (hb_bool_t suggest_help, const char *format, ...) G_GNUC_NORETURN;
+void fail (hb_bool_t suggest_help, const char *format, ...) G_GNUC_NORETURN G_GNUC_PRINTF (2, 3);
extern hb_bool_t debug;
struct output_options_t : option_group_t
{
output_options_t (option_parser_t *parser,
- const char *supported_formats_ = NULL) {
+ const char **supported_formats_ = NULL) {
output_file = NULL;
output_format = NULL;
supported_formats = supported_formats_;
const char *output_file;
const char *output_format;
- const char *supported_formats;
+ const char **supported_formats;
bool explicit_output_format;
mutable FILE *fp;