aboutsummaryrefslogtreecommitdiffstats
path: root/print.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-03-11 20:56:31 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-03-11 20:56:31 +0000
commit801e9dd35ed92b0f716e94cc43ab9fc00540021c (patch)
treea8f2823f650d02e7545dd92884b614eb212e8c0e /print.c
parentb8a20994cbf84b0c52b9b1101228b1a7f5b8c797 (diff)
from Stefano Pettini: add CSV export function, similar to PSML export
svn path=/trunk/; revision=13724
Diffstat (limited to 'print.c')
-rw-r--r--print.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/print.c b/print.c
index 9c5f8f0f63..6c45b040d2 100644
--- a/print.c
+++ b/print.c
@@ -513,6 +513,37 @@ write_psml_finale(FILE *fh)
fputs("</psml>\n", fh);
}
+void
+write_csv_preamble(FILE *fh _U_)
+{
+
+}
+
+void
+proto_tree_write_csv(epan_dissect_t *edt, FILE *fh)
+{
+ gint i;
+
+ /* if this is the first packet, we have to write the CSV header */
+ if(edt->pi.fd->num == 1) {
+ for(i=0; i < edt->pi.cinfo->num_cols - 1; i++)
+ fprintf(fh, "\"%s\", ", edt->pi.cinfo->col_title[i]);
+
+ fprintf(fh, "\"%s\"\n", edt->pi.cinfo->col_title[i]);
+ }
+
+ for(i=0; i < edt->pi.cinfo->num_cols - 1; i++)
+ fprintf(fh, "\"%s\", ", edt->pi.cinfo->col_data[i]);
+
+ fprintf(fh, "\"%s\"\n", edt->pi.cinfo->col_data[i]);
+}
+
+void
+write_csv_finale(FILE *fh _U_)
+{
+
+}
+
/*
* Find the data source for a specified field, and return a pointer
* to the data in it. Returns NULL if the data is out of bounds.