diff options
author | bertrand <Bertrand.Guiheneuf@aful.org> | 2000-02-18 06:16:33 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 2000-02-18 06:16:33 +0800 |
commit | 39400a38c775a76faa342d519454d789e55bb90d (patch) | |
tree | 62b607d5e8edfc3b8f82253a39e0f58293ea6144 /camel/camel-seekable-stream.c | |
parent | 0996e4f1ac82ee9fe15be3367d90e0dffd21d936 (diff) | |
download | gsoc2013-evolution-39400a38c775a76faa342d519454d789e55bb90d.tar gsoc2013-evolution-39400a38c775a76faa342d519454d789e55bb90d.tar.gz gsoc2013-evolution-39400a38c775a76faa342d519454d789e55bb90d.tar.bz2 gsoc2013-evolution-39400a38c775a76faa342d519454d789e55bb90d.tar.lz gsoc2013-evolution-39400a38c775a76faa342d519454d789e55bb90d.tar.xz gsoc2013-evolution-39400a38c775a76faa342d519454d789e55bb90d.tar.zst gsoc2013-evolution-39400a38c775a76faa342d519454d789e55bb90d.zip |
use camel_stream_reset instead of seek. The formatter should be able to
2000-02-17 bertrand <Bertrand.Guiheneuf@aful.org>
* camel/camel-formatter.c (handle_text_plain):
(handle_text_html): use camel_stream_reset instead
of seek. The formatter should be able to work
with all streams, not only seekable streams.
In the case where some provider implementation
would not be able to provide a reset method
to their stream, implementors would have
to find a workaround.
* camel/camel-session.c (camel_session_new): use
(void) instean of () in function decl.
* camel/camel-folder.c: ifdef async operation
related code.
* camel/camel-seekable-stream.c (_seek): added a warning.
(_reset): default implementation of reset for seekable
stream.
* camel/camel-mime-message.h: set_received_date declaration fix.
cosmetic changes.
* camel/providers/mbox/camel-mbox-provider.c (camel_provider_module_init):
use (void) instead of ().
* camel/camel-stream.c (camel_stream_reset):
new method for CamelStream.
svn path=/trunk/; revision=1835
Diffstat (limited to 'camel/camel-seekable-stream.c')
-rw-r--r-- | camel/camel-seekable-stream.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/camel/camel-seekable-stream.c b/camel/camel-seekable-stream.c index 55bbbd611a..1afb02d442 100644 --- a/camel/camel-seekable-stream.c +++ b/camel/camel-seekable-stream.c @@ -35,19 +35,24 @@ static CamelStreamClass *parent_class=NULL; /* Returns the class for a CamelSeekableStream */ #define CSS_CLASS(so) CAMEL_SEEKABLE_STREAM_CLASS (GTK_OBJECT(so)->klass) -static gint _seek (CamelSeekableStream *stream, gint offset, CamelStreamSeekPolicy policy); +static gint _seek (CamelSeekableStream *stream, + gint offset, + CamelStreamSeekPolicy policy); +static void _reset (CamelStream *stream); static void camel_seekable_stream_class_init (CamelSeekableStreamClass *camel_seekable_stream_class) { CamelStreamClass *camel_stream_class = CAMEL_STREAM_CLASS (camel_seekable_stream_class); - GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (camel_seekable_stream_class); parent_class = gtk_type_class (camel_stream_get_type ()); + /* seekable stream methods */ camel_seekable_stream_class->seek = _seek; + /* camel stream methods overload */ + camel_stream_class->reset = _reset; } GtkType @@ -82,6 +87,7 @@ _seek (CamelSeekableStream *stream, gint offset, CamelStreamSeekPolicy policy) { + g_warning ("CamelSeekableStream::seek called on default implementation \n"); return -1; } @@ -124,6 +130,17 @@ camel_seekable_stream_get_current_position (CamelSeekableStream *stream) +/* a default implementation of reset for seekable streams */ +static void +_reset (CamelStream *stream) +{ + CamelSeekableStream *seekable_stream; + + g_assert (stream); + seekable_stream = CAMEL_SEEKABLE_STREAM (stream); + + camel_seekable_stream_seek (seekable_stream, 0, CAMEL_STREAM_SET); +} |