aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-04-01 12:44:17 +0800
committerDan Winship <danw@src.gnome.org>2000-04-01 12:44:17 +0800
commit30b690a363c80fbe3caa7bbef104702e588d6812 (patch)
treecd5f916577a650f825c2edbeb0aeee769b368cc4 /camel
parent74b6039c5287b433038a5ece91874f19a862a184 (diff)
downloadgsoc2013-evolution-30b690a363c80fbe3caa7bbef104702e588d6812.tar.gz
gsoc2013-evolution-30b690a363c80fbe3caa7bbef104702e588d6812.tar.zst
gsoc2013-evolution-30b690a363c80fbe3caa7bbef104702e588d6812.zip
implement unimplemented methods
* camel-stream-mem.c: implement unimplemented methods svn path=/trunk/; revision=2275
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog2
-rw-r--r--camel/camel-stream-mem.c25
2 files changed, 15 insertions, 12 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 4b837a4a3b..7ff2cf9557 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,7 @@
2000-03-31 Dan Winship <danw@helixcode.com>
+ * camel-stream-mem.c: implement unimplemented methods
+
* gmime-content-field.c
(gmime_content_field_construct_from_string):
* data-wrapper-repository.c
diff --git a/camel/camel-stream-mem.c b/camel/camel-stream-mem.c
index 8842e229cc..1c6d7ef3a9 100644
--- a/camel/camel-stream-mem.c
+++ b/camel/camel-stream-mem.c
@@ -143,12 +143,10 @@ _finalize (GtkObject *object)
{
CamelStreamMem *stream_mem = CAMEL_STREAM_MEM (object);
+ if (stream_mem->buffer)
+ g_byte_array_free (stream_mem->buffer, TRUE);
- CAMEL_LOG_FULL_DEBUG ("Entering CamelStreamMem::finalize\n");
- g_byte_array_free (stream_mem->buffer, TRUE);
-
GTK_OBJECT_CLASS (parent_class)->finalize (object);
- CAMEL_LOG_FULL_DEBUG ("Leaving CamelStreamMem::finalize\n");
}
@@ -215,7 +213,8 @@ _write (CamelStream *stream, const gchar *buffer, gint n)
static void
_flush (CamelStream *stream)
{
- g_warning ("Not implemented yet");
+ /* Nothing to do. */
+ return;
}
@@ -231,8 +230,9 @@ _flush (CamelStream *stream)
static gint
_available (CamelStream *stream)
{
- g_warning ("Not implemented yet");
- return -1;
+ CamelStreamMem *camel_stream_mem = CAMEL_STREAM_MEM (stream);
+
+ return camel_stream_mem->buffer->len - camel_stream_mem->position;
}
@@ -240,15 +240,12 @@ _available (CamelStream *stream)
* _eos: test if there are bytes left to read
* @stream: the stream
*
- *
- *
* Return value: true if all stream has been read
**/
static gboolean
_eos (CamelStream *stream)
{
- g_warning ("Not implemented yet");
- return FALSE;
+ return _available (stream) == 0;
}
@@ -261,7 +258,11 @@ _eos (CamelStream *stream)
static void
_close (CamelStream *stream)
{
- g_warning ("Not implemented yet");
+ CamelStreamMem *stream_mem = CAMEL_STREAM_MEM (stream);
+
+ if (stream_mem->buffer)
+ g_byte_array_free (stream_mem->buffer, TRUE);
+ stream_mem->buffer = NULL;
}