From b4d53ed380910c49013559ca0479f8899b97f793 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Wed, 2 Feb 2005 08:50:40 +0000 Subject: from chris eagle add radiobutton to allow saving raw tcpstreams these radiobuttons should, by someone that uses, this feature be changed into a menu instead. svn path=/trunk/; revision=13236 --- print.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'print.c') diff --git a/print.c b/print.c index a95e3c859b..1f0fd534d0 100644 --- a/print.c +++ b/print.c @@ -797,6 +797,12 @@ print_line(print_stream_t *self, int indent, const char *line) return (self->ops->print_line)(self, indent, line); } +gboolean +print_raw(print_stream_t *self, const unsigned char *buf, int len) +{ + return (self->ops->print_raw)(self, buf, len); +} + /* Insert bookmark */ gboolean print_bookmark(print_stream_t *self, const gchar *name, const gchar *title) @@ -860,6 +866,14 @@ print_line_text(print_stream_t *self, int indent, const char *line) return !ferror(output->fh); } +static gboolean +print_raw_text(print_stream_t *self, const unsigned char *buf, int len) +{ + output_text *output = self->data; + fwrite(buf, 1, len, output->fh); + return !ferror(output->fh); +} + static gboolean print_bookmark_text(print_stream_t *self _U_, const gchar *name _U_, const gchar *title _U_) @@ -899,6 +913,7 @@ destroy_text(print_stream_t *self) static const print_stream_ops_t print_text_ops = { print_preamble_text, print_line_text, + print_raw_text, print_bookmark_text, new_page_text, print_finale_text, @@ -1039,6 +1054,7 @@ destroy_ps(print_stream_t *self) static const print_stream_ops_t print_ps_ops = { print_preamble_ps, print_line_ps, + print_line_ps, print_bookmark_ps, new_page_ps, print_finale_ps, -- cgit v1.2.3