diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-01-25 00:58:13 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-01-25 00:58:13 +0000 |
commit | 7502ac216ad7dcef048f1418eb8e34edb953ddac (patch) | |
tree | 6285e0506f94a9c4dfbf986131dd1b0f316d19bd /print.c | |
parent | 064d5e5e07127d79d1bb02b3c11ff4a5e2ef7939 (diff) | |
download | wireshark-7502ac216ad7dcef048f1418eb8e34edb953ddac.tar.gz wireshark-7502ac216ad7dcef048f1418eb8e34edb953ddac.tar.bz2 wireshark-7502ac216ad7dcef048f1418eb8e34edb953ddac.zip |
There's no need to keep a "FILE *" for the file being printed to in a
"capture_file" structure. Keep it locally, instead.
Check for errors when printing packets.
Report failure to open a print destination and failure to write to a
print destination differently.
Don't have the "print preamble" and "print final" routines return
success/failure indications - revert to the old scheme where they
didn't, and have the callers use "ferror()" to check for errors.
Report write errors when printing dissections in Tethereal.
Report print errors as errors, not warnings.
svn path=/trunk/; revision=9828
Diffstat (limited to 'print.c')
-rw-r--r-- | print.c | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -1,7 +1,7 @@ /* print.c * Routines for printing packet analysis trees. * - * $Id: print.c,v 1.70 2004/01/24 10:53:24 guy Exp $ + * $Id: print.c,v 1.71 2004/01/25 00:58:12 guy Exp $ * * Gilbert Ramirez <gram@alumni.rice.edu> * @@ -650,31 +650,27 @@ void ps_clean_string(unsigned char *out, const unsigned char *in, } /* Some formats need stuff at the beginning of the output */ -gboolean +void print_preamble(FILE *fh, gint format) { if (format == PR_FMT_PS) - return !print_ps_preamble(fh); + 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 */ -gboolean +void print_finale(FILE *fh, gint format) { if (format == PR_FMT_PS) - return !print_ps_finale(fh); + print_ps_finale(fh); else if (format == PR_FMT_PDML) { fputs("</pdml>\n", fh); - return !ferror(fh); - } else - return TRUE; + } } void |