- Subject: Re: [Ethereal-dev] Follow TCP Stream dialog fixes
- From: Guy Harris <gharris@xxxxxxxxx>
- Date: Wed, 02 Feb 2005 02:42:11 -0800
ronnie sahlberg wrote:
your patch does not compile.
it broke the structure print_text_ops in print.c
Adding "raw" as a print op was the wrong thing to do in any case; I've
checked in a subsequent change that reverts the changes to print.c and
print.h, and has a routine in gtk/follow_dlg.c that takes a "FILE *"
rather than a "print_stream_t *" and fwrites the data, which is used for
writing the raw data.
I've also made it open the output file with "w", rather than "wb", for
the other print formats, so that the proper line endings are used for
the platform on which the file is being written. However, that points
out that, when printing ASCII, EBCDIC, hex dump, and C arrays, it really
should be sending one line at a time to print.c's "print_line()" -
future subclasses of a print stream might expect to be handed lines
(e.g., if they use the native OS or desktop environment print API, which
might expect to be handed lines).
That might also fix the problem wherein C arrays appear to display
correctly, but get written out with extra blank lines every other line.
I've put a comment to that effect in the code.
Also, are "raw" and "C arrays" useful as *display* formats? Perhaps
there should only be ASCII, EBCDIC, and hex dump as display formats, and
"Save As" should allow "Text", "C arrays", and "Raw data" as save
options, with "Text" writing it out in the display format, "C arrays"
writing it out as C arrays, and "Raw" writing it out as raw data.