aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-stream-fs.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>2000-02-15 06:27:54 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>2000-02-15 06:27:54 +0800
commit6cffd8501c17f06066196a19674d6af225ff6381 (patch)
treecc42e7ef4e55ca8bbcf0e879f8b31b35a28289e9 /camel/camel-stream-fs.c
parentfe058b1be72112298e356343f3a8b35fd60a072b (diff)
downloadgsoc2013-evolution-6cffd8501c17f06066196a19674d6af225ff6381.tar
gsoc2013-evolution-6cffd8501c17f06066196a19674d6af225ff6381.tar.gz
gsoc2013-evolution-6cffd8501c17f06066196a19674d6af225ff6381.tar.bz2
gsoc2013-evolution-6cffd8501c17f06066196a19674d6af225ff6381.tar.lz
gsoc2013-evolution-6cffd8501c17f06066196a19674d6af225ff6381.tar.xz
gsoc2013-evolution-6cffd8501c17f06066196a19674d6af225ff6381.tar.zst
gsoc2013-evolution-6cffd8501c17f06066196a19674d6af225ff6381.zip
use the eos stream method. (gmime_read_line_from_stream): ditto.
2000-02-14 bertrand <Bertrand.Guiheneuf@aful.org> * camel/gmime-utils.c (get_header_array_from_stream): use the eos stream method. (gmime_read_line_from_stream): ditto. * camel/camel-stream-fs.h (struct ): add the eof field cosmetics changes. * camel/camel-stream-fs.c (camel_stream_fs_init): set eof. (_read): set eof on end of file. (_eos): implemented. * camel/gmime-utils.c (get_header_array_from_stream): make a blocking version of the header parser. When the fs stream uses gnome-vfs, this should be changed. (gmime_read_line_from_stream): ditto. svn path=/trunk/; revision=1779
Diffstat (limited to 'camel/camel-stream-fs.c')
-rw-r--r--camel/camel-stream-fs.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c
index e816f88b6b..4571687ca7 100644
--- a/camel/camel-stream-fs.c
+++ b/camel/camel-stream-fs.c
@@ -43,7 +43,7 @@ static CamelSeekableStreamClass *parent_class=NULL;
static gint _read (CamelStream *stream, gchar *buffer, gint n);
static gint _write (CamelStream *stream, const gchar *buffer, gint n);
static void _flush (CamelStream *stream);
-static gint _available (CamelStream *stream);
+static gboolean _available (CamelStream *stream);
static gboolean _eos (CamelStream *stream);
static void _close (CamelStream *stream);
static gint _seek (CamelSeekableStream *stream, gint offset, CamelStreamSeekPolicy policy);
@@ -93,6 +93,7 @@ camel_stream_fs_init (gpointer object, gpointer klass)
CamelStreamFs *stream = CAMEL_STREAM_FS (object);
stream->name = NULL;
+ stream->eof = FALSE;
}
@@ -357,6 +358,9 @@ _read (CamelStream *stream, gchar *buffer, gint n)
else
CAMEL_SEEKABLE_STREAM (stream)->cur_pos += v;
+ if (v == 0)
+ stream_fs->eof = TRUE;
+
return v;
}
@@ -430,11 +434,11 @@ _flush (CamelStream *stream)
*
* Return value: the number of bytes available
**/
-static gint
+static gboolean
_available (CamelStream *stream)
{
g_warning ("Not implemented yet");
- return -1;
+ return FALSE;
}
@@ -449,8 +453,10 @@ _available (CamelStream *stream)
static gboolean
_eos (CamelStream *stream)
{
- g_warning ("Not implemented yet");
- return FALSE;
+ CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream);
+
+ g_assert (stream_fs);
+ return stream_fs->eof;
}