X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fhtml.c;h=893c18527b7ff30e431762ede6658332e6fc5e46;hb=6f4d5b2819ec4fc3a19e553da8d8eee9b3e4d2e5;hp=d71ba0c20d20efbee687c69af769909d405a29a1;hpb=44326932c8227c64a87f7a92ef16ce83c2fba2d4;p=pspp
diff --git a/src/output/html.c b/src/output/html.c
index d71ba0c20d..893c18527b 100644
--- a/src/output/html.c
+++ b/src/output/html.c
@@ -1,47 +1,49 @@
-/* PSPP - computes sample statistics.
+/* PSPP - a program for statistical analysis.
Copyright (C) 1997-9, 2000 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 the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this program. If not, see . */
#include
#include "chart.h"
#include "htmlP.h"
#include
+#include
#include
#include
#include
#include
-#include
#include
#include
#include
#include "error.h"
-#include "getline.h"
-#include "getlogin_r.h"
#include "output.h"
#include "manager.h"
#include "table.h"
#include
-#include "size_max.h"
+#include "xalloc.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
+/* HTML driver options: (defaults listed first)
+
+ output-file="pspp.html"
+ chart-files="pspp-#.png"
+*/
+
static void escape_string (FILE *file,
const char *text, size_t length,
const char *space);
@@ -69,7 +71,7 @@ html_open_driver (struct outp_driver *this, struct substring options)
error (0, errno, _("opening HTML output file: %s"), x->file_name);
goto error;
}
-
+
fputs ("\n", x->file);
fputs ("\n", x->file);
@@ -86,12 +88,10 @@ html_open_driver (struct outp_driver *this, struct substring options)
fputs (" LINK=\"#1f00ff\" ALINK=\"#ff0000\" VLINK=\"#9900dd\">\n", x->file);
print_title_tag (x->file, "H1", outp_title);
print_title_tag (x->file, "H2", outp_subtitle);
- free (x->chart_file_name);
return true;
error:
- free (x->chart_file_name);
this->class->close_driver (this);
return false;
}
@@ -99,9 +99,9 @@ html_open_driver (struct outp_driver *this, struct substring options)
/* Emits CONTENT to the output, escaping CONTENT as
necessary for HTML. */
static void
-print_title_tag (FILE *file, const char *name, const char *content)
+print_title_tag (FILE *file, const char *name, const char *content)
{
- if (content != NULL)
+ if (content != NULL)
{
fprintf (file, "<%s>", name);
escape_string (file, content, strlen (content), " ");
@@ -114,25 +114,26 @@ html_close_driver (struct outp_driver *this)
{
struct html_driver_ext *x = this->ext;
bool ok;
-
- if (x->file != NULL)
+
+ if (x->file != NULL)
{
fprintf (x->file,
"\n"
"