diff options
author | Bertrand Guiheneuf <bertrand@src.gnome.org> | 1999-08-02 05:36:42 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 1999-08-02 05:36:42 +0800 |
commit | c54abe884b175add134cc07e8fda31ffa65cac26 (patch) | |
tree | de32af6f25286f1a337d69dc20c7979b841788c5 /camel/camel-stream.c | |
parent | 2c543492092832d71f1f677d52a42043c8787be7 (diff) | |
download | gsoc2013-evolution-c54abe884b175add134cc07e8fda31ffa65cac26.tar.gz gsoc2013-evolution-c54abe884b175add134cc07e8fda31ffa65cac26.tar.zst gsoc2013-evolution-c54abe884b175add134cc07e8fda31ffa65cac26.zip |
new memory buffer based stream.
* camel/camel-stream-mem.c:
* camel/camel-stream-mem.h:
new memory buffer based stream.
* camel/camel-stream-fs.c (_seek):
implementation for file system based stream.
* camel/camel-stream.c (camel_stream_seek):
new method.
* camel/camel-stream-fs.c (camel_stream_fs_class_init):
pass CamelStreamFsClass instead of CamelStreamClass.
svn path=/trunk/; revision=1056
Diffstat (limited to 'camel/camel-stream.c')
-rw-r--r-- | camel/camel-stream.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/camel/camel-stream.c b/camel/camel-stream.c index c66a950b26..b63a64ddb7 100644 --- a/camel/camel-stream.c +++ b/camel/camel-stream.c @@ -42,6 +42,12 @@ default_camel_close (CamelStream *stream) /* nothing */ } +static gint +default_camel_seek (CamelStream *stream, gint offset, CamelStreamSeekPolicy policy) +{ + /* nothing */ +} + static void camel_stream_class_init (CamelStreamClass *camel_stream_class) { @@ -55,6 +61,7 @@ camel_stream_class_init (CamelStreamClass *camel_stream_class) camel_stream_class->available = NULL; camel_stream_class->eos = NULL; camel_stream_class->close = default_camel_close; + camel_stream_class->seek = default_camel_seek; /* virtual method overload */ } @@ -169,6 +176,26 @@ camel_stream_close (CamelStream *stream) CS_CLASS (stream)->close (stream); } + +/** + * camel_stream_seek: + * @stream: a CamelStream object. + * @offset: offset value + * @policy: what to do with the offset + * + * + * + * Return value: new position, -1 if operation failed. + **/ +gint +camel_stream_seek (CamelStream *stream, gint offset, CamelStreamSeekPolicy policy) +{ + return CS_CLASS (stream)->seek (stream, offset, policy); +} + + + + /***************** Utility functions ********************/ /** |