Don't specify an hf[] item as using a range_string when it's really using a value_string.
[obnox/wireshark/wip.git] / print.c
diff --git a/print.c b/print.c
index bc5b5ac05a99cd2993ee1cf2a4d984565ee6931a..7243b8c0bf783c2f3d5c8643d8c3e9f70e57f7bf 100644 (file)
--- a/print.c
+++ b/print.c
@@ -47,6 +47,7 @@
 #include <epan/charsets.h>
 #include <epan/dissectors/packet-data.h>
 #include <epan/dissectors/packet-frame.h>
+#include <epan/filesystem.h>
 
 #define PDML_VERSION "0"
 #define PSML_VERSION "0"
@@ -243,12 +244,19 @@ void proto_tree_print_node(proto_node *node, gpointer data)
        }
 }
 
+#define PDML2HTML_XSL "pdml2html.xsl"
 void
-write_pdml_preamble(FILE *fh)
+write_pdml_preamble(FILE *fh, const gchar* filename)
 {
+       time_t t=time(NULL);
+       char *ts=asctime(localtime(&t));
+       ts[strlen(ts)-1]=0; /* overwrite \n */
+
        fputs("<?xml version=\"1.0\"?>\n", fh);
+       fputs("<?xml-stylesheet type=\"text/xsl\" href=\"" PDML2HTML_XSL "\"?>\n", fh);
+       fprintf(fh, "<!-- You can find " PDML2HTML_XSL " in %s or at http://anonsvn.wireshark.org/trunk/wireshark/" PDML2HTML_XSL ". -->\n", get_datafile_dir());
        fputs("<pdml version=\"" PDML_VERSION "\" ", fh);
-       fprintf(fh, "creator=\"%s/%s\">\n", PACKAGE, VERSION);
+       fprintf(fh, "creator=\"%s/%s\" time=\"%s\" capture_file=\"%s\">\n", PACKAGE, VERSION, ts, filename ? filename : "");
 }
 
 void
@@ -1285,7 +1293,7 @@ print_stream_ps_stdio_new(FILE *fh)
        return print_stream_ps_alloc(TRUE, fh);
 }
 
-output_fields_t* output_fields_new()
+output_fields_t* output_fields_new(void)
 {
     output_fields_t* fields = g_new(output_fields_t, 1);
     fields->print_header = FALSE;