diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-02-02 08:50:40 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-02-02 08:50:40 +0000 |
commit | b4d53ed380910c49013559ca0479f8899b97f793 (patch) | |
tree | fbdce3592343fefcad6dd9cd62581b715902f22c /print.c | |
parent | 20730353e274f1d75d7d6a595fe8682408d6d9c6 (diff) |
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
Diffstat (limited to 'print.c')
-rw-r--r-- | print.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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) @@ -861,6 +867,14 @@ print_line_text(print_stream_t *self, int indent, const char *line) } 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, |