aboutsummaryrefslogtreecommitdiffstats
path: root/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'print.c')
-rw-r--r--print.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/print.c b/print.c
index b9b5a5a847..e96b2e67d5 100644
--- a/print.c
+++ b/print.c
@@ -1,7 +1,7 @@
/* print.c
* Routines for printing packet analysis trees.
*
- * $Id: print.c,v 1.69 2004/01/09 18:49:31 sharpe Exp $
+ * $Id: print.c,v 1.70 2004/01/24 10:53:24 guy Exp $
*
* Gilbert Ramirez <gram@alumni.rice.edu>
*
@@ -78,13 +78,13 @@ FILE *open_print_dest(int to_file, const char *dest)
return fh;
}
-void close_print_dest(int to_file, FILE *fh)
+gboolean close_print_dest(int to_file, FILE *fh)
{
/* Close the file or command */
if (to_file)
- fclose(fh);
+ return (fclose(fh) == 0);
else
- pclose(fh);
+ return (pclose(fh) == 0);
}
@@ -650,27 +650,31 @@ void ps_clean_string(unsigned char *out, const unsigned char *in,
}
/* Some formats need stuff at the beginning of the output */
-void
+gboolean
print_preamble(FILE *fh, gint format)
{
if (format == PR_FMT_PS)
- print_ps_preamble(fh);
+ return !print_ps_preamble(fh);
else if (format == PR_FMT_PDML) {
fputs("<?xml version=\"1.0\"?>\n", fh);
fputs("<pdml version=\"" PDML_VERSION "\" ", fh);
fprintf(fh, "creator=\"%s/%s\">\n", PACKAGE, VERSION);
- }
+ return !ferror(fh);
+ } else
+ return TRUE;
}
/* Some formats need stuff at the end of the output */
-void
+gboolean
print_finale(FILE *fh, gint format)
{
if (format == PR_FMT_PS)
- print_ps_finale(fh);
+ return !print_ps_finale(fh);
else if (format == PR_FMT_PDML) {
fputs("</pdml>\n", fh);
- }
+ return !ferror(fh);
+ } else
+ return TRUE;
}
void