X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fhtml.c;h=9e7f567a27274866efda6d67fddef2ca74082d3c;hb=b779cc2fe07d6e8e66aad413e4644e8e124c65ff;hp=822c6b5c9b8f9c6c6844a49760f405f26e4694d7;hpb=b51ab36f5a828654ed03e96c90a1241852f6d70c;p=pspp diff --git a/src/output/html.c b/src/output/html.c index 822c6b5c9b..9e7f567a27 100644 --- a/src/output/html.c +++ b/src/output/html.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -47,10 +47,10 @@ struct html_driver { struct output_driver driver; - +#ifdef HAVE_CAIRO struct xr_color fg; struct xr_color bg; - +#endif char *file_name; char *chart_file_name; @@ -64,10 +64,10 @@ struct html_driver static const struct output_driver_class html_driver_class; -static void html_output_table (struct html_driver *, struct table_item *); +static void html_output_table (struct html_driver *, const struct table_item *); static void escape_string (FILE *file, const char *text, size_t length, - const char *space); + const char *space, const char *newline); static void print_title_tag (FILE *file, const char *name, const char *content); @@ -104,10 +104,10 @@ html_create (const char *file_name, enum settings_output_devices device_type, file_name)); html->file = NULL; html->chart_cnt = 1; - +#ifdef HAVE_CAIRO parse_color (d, o, "background-color", "#FFFFFFFFFFFF", &html->bg); parse_color (d, o, "foreground-color", "#000000000000", &html->fg); - +#endif html->file = fn_open (html->file_name, "w"); if (html->file == NULL) { @@ -200,7 +200,7 @@ print_title_tag (FILE *file, const char *name, const char *content) if (content != NULL) { fprintf (file, "<%s>", name); - escape_string (file, content, strlen (content), " "); + escape_string (file, content, strlen (content), " ", " - "); fprintf (file, "%s>\n", name); } } @@ -274,7 +274,7 @@ html_submit (struct output_driver *driver, case TEXT_ITEM_COMMAND_OPEN: fprintf (html->file, "
"); - escape_string (html->file, s, strlen (s), " "); + escape_string (html->file, s, strlen (s), " ", "\n"); break; @@ -325,19 +325,23 @@ html_submit (struct output_driver *driver, } } -/* Write LENGTH characters in TEXT to file F, escaping characters - as necessary for HTML. Spaces are replaced by SPACE, which - should be " " or " ". */ +/* Write LENGTH characters in TEXT to file F, escaping characters as necessary + for HTML. Spaces are replaced by SPACE, which should be " " or " " + New-lines are replaced by NEWLINE, which might be "
"); fprintf (html->file, "