diff options
author | Dan Winship <danw@src.gnome.org> | 2000-04-01 12:44:17 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-04-01 12:44:17 +0800 |
commit | 30b690a363c80fbe3caa7bbef104702e588d6812 (patch) | |
tree | cd5f916577a650f825c2edbeb0aeee769b368cc4 /camel/camel-stream-mem.c | |
parent | 74b6039c5287b433038a5ece91874f19a862a184 (diff) | |
download | gsoc2013-evolution-30b690a363c80fbe3caa7bbef104702e588d6812.tar gsoc2013-evolution-30b690a363c80fbe3caa7bbef104702e588d6812.tar.gz gsoc2013-evolution-30b690a363c80fbe3caa7bbef104702e588d6812.tar.bz2 gsoc2013-evolution-30b690a363c80fbe3caa7bbef104702e588d6812.tar.lz gsoc2013-evolution-30b690a363c80fbe3caa7bbef104702e588d6812.tar.xz 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/camel-stream-mem.c')
-rw-r--r-- | camel/camel-stream-mem.c | 25 |
1 files changed, 13 insertions, 12 deletions
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; } |